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.
345 lines
677 KiB
345 lines
677 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[159,7,10,17],{"+NIl":function(vt,Qe,y){(function(E){E(y("VrN/"))})(function(E){"use strict";E.defineMode("stex",function(ce,V){"use strict";function H(Q,K){Q.cmdState.push(K)}function C(Q){return Q.cmdState.length>0?Q.cmdState[Q.cmdState.length-1]:null}function re(Q){var K=Q.cmdState.pop();K&&K.closeBracket()}function S(Q){for(var K=Q.cmdState,N=K.length-1;N>=0;N--){var W=K[N];if(W.name=="DEFAULT")continue;return W}return{styleIdentifier:function(){return null}}}function F(Q,K,N){return function(){this.name=Q,this.bracketNo=0,this.style=K,this.styles=N,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var U={};U.importmodule=F("importmodule","tag",["string","builtin"]),U.documentclass=F("documentclass","tag",["","atom"]),U.usepackage=F("usepackage","tag",["atom"]),U.begin=F("begin","tag",["atom"]),U.end=F("end","tag",["atom"]),U.label=F("label","tag",["atom"]),U.ref=F("ref","tag",["atom"]),U.eqref=F("eqref","tag",["atom"]),U.cite=F("cite","tag",["atom"]),U.bibitem=F("bibitem","tag",["atom"]),U.Bibitem=F("Bibitem","tag",["atom"]),U.RBibitem=F("RBibitem","tag",["atom"]),U.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function $(Q,K){Q.f=K}function M(Q,K){var N;if(Q.match(/^\\[a-zA-Z@]+/)){var W=Q.current().slice(1);return N=U.hasOwnProperty(W)?U[W]:U.DEFAULT,N=new N,H(K,N),$(K,te),N.style}if(Q.match(/^\\[$&%#{}_]/))return"tag";if(Q.match(/^\\[,;!\/\\]/))return"tag";if(Q.match("\\["))return $(K,function(fe,Re){return O(fe,Re,"\\]")}),"keyword";if(Q.match("\\("))return $(K,function(fe,Re){return O(fe,Re,"\\)")}),"keyword";if(Q.match("$$"))return $(K,function(fe,Re){return O(fe,Re,"$$")}),"keyword";if(Q.match("$"))return $(K,function(fe,Re){return O(fe,Re,"$")}),"keyword";var ee=Q.next();if(ee=="%")return Q.skipToEnd(),"comment";if(ee=="}"||ee=="]"){if(N=C(K),N)N.closeBracket(ee),$(K,te);else return"error";return"bracket"}else return ee=="{"||ee=="["?(N=U.DEFAULT,N=new N,H(K,N),"bracket"):/\d/.test(ee)?(Q.eatWhile(/[\w.%]/),"atom"):(Q.eatWhile(/[\w\-_]/),N=S(K),N.name=="begin"&&(N.argument=Q.current()),N.styleIdentifier())}function O(Q,K,N){if(Q.eatSpace())return null;if(N&&Q.match(N))return $(K,M),"keyword";if(Q.match(/^\\[a-zA-Z@]+/))return"tag";if(Q.match(/^[a-zA-Z]+/))return"variable-2";if(Q.match(/^\\[$&%#{}_]/))return"tag";if(Q.match(/^\\[,;!\/]/))return"tag";if(Q.match(/^[\^_&]/))return"tag";if(Q.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Q.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var W=Q.next();return W=="{"||W=="}"||W=="["||W=="]"||W=="("||W==")"?"bracket":W=="%"?(Q.skipToEnd(),"comment"):"error"}function te(Q,K){var N=Q.peek(),W;return N=="{"||N=="["?(W=C(K),W.openBracket(N),Q.eat(N),$(K,M),"bracket"):/[ \t\r]/.test(N)?(Q.eat(N),null):($(K,M),re(K),M(Q,K))}return{startState:function(){var Q=V.inMathMode?function(K,N){return O(K,N)}:M;return{cmdState:[],f:Q}},copyState:function(Q){return{cmdState:Q.cmdState.slice(),f:Q.f}},token:function(Q,K){return K.f(Q,K)},blankLine:function(Q){Q.f=M,Q.cmdState.length=0},lineComment:"%"}}),E.defineMIME("text/x-stex","stex"),E.defineMIME("text/x-latex","stex")})},"+QRC":function(vt,Qe,y){"use strict";var E=y("E9nw"),ce={"text/plain":"Text","text/html":"Url",default:"Text"},V="Copy to clipboard: #{key}, Enter";function H(re){var S=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return re.replace(/#{\s*key\s*}/g,S)}function C(re,S){var F,U,$,M,O,te,Q=!1;S||(S={}),F=S.debug||!1;try{$=E(),M=document.createRange(),O=document.getSelection(),te=document.createElement("span"),te.textContent=re,te.style.all="unset",te.style.position="fixed",te.style.top=0,te.style.clip="rect(0, 0, 0, 0)",te.style.whiteSpace="pre",te.style.webkitUserSelect="text",te.style.MozUserSelect="text",te.style.msUserSelect="text",te.style.userSelect="text",te.addEventListener("copy",function(N){if(N.stopPropagation(),S.format)if(N.preventDefault(),typeof N.clipboardData=="undefined"){F&&console.warn("unable to use e.clipboardData"),F&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var W=ce[S.format]||ce.default;window.clipboardData.setData(W,re)}else N.clipboardData.clearData(),N.clipboardData.setData(S.format,re);S.onCopy&&(N.preventDefault(),S.onCopy(N.clipboardData))}),document.body.appendChild(te),M.selectNodeContents(te),O.addRange(M);var K=document.execCommand("copy");if(!K)throw new Error("copy command was unsuccessful");Q=!0}catch(N){F&&console.error("unable to copy using execCommand: ",N),F&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(S.format||"text",re),S.onCopy&&S.onCopy(window.clipboardData),Q=!0}catch(W){F&&console.error("unable to copy using clipboardData: ",W),F&&console.error("falling back to prompt"),U=H("message"in S?S.message:V),window.prompt(U,re)}}finally{O&&(typeof O.removeRange=="function"?O.removeRange(M):O.removeAllRanges()),te&&document.body.removeChild(te),$()}return Q}vt.exports=C},"19Vz":function(vt,Qe,y){(function(E){E(y("VrN/"))})(function(E){E.defineOption("placeholder","",function(F,U,$){var M=$&&$!=E.Init;if(U&&!M)F.on("blur",C),F.on("change",re),F.on("swapDoc",re),E.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){H(F)}),re(F);else if(!U&&M){F.off("blur",C),F.off("change",re),F.off("swapDoc",re),E.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),ce(F);var O=F.getWrapperElement();O.className=O.className.replace(" CodeMirror-empty","")}U&&!F.hasFocus()&&C(F)});function ce(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function V(F){ce(F);var U=F.state.placeholder=document.createElement("pre");U.style.cssText="height: 0; overflow: visible",U.style.direction=F.getOption("direction"),U.className="CodeMirror-placeholder CodeMirror-line-like";var $=F.getOption("placeholder");typeof $=="string"&&($=document.createTextNode($)),U.appendChild($),F.display.lineSpace.insertBefore(U,F.display.lineSpace.firstChild)}function H(F){setTimeout(function(){var U=!1,$=F.getInputField();$.nodeName=="TEXTAREA"?U=!$.value:F.lineCount()==1&&(U=!/[^\u200b]/.test($.querySelector(".CodeMirror-line").textContent)),U?V(F):ce(F)},20)}function C(F){S(F)&&V(F)}function re(F){var U=F.getWrapperElement(),$=S(F);U.className=U.className.replace(" CodeMirror-empty","")+($?" CodeMirror-empty":""),$?V(F):ce(F)}function S(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(vt,Qe,y){(function(E){E(y("VrN/"))})(function(E){"use strict";var ce={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},V={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};E.defineMode("xml",function(H,C){var re=H.indentUnit,S={},F=C.htmlMode?ce:V;for(var U in F)S[U]=F[U];for(var U in C)S[U]=C[U];var $,M;function O(L,ke){function ve(le){return ke.tokenize=le,le(L,ke)}var k=L.next();if(k=="<")return L.eat("!")?L.eat("[")?L.match("CDATA[")?ve(K("atom","]]>")):null:L.match("--")?ve(K("comment","-->")):L.match("DOCTYPE",!0,!0)?(L.eatWhile(/[\w\._\-]/),ve(N(1))):null:L.eat("?")?(L.eatWhile(/[\w\._\-]/),ke.tokenize=K("meta","?>"),"meta"):($=L.eat("/")?"closeTag":"openTag",ke.tokenize=te,"tag bracket");if(k=="&"){var G;return L.eat("#")?L.eat("x")?G=L.eatWhile(/[a-fA-F\d]/)&&L.eat(";"):G=L.eatWhile(/[\d]/)&&L.eat(";"):G=L.eatWhile(/[\w\.\-:]/)&&L.eat(";"),G?"atom":"error"}else return L.eatWhile(/[^&<]/),null}O.isInText=!0;function te(L,ke){var ve=L.next();if(ve==">"||ve=="/"&&L.eat(">"))return ke.tokenize=O,$=ve==">"?"endTag":"selfcloseTag","tag bracket";if(ve=="=")return $="equals",null;if(ve=="<"){ke.tokenize=O,ke.state=Re,ke.tagName=ke.tagStart=null;var k=ke.tokenize(L,ke);return k?k+" tag error":"tag error"}else return/[\'\"]/.test(ve)?(ke.tokenize=Q(ve),ke.stringStartCol=L.column(),ke.tokenize(L,ke)):(L.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Q(L){var ke=function(ve,k){for(;!ve.eol();)if(ve.next()==L){k.tokenize=te;break}return"string"};return ke.isInAttribute=!0,ke}function K(L,ke){return function(ve,k){for(;!ve.eol();){if(ve.match(ke)){k.tokenize=O;break}ve.next()}return L}}function N(L){return function(ke,ve){for(var k;(k=ke.next())!=null;){if(k=="<")return ve.tokenize=N(L+1),ve.tokenize(ke,ve);if(k==">")if(L==1){ve.tokenize=O;break}else return ve.tokenize=N(L-1),ve.tokenize(ke,ve)}return"meta"}}function W(L,ke,ve){this.prev=L.context,this.tagName=ke,this.indent=L.indented,this.startOfLine=ve,(S.doNotIndent.hasOwnProperty(ke)||L.context&&L.context.noIndent)&&(this.noIndent=!0)}function ee(L){L.context&&(L.context=L.context.prev)}function fe(L,ke){for(var ve;;){if(!L.context)return;if(ve=L.context.tagName,!S.contextGrabbers.hasOwnProperty(ve)||!S.contextGrabbers[ve].hasOwnProperty(ke))return;ee(L)}}function Re(L,ke,ve){return L=="openTag"?(ve.tagStart=ke.column(),Ke):L=="closeTag"?_e:Re}function Ke(L,ke,ve){return L=="word"?(ve.tagName=ke.current(),M="tag",Ce):S.allowMissingTagName&&L=="endTag"?(M="tag bracket",Ce(L,ke,ve)):(M="error",Ke)}function _e(L,ke,ve){if(L=="word"){var k=ke.current();return ve.context&&ve.context.tagName!=k&&S.implicitlyClosed.hasOwnProperty(ve.context.tagName)&&ee(ve),ve.context&&ve.context.tagName==k||S.matchClosing===!1?(M="tag",ye):(M="tag error",Ae)}else return S.allowMissingTagName&&L=="endTag"?(M="tag bracket",ye(L,ke,ve)):(M="error",Ae)}function ye(L,ke,ve){return L!="endTag"?(M="error",ye):(ee(ve),Re)}function Ae(L,ke,ve){return M="error",ye(L,ke,ve)}function Ce(L,ke,ve){if(L=="word")return M="attribute",Ee;if(L=="endTag"||L=="selfcloseTag"){var k=ve.tagName,G=ve.tagStart;return ve.tagName=ve.tagStart=null,L=="selfcloseTag"||S.autoSelfClosers.hasOwnProperty(k)?fe(ve,k):(fe(ve,k),ve.context=new W(ve,k,G==ve.indented)),Re}return M="error",Ce}function Ee(L,ke,ve){return L=="equals"?Fe:(S.allowMissing||(M="error"),Ce(L,ke,ve))}function Fe(L,ke,ve){return L=="string"?me:L=="word"&&S.allowUnquoted?(M="string",Ce):(M="error",Ce(L,ke,ve))}function me(L,ke,ve){return L=="string"?me:Ce(L,ke,ve)}return{startState:function(L){var ke={tokenize:O,state:Re,indented:L||0,tagName:null,tagStart:null,context:null};return L!=null&&(ke.baseIndent=L),ke},token:function(L,ke){if(!ke.tagName&&L.sol()&&(ke.indented=L.indentation()),L.eatSpace())return null;$=null;var ve=ke.tokenize(L,ke);return(ve||$)&&ve!="comment"&&(M=null,ke.state=ke.state($||ve,L,ke),M&&(ve=M=="error"?ve+" error":M)),ve},indent:function(L,ke,ve){var k=L.context;if(L.tokenize.isInAttribute)return L.tagStart==L.indented?L.stringStartCol+1:L.indented+re;if(k&&k.noIndent)return E.Pass;if(L.tokenize!=te&&L.tokenize!=O)return ve?ve.match(/^(\s*)/)[0].length:0;if(L.tagName)return S.multilineTagIndentPastTag!==!1?L.tagStart+L.tagName.length+2:L.tagStart+re*(S.multilineTagIndentFactor||1);if(S.alignCDATA&&/<!\[CDATA\[/.test(ke))return 0;var G=ke&&/^<(\/)?([\w_:\.-]*)/.exec(ke);if(G&&G[1])for(;k;)if(k.tagName==G[2]){k=k.prev;break}else if(S.implicitlyClosed.hasOwnProperty(k.tagName))k=k.prev;else break;else if(G)for(;k;){var le=S.contextGrabbers[k.tagName];if(le&&le.hasOwnProperty(G[2]))k=k.prev;else break}for(;k&&k.prev&&!k.startOfLine;)k=k.prev;return k?k.indent+re:L.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:S.htmlMode?"html":"xml",helperType:S.htmlMode?"html":"xml",skipAttribute:function(L){L.state==Fe&&(L.state=Ce)},xmlCurrentTag:function(L){return L.tagName?{name:L.tagName,close:L.type=="closeTag"}:null},xmlCurrentContext:function(L){for(var ke=[],ve=L.context;ve;ve=ve.prev)ve.tagName&&ke.push(ve.tagName);return ke.reverse()}}}),E.defineMIME("text/xml","xml"),E.defineMIME("application/xml","xml"),E.mimeModes.hasOwnProperty("text/html")||E.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7Cbv":function(vt,Qe,y){"use strict";var E=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ce=new Uint8Array(16);function V(){if(!E)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E(ce)}var H=/^(?:[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 C(te){return typeof te=="string"&&H.test(te)}for(var re=C,S=[],F=0;F<256;++F)S.push((F+256).toString(16).substr(1));function U(te){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,K=(S[te[Q+0]]+S[te[Q+1]]+S[te[Q+2]]+S[te[Q+3]]+"-"+S[te[Q+4]]+S[te[Q+5]]+"-"+S[te[Q+6]]+S[te[Q+7]]+"-"+S[te[Q+8]]+S[te[Q+9]]+"-"+S[te[Q+10]]+S[te[Q+11]]+S[te[Q+12]]+S[te[Q+13]]+S[te[Q+14]]+S[te[Q+15]]).toLowerCase();if(!re(K))throw TypeError("Stringified UUID is invalid");return K}var $=U;function M(te,Q,K){te=te||{};var N=te.random||(te.rng||V)();if(N[6]=N[6]&15|64,N[8]=N[8]&63|128,Q){K=K||0;for(var W=0;W<16;++W)Q[K+W]=N[W];return Q}return $(N)}var O=Qe.a=M},"7ahc":function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return Ke});var E=y("k1fw"),ce=y("0Owb"),V=y("+L6B"),H=y("2/Rp"),C=y("y8nQ"),re=y("Vl3Y"),S=y("tJVT"),F=y("OaEy"),U=y("2fM7"),$=y("q1tI"),M=y.n($),O=y("VrN/"),te=y.n(O),Q=y("p77/"),K=y.n(Q),N=y("c5Ni"),W=y.n(N),ee=U.a.Option,fe={labelCol:{span:4},wrapperCol:{span:20}},Re={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"]};Qe.b=function(_e){var ye=_e.callback,Ae=_e.onCancel,Ce=Object($.useState)("python"),Ee=Object(S.a)(Ce,2),Fe=Ee[0],me=Ee[1];function L(ve){me(Re[ve][1])}function ke(ve){ye(ve)}return M.a.createElement(re.a,Object(ce.a)({},fe,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:ke}),M.a.createElement(re.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},M.a.createElement(U.a,{onChange:L},Object.keys(Re).map(function(ve){return M.a.createElement(ee,{key:ve,value:ve},Re[ve][0])}))),M.a.createElement(re.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},M.a.createElement(Ke,{mode:Fe})),M.a.createElement("div",{className:"flex-container flex-end"},M.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),M.a.createElement(H.a,{type:"ghost",onClick:Ae},"\u53D6\u6D88")))};function Ke(_e){var ye=_e.value,Ae=_e.onChange,Ce=_e.mode,Ee=_e.options,Fe=Ee===void 0?{}:Ee,me=Object($.useRef)(),L=Object($.useState)(),ke=Object(S.a)(L,2),ve=ke[0],k=ke[1];return Object($.useEffect)(function(){if(ve){function G(le){var X=le.getValue();Ae&&Ae(X)}return ve.on("change",G),function(){ve.off("change",G)}}},[ve,Ae]),Object($.useEffect)(function(){ve&&ve.setOption("mode",Ce)},[ve,Ce]),Object($.useEffect)(function(){ve&&((ye!==ve.getValue()||ye==="")&&setTimeout(function(){ve.setValue(ye||" ")},300))},[ve,ye]),Object($.useEffect)(function(){if(me.current&&!ve){var G=te.a.fromTextArea(me.current,Object(E.a)({mode:Ce,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Fe));k(G)}},[me.current,ve]),M.a.createElement("div",{className:"my-codemirror-container"},M.a.createElement("textarea",{ref:me}))}},"7ixt":function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return V});var E={adjustX:1,adjustY:1},ce=[0,0],V={left:{points:["cr","cl"],overflow:E,offset:[-4,0],targetOffset:ce},right:{points:["cl","cr"],overflow:E,offset:[4,0],targetOffset:ce},top:{points:["bc","tc"],overflow:E,offset:[0,-4],targetOffset:ce},bottom:{points:["tc","bc"],overflow:E,offset:[0,4],targetOffset:ce},topLeft:{points:["bl","tl"],overflow:E,offset:[0,-4],targetOffset:ce},leftTop:{points:["tr","tl"],overflow:E,offset:[-4,0],targetOffset:ce},topRight:{points:["br","tr"],overflow:E,offset:[0,-4],targetOffset:ce},rightTop:{points:["tl","tr"],overflow:E,offset:[4,0],targetOffset:ce},bottomRight:{points:["tr","br"],overflow:E,offset:[0,4],targetOffset:ce},rightBottom:{points:["bl","br"],overflow:E,offset:[4,0],targetOffset:ce},bottomLeft:{points:["tl","bl"],overflow:E,offset:[0,4],targetOffset:ce},leftBottom:{points:["br","bl"],overflow:E,offset:[-4,0],targetOffset:ce}},H=V},"8EBN":function(vt,Qe,y){(function(E){E(y("VrN/"))})(function(E){"use strict";E.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 ce=0;ce<E.modeInfo.length;ce++){var V=E.modeInfo[ce];V.mimes&&(V.mime=V.mimes[0])}E.findModeByMIME=function(H){H=H.toLowerCase();for(var C=0;C<E.modeInfo.length;C++){var re=E.modeInfo[C];if(re.mime==H)return re;if(re.mimes){for(var S=0;S<re.mimes.length;S++)if(re.mimes[S]==H)return re}}if(/\+xml$/.test(H))return E.findModeByMIME("application/xml");if(/\+json$/.test(H))return E.findModeByMIME("application/json")},E.findModeByExtension=function(H){H=H.toLowerCase();for(var C=0;C<E.modeInfo.length;C++){var re=E.modeInfo[C];if(re.ext){for(var S=0;S<re.ext.length;S++)if(re.ext[S]==H)return re}}},E.findModeByFileName=function(H){for(var C=0;C<E.modeInfo.length;C++){var re=E.modeInfo[C];if(re.file&&re.file.test(H))return re}var S=H.lastIndexOf("."),F=S>-1&&H.substring(S+1,H.length);if(F)return E.findModeByExtension(F)},E.findModeByName=function(H){H=H.toLowerCase();for(var C=0;C<E.modeInfo.length;C++){var re=E.modeInfo[C];if(re.name.toLowerCase()==H)return re;if(re.alias){for(var S=0;S<re.alias.length;S++)if(re.alias[S].toLowerCase()==H)return re}}}})},"8hTe":function(vt,Qe,y){vt.exports={button:"button___1wy9m"}},"9Bee":function(vt,Qe,y){"use strict";var E=y("DYRE"),ce=y("zeV3"),V=y("+L6B"),H=y("2/Rp"),C=y("k1fw"),re=y("9og8"),S=y("tJVT"),F=y("WmNS"),U=y.n(F),$=y("q1tI"),M=y.n($),O=y("vg9a"),te=y("DlQD"),Q=y.n(te),K=y("rUJ1");function N(d,o){var a=d.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
|
|
`).map(function(p){var c=p.match(/^\s+/);if(c===null)return p;var J=Object(S.a)(c,1),Ge=J[0];return Ge.length>=u.length?p.slice(u.length):p}).join(`
|
|
`)}var W=[],ee=["<ul>"],fe=new Q.a.Renderer,Re=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ke(){W.length=0,ee=["<ul>"]}var _e={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function ye(d,o,a,u){if(o>=d.length||d[o].level<=a)return o;var p=d[o];u.push("<li><a href='#"+p.anchor+"'>"+p.text+"</a>"),o++;var c=[];return o=ye(d,o,p.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(J){u.push(J)}),u.push("</ul>")),u.push("</li>"),o=ye(d,o,a,u),o}function Ae(){return ye(W,0,0,ee),ee.push("</ul>"),ee.join("")}var Ce={heading:function(o){var a=Re.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],p=N(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var J=me(),Ge=p;p=J,L[J]={type:"block",expression:Ge}}return{type:"code",raw:u,lang:c,text:p}}}},Ee=/(?:\${2})([^\n`]+?)(?:\${2})/gi,Fe=0,me=function(){return"__special_katext_id_".concat(Fe++,"__")},L={};function ke(){return L}function ve(){Fe=0,L={}}function k(d){return d=d.replace(Ee,function(o,a){var u=me();return L[u]={type:"inline",expression:a},u}),d}var G=fe.listitem;fe.listitem=function(d){return G(k(d))};var le=fe.paragraph;fe.paragraph=function(d){return le(k(d))};var X=fe.tablecell;fe.tablecell=function(d,o){return X(k(d),o)},fe.code=function(d,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(d,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?d:Object(K.escape)(d,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(a?d:Object(K.escape)(d,!0))+"</code></pre>"},fe.heading=function(d,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return W.push({anchor:u,level:o,text:d}),"<h"+o+' id="'+u+'">'+d+"</h"+o+">"},Q.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),Q.a.use({tokenizer:Ce,renderer:fe});var Le=Q.a,T=y("SJMd"),g=y("ulZh"),de=y.n(g),Ie=y("m3rI"),De=y("Oy/b"),rt=y("p5ED"),ot=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 He=function(d,o){return(He=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(d,o)};function Ue(d,o){function a(){this.constructor=d}He(d,o),d.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Pe(d,o,a,u){return new(a||(a=Promise))(function(p,c){function J(Ot){try{we(u.next(Ot))}catch($e){c($e)}}function Ge(Ot){try{we(u.throw(Ot))}catch($e){c($e)}}function we(Ot){var $e;Ot.done?p(Ot.value):($e=Ot.value,$e instanceof a?$e:new a(function(Wt){Wt($e)})).then(J,Ge)}we((u=u.apply(d,o||[])).next())})}function Be(d,o){var a,u,p,c,J={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return c={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ge(we){return function(Ot){return function($e){if(a)throw new TypeError("Generator is already executing.");for(;J;)try{if(a=1,u&&(p=2&$e[0]?u.return:$e[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,$e[1])).done)return p;switch(u=0,p&&($e=[2&$e[0],p.value]),$e[0]){case 0:case 1:p=$e;break;case 4:return J.label++,{value:$e[1],done:!1};case 5:J.label++,u=$e[1],$e=[0];continue;case 7:$e=J.ops.pop(),J.trys.pop();continue;default:if(!(p=J.trys,(p=p.length>0&&p[p.length-1])||$e[0]!==6&&$e[0]!==2)){J=0;continue}if($e[0]===3&&(!p||$e[1]>p[0]&&$e[1]<p[3])){J.label=$e[1];break}if($e[0]===6&&J.label<p[1]){J.label=p[1],p=$e;break}if(p&&J.label<p[2]){J.label=p[2],J.ops.push($e);break}p[2]&&J.ops.pop(),J.trys.pop();continue}$e=o.call(d,J)}catch(Wt){$e=[6,Wt],u=0}finally{a=p=0}if(5&$e[0])throw $e[1];return{value:$e[0]?$e[1]:void 0,done:!0}}([we,Ot])}}}function ue(){for(var d=0,o=0,a=arguments.length;o<a;o++)d+=arguments[o].length;var u=Array(d),p=0;for(o=0;o<a;o++)for(var c=arguments[o],J=0,Ge=c.length;J<Ge;J++,p++)u[p]=c[J];return u}var D=function(){function d(){}return d.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},d.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var c=p[u],J=c[0],Ge=c[1];o.setAttribute(J,Ge)}},d.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&d.setAttributes(p,u),p},d.createLine=function(o,a,u,p,c){var J=document.createElementNS("http://www.w3.org/2000/svg","line");return J.setAttribute("x1",o.toString()),J.setAttribute("y1",a.toString()),J.setAttribute("x2",u.toString()),J.setAttribute("y2",p.toString()),c&&d.setAttributes(J,c),J},d.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&d.setAttributes(u,a),u},d.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&&d.setAttributes(u,a),u},d.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&d.setAttributes(p,u),p},d.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&d.setAttributes(a,o),a},d.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},d.createMarker=function(o,a,u,p,c,J,Ge){var we=document.createElementNS("http://www.w3.org/2000/svg","marker");return d.setAttributes(we,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",c.toString()],["refY",J.toString()]]),we.appendChild(Ge),we},d.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&d.setAttributes(a,o),a},d.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&d.setAttributes(u,a),u},d.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&d.setAttributes(a,o),a},d.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},d.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&d.setAttributes(u,a),u},d}(),Ze=function(){function d(){}return d.addKey=function(o){d.key=o},Object.defineProperty(d,"isLicensed",{get:function(){return!!d.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(d.key)},enumerable:!1,configurable:!0}),d}(),mt=function(){function d(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return d.prototype.rasterize=function(o,a,u){var p=this;return new Promise(function(c){var J=u!==void 0?u:document.createElement("canvas");o===null&&(p.markersOnly=!0,p.naturalSize=!1);var Ge=document.createElementNS("http://www.w3.org/2000/svg","svg");Ge.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ge.setAttribute("width",a.width.baseVal.valueAsString),Ge.setAttribute("height",a.height.baseVal.valueAsString),Ge.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Ge.innerHTML=a.innerHTML,p.naturalSize===!0?(Ge.width.baseVal.value=o.naturalWidth,Ge.height.baseVal.value=o.naturalHeight):p.width!==void 0&&p.height!==void 0&&(Ge.width.baseVal.value=p.width,Ge.height.baseVal.value=p.height),J.width=Ge.width.baseVal.value,J.height=Ge.height.baseVal.value;var we=Ge.outerHTML,Ot=J.getContext("2d");p.markersOnly!==!0&&Ot.drawImage(o,0,0,J.width,J.height);var $e=window.URL,Wt=new Image(J.width,J.height);Wt.setAttribute("crossOrigin","anonymous");var dn=new Blob([we],{type:"image/svg+xml"}),Sn=$e.createObjectURL(dn);Wt.onload=function(){Ot.drawImage(Wt,0,0),$e.revokeObjectURL(Sn);var Ri=J.toDataURL(p.imageType,p.imageQuality);c(Ri)},Wt.src=Sn})},d}(),Ct=function(){},ut=function(){function d(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(d.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),d.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},d.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)},d.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 st("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new st("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new he("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new he("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},d.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},d}(),st=function(d,o){this.selector=d,this.style=o},he=function(d,o){this.localName=d,this.style=o},Me=function(){function d(o,a,u,p,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=p,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return d.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(c){var J=document.createElement("div");J.className=""+a.toolbarButtonStyleClass.name,J.setAttribute("data-type-name",c.typeName),J.innerHTML=c.icon,J.addEventListener("click",function(){a.markerToolbarButtonClicked(J,c)}),a.buttons.push(J),a.markerButtons.push(J)}),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 p=document.createElement("div");p.className=this.toolbarBlockStyleClass.name,p.style.whiteSpace="nowrap",p.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(p),this.addActionButton(p,'<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(p,'<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()},d.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},d.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},d.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},d.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]))}},d.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")},d.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)})},d.prototype.addActionButton=function(o,a,u){var p=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=a,c.setAttribute("data-action",u),c.addEventListener("click",function(){p.actionToolbarButtonClicked(c,u)}),u){case"select":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":c.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":c.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":c.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(c),this.buttons.push(c)},d.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new he("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 he("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new he("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new he("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 he("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new he("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 he("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new he("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new st("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},d.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"},d.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])},d.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)},d.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},d.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")})},d}(),Oe=function(){function d(o,a,u,p){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=p,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return d.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new he("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 he("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new he("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new he("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new he("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 he("toolbox-panel-row_colors",`
|
|
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new he("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 he("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new he("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new st("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new st("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},d.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)},d.prototype.setPanelButtons=function(o){var a,u,p=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(c){var J;c.uiStyleSettings=p.uiStyleSettings;var Ge=document.createElement("div");Ge.className=p.toolboxButtonStyleClass.name+" "+((J=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&J!==void 0?J:p.toolboxButtonStyleColorsClass.name),Ge.innerHTML=c.icon,Ge.title=c.title,Ge.addEventListener("click",function(){p.panelButtonClick(c)}),p.panelButtons.push(Ge),p.buttonRow.appendChild(Ge)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},d.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var p=o.getUi();p.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(p),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(c,J){var Ge,we;c.className=a.toolboxButtonStyleClass.name+" "+(J===u?""+((Ge=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ge!==void 0?Ge:a.toolboxActiveButtonStyleColorsClass.name):""+((we=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&we!==void 0?we:a.toolboxButtonStyleColorsClass.name))})},d}(),Se=function(d,o){this.title=d,this.icon=o},tt=function(d){function o(a,u,p,c){var J=d.call(this,a,c||'<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 J.colors=[],J.addTransparent=!1,J.colorBoxes=[],J.colors=u,J.currentColor=p,J.setCurrentColor=J.setCurrentColor.bind(J),J.getColorBox=J.getColorBox.bind(J),J}return Ue(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(p){var c=a.getColorBox(p);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,p=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-p,J=document.createElement("div");J.style.display="inline-block",J.style.boxSizing="content-box",J.style.width=c-2+"px",J.style.height=c-2+"px",J.style.padding="1px",J.style.marginRight="2px",J.style.marginBottom="2px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderRadius=(c+2)/2+"px",J.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){u.setCurrentColor(a,J)});var Ge=document.createElement("div");return Ge.style.display="inline-block",Ge.style.width=c-2+"px",Ge.style.height=c-2+"px",Ge.style.backgroundColor=a,Ge.style.borderRadius=c/2+"px",a==="transparent"&&(Ge.style.fill=this.uiStyleSettings.toolboxAccentColor,Ge.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>`),J.appendChild(Ge),J},o.prototype.setCurrentColor=function(a,u){var p=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Se),Ye=function(){function d(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(d.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),d.prototype.ownsTarget=function(o){return!1},Object.defineProperty(d.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),d.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},d.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},d.prototype.pointerDown=function(o,a){},d.prototype.dblClick=function(o,a){},d.prototype.manipulate=function(o){},d.prototype.pointerUp=function(o){this.stateChanged()},d.prototype.dispose=function(){},d.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},d.prototype.getState=function(){return{typeName:d.typeName,state:this.state,notes:this.notes}},d.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},d.prototype.scale=function(o,a){},d.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},d.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},d.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)}},d.typeName="MarkerBase",d}(),lt=function(){function d(){this.findGripByVisual=this.findGripByVisual.bind(this)}return d.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},d}(),Nt=function(){function d(){this.GRIP_SIZE=10,this.visual=D.createGroup(),this.visual.appendChild(D.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(D.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},d}(),_t=function(){function d(){}return d.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},d.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},d}(),xt=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(D.createTransform()),c.setupControlBox(),c}return Ue(o,d),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=D.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!d.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){d.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 p=this.unrotatePoint(a);if(this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.offsetX=p.x-this.left,this.offsetY=p.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 c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var J=this.container.transform.baseVal.getItem(0);J.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(J,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;d.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,p=this.manipulationStartWidth,c=this.manipulationStartTop,J=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,p=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:p=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+a.y-this.manipulationStartY,J=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:J=this.manipulationStartHeight+a.y-this.manipulationStartY}p>=0?(this.left=u,this.width=p):(this.left=u+p,this.width=-p),J>=0?(this.top=c,this.height=J):(this.top=c+J,this.height=-J),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(),p=D.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var p=D.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.select=function(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=D.createGroup();var a=D.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=D.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=D.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 lt,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 Nt;return a.visual.transform.baseVal.appendItem(D.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,p=u,c=(this.width+this.CB_DISTANCE)/2-a/2,J=(this.height+this.CB_DISTANCE)/2-a/2,Ge=this.height+this.CB_DISTANCE-a/2,we=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,p),this.positionGrip(this.controlGrips.topCenter.visual,c,p),this.positionGrip(this.controlGrips.topRight.visual,we,p),this.positionGrip(this.controlGrips.centerLeft.visual,u,J),this.positionGrip(this.controlGrips.centerRight.visual,we,J),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ge),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ge),this.positionGrip(this.controlGrips.bottomRight.visual,we,Ge),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,p-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,p){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,p),a.transform.baseVal.replaceItem(c,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:_t.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:_t.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},d.prototype.getState.call(this))},o.prototype.restoreState=function(a){d.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(_t.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(_t.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u);var p=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:p.x*a,y:p.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Ye),dt=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return Ue(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=D.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){d.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){d.prototype.setSize.call(this),D.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){d.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&D.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&D.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&D.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&D.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},d.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(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(xt),Lt=function(d){function o(a,u,p,c){var J=d.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return J.widths=[],J.widthBoxes=[],J.widths=u,J.currentWidth=p,J.setCurrentWidth=J.setCurrentWidth.bind(J),J}return Ue(o,d),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(p){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=p===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(p,c)}),u.appendChild(c);var J=document.createElement("div");J.innerText=p.toString(),J.style.marginRight="5px",c.appendChild(J);var Ge=document.createElement("div");Ge.style.minHeight="20px",Ge.style.flexGrow="2",Ge.style.display="flex",Ge.style.alignItems="center";var we=document.createElement("hr");we.style.minWidth="20px",we.style.border="0px",we.style.borderTop=p+"px solid "+a.uiStyleSettings.toolboxColor,we.style.flexGrow="2",Ge.appendChild(we),c.appendChild(Ge),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var p=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Se),wt=function(d){function o(a,u,p,c){var J=d.call(this,a,c||'<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 J.styles=[],J.styleBoxes=[],J.styles=u,J.currentStyle=p,J.setCurrentStyle=J.setCurrentStyle.bind(J),J}return Ue(o,d),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(p){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.styles.length-5+"%",c.style.borderColor=p===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(p,c)}),u.appendChild(c);var J=document.createElement("div");J.style.minHeight="20px",J.style.flexGrow="2",J.style.overflow="hidden";var Ge=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+a.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(p!==""?'stroke-dasharray="'+p+'"':"")+` />
|
|
</svg>`;J.innerHTML=Ge,c.appendChild(J),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var p=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Se),gt=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new tt("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Lt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new wt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ue(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.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}(dt),Ne=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Dt=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return Ue(o,d),o.prototype.ownsTarget=function(a){return!!d.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){d.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;d.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(){d.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){d.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=D.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 Nt;return a.visual.transform.baseVal.appendItem(D.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,p){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,p),a.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},d.prototype.getState.call(this))},o.prototype.restoreState=function(a){d.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){d.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}(Ye),yt=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new tt("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Lt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new wt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ue(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=D.createGroup(),this.selectorLine=D.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=D.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){d.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()),D.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),D.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),D.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},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.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}(Dt),We=function(d){function o(a,u,p,c){var J=d.call(this,a,c||'<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 J.fonts=[],J.fontBoxes=[],J.fonts=u,J.currentFont=p,J.setCurrentFont=J.setCurrentFont.bind(J),J}return Ue(o,d),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(p){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.fonts.length-5+"%",c.style.borderColor=p===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(p,c)}),u.appendChild(c);var J=document.createElement("div");J.style.display="flex",J.style.minHeight="20px",J.style.flexGrow="2",J.style.fontFamily=p,J.style.overflow="hidden";var Ge=document.createElement("div");Ge.style.whiteSpace="nowrap",Ge.style.overflow="hidden",Ge.style.textOverflow="ellipsis",Ge.innerHTML="The quick brown fox jumps over the lazy dog",J.appendChild(Ge),c.appendChild(J),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var p=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Se),et=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=p.defaultColor,c.fontFamily=p.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new tt("Color",p.defaultColorSet,p.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new We("Font",p.defaultFontFamilies,p.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return Ue(o,d),o.prototype.ownsTarget=function(a){if(d.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(p){p===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=D.createGroup(),this.bgRectangle=D.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=D.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(D.createTransform()),this.textElement.transform.baseVal.appendItem(D.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){d.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(D.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 p=(1*this.width-this.width*this.padding*2/100)/a.width,c=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(p,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),p=0,c=0;return u.width>0&&u.height>0&&(p=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:p,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),p=this.getTextPosition(u);p.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+p.x+"px, "+p.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(p.x,p.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){d.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){d.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){d.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(D.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),D.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),d.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 p=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(p)),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}),p=this.textElement.getBBox(),c={x:p.width*a,y:p.height*a};u.x-=c.x/2,u.y-=c.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(){d.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),d.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){d.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&D.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&&D.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},d.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(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.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}(xt),ae=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=p.defaultColor,c.lineWidth=p.defaultStrokeWidth,c.pixelRatio=p.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new tt("Color",p.defaultColorSet,p.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Lt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return Ue(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=D.createGroup(),this.drawingImage=D.createImage(),this.visual.appendChild(this.drawingImage);var a=D.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):d.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()):d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),D.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),D.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()):d.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(),d.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),d.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],p=u[0],c=u[1],J=u[2],Ge=u[3],we=!1,Ot=0;Ot<this.canvasElement.height;Ot++)for(var $e=0;$e<this.canvasElement.width;$e++)a.data[Ot*this.canvasElement.width*4+4*$e+3]>0&&(we=!0,Ot<c&&(c=Ot),$e<p&&(p=$e),Ot>Ge&&(Ge=Ot),$e>J&&(J=$e));if(we){this.left=p/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(J-p)/this.pixelRatio,this.height=(Ge-c)/this.pixelRatio;var Wt=document.createElement("canvas");Wt.width=J-p,Wt.height=Ge-c,Wt.getContext("2d").putImageData(this.canvasContext.getImageData(p,c,J-p,Ge-c),0,0),this.drawingImgUrl=Wt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){D.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),D.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},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),d.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){d.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}(xt),Z=function(d){function o(a,u,p){var c=d.call(this,a,p||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return Ue(o,d),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 p=function(Ge){var we="both";switch(Ge){case 0:we="both";break;case 1:we="start";break;case 2:we="end";break;case 3:we="none"}var Ot=document.createElement("div");if(Ot.style.display="flex",Ot.style.flexGrow="2",Ot.style.alignItems="center",Ot.style.justifyContent="space-between",Ot.style.padding="5px",Ot.style.borderWidth="2px",Ot.style.borderStyle="solid",Ot.style.borderColor=we===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",Ot.addEventListener("click",function(){a.setCurrentType(we,Ot)}),u.appendChild(Ot),we==="both"||we==="start"){var $e=document.createElement("div");$e.style.display="flex",$e.style.alignItems="center",$e.style.minHeight="20px",$e.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="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,$e.style.marginLeft="5px",Ot.appendChild($e)}var Wt=document.createElement("div");Wt.style.display="flex",Wt.style.alignItems="center",Wt.style.minHeight="20px",Wt.style.flexGrow="2";var dn=document.createElement("hr");if(dn.style.minWidth="20px",dn.style.border="0px",dn.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),dn.style.flexGrow="2",Wt.appendChild(dn),Ot.appendChild(Wt),we==="both"||we==="end"){var Sn=document.createElement("div");Sn.style.display="flex",Sn.style.alignItems="center",Sn.style.minHeight="20px",Sn.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="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Sn.style.marginRight="5px",Ot.appendChild(Sn)}c.typeBoxes.push(Ot)},c=this,J=0;J<4;J++)p(J);return u},o.prototype.setCurrentType=function(a,u){var p=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings!==void 0?p.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Se),ne=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new Z("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return Ue(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var p=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-p/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+p/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=D.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(D.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=D.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(D.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(d.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",D.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),D.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 p=this.arrow2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(p,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},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.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}(yt),x=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.fillColor=p.defaultFillColor,c.strokeWidth=0,c.fillPanel=new tt("Color",p.defaultColorSet,p.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return Ue(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.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}(dt),w=function(d){function o(a,u,p,c){var J=d.call(this,a,c||'<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 J.opacities=[],J.opacityBoxes=[],J.opacities=u,J.currentOpacity=p,J.setCurrentOpacity=J.setCurrentOpacity.bind(J),J}return Ue(o,d),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(p){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=p===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(p,c)}),u.appendChild(c);var J=document.createElement("div");J.innerText=100*p+"%",c.appendChild(J),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var p=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Se),A=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=p.defaultHighlightColor,c.strokeWidth=0,c.opacity=p.defaultHighlightOpacity,c.fillPanel=new tt("Color",p.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new w("Opacity",p.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Ue(o,d),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&D.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=d.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),P='<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>',be=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=p.defaultStrokeColor,c.bgColor=p.defaultFillColor,c.fontFamily=p.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new tt("Text color",p.defaultColorSet,c.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>'),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new tt("Fill color",p.defaultColorSet,c.bgColor,P),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new We("Font",p.defaultFontFamilies,p.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new Nt,c.tipGrip.visual.transform.baseVal.appendItem(D.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return Ue(o,d),o.prototype.ownsTarget=function(a){return d.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){D.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=D.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&d.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):d.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,d.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";d.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 d.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(D.setAttributes(this.bgRectangle,[["fill",a]]),D.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),p=this.height/5;a&&(this.tipPosition={x:u+p/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+p,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?c<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-p},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+p,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-p})},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){D.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(),d.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},d.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,d.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){d.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}(et),Te=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.fillColor=p.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new tt("Line color",ue(p.defaultColorSet,["transparent"]),p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new tt("Fill color",ue(p.defaultColorSet,["transparent"]),c.fillColor,P),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Lt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new wt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new w("Opacity",p.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Ue(o,d),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=D.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){d.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){d.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){d.prototype.setSize.call(this),D.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){d.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&D.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&D.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&D.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&D.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&D.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},d.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(),d.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){d.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}(xt),Xe=function(d){function o(a,u,p){return d.call(this,a,u,p)||this}return Ue(o,d),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!d.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=D.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(D.createTransform()),this.visual.appendChild(this.tip1),this.tip2=D.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(D.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){d.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(d.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(D.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()]]),D.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 p=this.tip2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(p,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=d.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.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}(yt),Et=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.strokePanel.colors=p.defaultColorSet,c.fillColor="transparent",c}return Ue(o,d),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=d.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}(Te),Gt=function(){function d(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),d.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))},d.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},d.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},d.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}},d.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},d}(),Ve=function(d){function o(a,u,p){var c=d.call(this,a,u,p)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new tt("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Lt("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new wt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Ue(o,d),o.prototype.ownsTarget=function(a){return!(!d.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=D.createGroup(),this.selectorCurve=D.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=D.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){d.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()),D.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),D.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),D.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){d.prototype.setupControlBox.call(this),this.curveControlLine1=D.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=D.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,d.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){d.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),d.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),d.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,d.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},d.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){d.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}(Dt),Pt=function(){function d(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(d.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),d.prototype.preventDefault=function(){this._defaultPrevented=!0},d}(),St=function(d){function o(a,u,p){var c=d.call(this,a,!1)||this;return c.dataUrl=u,c.state=p,c}return Ue(o,d),o}(Pt),ht=function(d){function o(a,u,p){p===void 0&&(p=!1);var c=d.call(this,a,p)||this;return c.marker=u,c}return Ue(o,d),o}(Pt),on=function(){function d(){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 d.prototype.addEventListener=function(o,a){this[o].push(a)},d.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},d}(),Zt=function(){function d(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 Ne,this._isOpen=!1,this.undoRedoManager=new Gt,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 on,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=d.instanceCounter++,this.styles=new ut(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(d.prototype,"ALL_MARKER_TYPES",{get:function(){return[gt,ae,ne,et,Et,Te,A,be,Xe,x,yt,Ve]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[gt,ae,ne,et,Te,A,be]},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"BASIC_MARKER_TYPES",{get:function(){return[gt,ae,ne,et,A]},enumerable:!1,configurable:!0}),Object.defineProperty(d.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 p=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});p!==void 0&&a._availableMarkerTypes.push(p)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),d.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ze.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},d.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&Ct.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ct.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new Pt(o))})},d.prototype.render=function(){return Pe(this,void 0,void 0,function(){var o;return Be(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new mt).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()]}})})},d.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(p){var c=new Pt(a,!0);p(c),c.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(p){return p(new Pt(a))}),this.detachEvents(),this._isOpen=!1)}},d.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},d.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},d.prototype.removeRenderEventListener=function(o){},d.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},d.prototype.removeCloseEventListener=function(o){},d.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))},d.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)},d.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},d.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,p=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,p),this._isResizing=!1},d.prototype.scaleMarkers=function(o,a){var u,p=this;this._currentMarker&&this._currentMarker instanceof et?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==p._currentMarker&&c.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},d.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"},d.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},d.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)},d.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=D.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},d.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},d.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)},d.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},d.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},d.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)},d.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},d.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)},d.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()},d.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")},d.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"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.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 Me(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 Oe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},d.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},d.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())},d.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()}},d.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(p){var c=new ht(o,o._currentMarker,!0);p(c),c.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(p){return p(new ht(o,u))})}}},d.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(J){var Ge=new ht(o,void 0,!0);J(Ge),Ge.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(J){var Ge=p.markers[J];p.setCurrentMarker(p.markers[J]),p._currentMarker.dispose(),p.markerImage.removeChild(p._currentMarker.container),p.markers.splice(p.markers.indexOf(p._currentMarker),1),p.eventListeners.markerdelete.forEach(function(we){return we(new ht(o,Ge))})},p=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(d.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),d.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))},d.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)},d.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},d.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 p=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),p<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new Pt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new Pt(o))})}},d.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},d.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 Pt(o))}))},d.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},d.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 Pt(o))}))},d.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},d.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},d.prototype.startRenderAndClose=function(){return Pe(this,void 0,void 0,function(){var o,a,u=this;return Be(this,function(p){switch(p.label){case 0:return[4,this.render()];case 1:return o=p.sent(),a=this.getState(),this.eventListeners.render.forEach(function(c){return c(new St(u,o,a))}),this.close(!0),[2]}})})},d.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},d.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 p=a._availableMarkerTypes.find(function(J){return J.typeName===u.typeName});if(p!==void 0){var c=a.addNewMarker(p);c.restoreState(u),a.markers.push(c)}}),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 Pt(a))})},d.prototype.addNewMarker=function(o){var a=D.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},d.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(p){return p.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(p){return p(new ht(u,u._currentMarker))}))},d.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof ae&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ae):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new ht(a,a._currentMarker))})},d.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},d.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},d.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new ht(a,o))})},d.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 ht(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 ht(a,a._currentMarker))}))},d.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))},d.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()}},d.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}))},d.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()},d.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},d.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},d.prototype.onWindowResize=function(){this.positionUI()},d.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()},d.prototype.addLicenseKey=function(o){Ze.addKey(o)},d.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},d.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},d.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(d.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),d.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 Pt(o))}))},d.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 Pt(o))}))},d.instanceCounter=0,d}();/* **********************************
|
|
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 En=function(d,o){return(En=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(d,o)};function vn(d,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=d}En(d,o),d.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Ft(d,o,a,u){return new(a||(a=Promise))(function(p,c){function J(Ot){try{we(u.next(Ot))}catch($e){c($e)}}function Ge(Ot){try{we(u.throw(Ot))}catch($e){c($e)}}function we(Ot){var $e;Ot.done?p(Ot.value):($e=Ot.value,$e instanceof a?$e:new a(function(Wt){Wt($e)})).then(J,Ge)}we((u=u.apply(d,o||[])).next())})}function zn(d,o){var a,u,p,c,J={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return c={next:Ge(0),throw:Ge(1),return:Ge(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ge(we){return function(Ot){return function($e){if(a)throw new TypeError("Generator is already executing.");for(;J;)try{if(a=1,u&&(p=2&$e[0]?u.return:$e[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,$e[1])).done)return p;switch(u=0,p&&($e=[2&$e[0],p.value]),$e[0]){case 0:case 1:p=$e;break;case 4:return J.label++,{value:$e[1],done:!1};case 5:J.label++,u=$e[1],$e=[0];continue;case 7:$e=J.ops.pop(),J.trys.pop();continue;default:if(!(p=J.trys,(p=p.length>0&&p[p.length-1])||$e[0]!==6&&$e[0]!==2)){J=0;continue}if($e[0]===3&&(!p||$e[1]>p[0]&&$e[1]<p[3])){J.label=$e[1];break}if($e[0]===6&&J.label<p[1]){J.label=p[1],p=$e;break}if(p&&J.label<p[2]){J.label=p[2],J.ops.push($e);break}p[2]&&J.ops.pop(),J.trys.pop();continue}$e=o.call(d,J)}catch(Wt){$e=[6,Wt],u=0}finally{a=p=0}if(5&$e[0])throw $e[1];return{value:$e[0]?$e[1]:void 0,done:!0}}([we,Ot])}}}var Bn=function(){function d(){}return d.addKey=function(o){d.key=o},Object.defineProperty(d,"isLicensed",{get:function(){return!!d.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(d.key)},enumerable:!1,configurable:!0}),d}(),At=function(){function d(){}return d.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},d.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var c=p[u],J=c[0],Ge=c[1];o.setAttribute(J,Ge)}},d.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&d.setAttributes(p,u),p},d.createLine=function(o,a,u,p,c){var J=document.createElementNS("http://www.w3.org/2000/svg","line");return J.setAttribute("x1",o.toString()),J.setAttribute("y1",a.toString()),J.setAttribute("x2",u.toString()),J.setAttribute("y2",p.toString()),c&&d.setAttributes(J,c),J},d.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&d.setAttributes(u,a),u},d.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&&d.setAttributes(u,a),u},d.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&d.setAttributes(p,u),p},d.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&d.setAttributes(a,o),a},d.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},d.createMarker=function(o,a,u,p,c,J,Ge){var we=document.createElementNS("http://www.w3.org/2000/svg","marker");return d.setAttributes(we,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",c.toString()],["refY",J.toString()]]),we.appendChild(Ge),we},d.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&d.setAttributes(a,o),a},d.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&d.setAttributes(u,a),u},d.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&d.setAttributes(a,o),a},d.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},d.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&d.setAttributes(u,a),u},d.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&d.setAttributes(u,a),u},d.getHollowRectanglePath=function(o,a,u,p,c,J,Ge,we){return"M"+o+","+a+"V"+(a+p)+"H"+(o+u)+"V"+a+"H"+c+"V"+J+"H"+(c+Ge)+"V"+(J+we)+"H"+c+"V"+a+"Z"},d}(),hi=function(){function d(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(d.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),d.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},d.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)},d.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 oi("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new oi("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new oi("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ai("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ai("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},d.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},d}(),oi=function(d,o){this.selector=d,this.style=o},ai=function(d,o){this.localName=d,this.style=o},Si=function(){function d(){this.blocks=[],this.display=""}return d.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},d.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},d.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},d}(),or=function(){function d(){}return d.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},d}(),Bi=function(d){function o(){var a=d!==null&&d.apply(this,arguments)||this;return a.buttons=[],a}return vn(o,d),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=d.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(or),pn=function(){function d(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(d.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),d.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},d.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,"")))},d.prototype.hide=function(){this._isHidden=!0},d}(),Mt=function(d){function o(){var a=d!==null&&d.apply(this,arguments)||this;return a.elements=[],a}return vn(o,d),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=d.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(or),Fi=function(){function d(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(d.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),d.prototype.getVerticalLength=function(o){return o/this.ratio},d.prototype.getHorizontalLength=function(o){return o*this.ratio},d}(),hr=function(){function d(){}return d.getIcon=function(o,a){if(o>0&&a>0){var u=new Fi(o,a),p=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),J=document.createElementNS("http://www.w3.org/2000/svg","svg");J.setAttribute("xmlns","http://www.w3.org/2000/svg"),J.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(J);var Ge=At.createDefs();J.appendChild(Ge);var we=At.createElement("clipPath",[["id","text-bg-clip"]]);Ge.appendChild(we);var Ot=At.createPath(At.getHollowRectanglePath((24-p)/2,(24-c)/2,p,c,(24-p)/2+2,(24-c)/2+2,p-4,c-4));J.appendChild(Ot);var $e=At.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);$e.appendChild(At.createTSpan(o+":"+a)),J.appendChild($e);var Wt=$e.getBBox();At.setAttributes($e,[["x",((24-Wt.width)/2).toString()],["y",((24-Wt.height)/2-Wt.y).toString()]]);var dn=At.createPath(At.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Wt.width))/2,(24-Math.ceil(Wt.height))/2,Math.ceil(Wt.width),Math.ceil(Wt.height)));return we.appendChild(dn),At.setAttributes(Ot,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(J),J.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>'},d}(),ki=function(d){function o(a,u,p){var c=d.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=p,c}return vn(o,d),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}(pn),ln=function(){function d(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=At.createGroup(),this.visual.appendChild(At.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(At.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return d.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},d.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return At.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},d}(),Yi=function(){function d(o,a,u,p){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=p,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(d.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(d.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&At.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),d.prototype.open=function(){var o=this;this.cropShadeElement=At.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=At.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(At.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(At.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=At.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ln(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ln(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ln(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ln(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},d.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),At.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(c,J){var Ge=a.y+u*(J+1);At.setAttributes(c,[["x1",""+a.x],["y1",""+Ge],["x2",""+(a.x+a.width)],["y2",""+Ge]])});var p=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,J){var Ge=a.x+p*(J+1);At.setAttributes(c,[["x1",""+Ge],["y1",""+a.y],["x2",""+Ge],["y2",""+(a.y+a.height)]])}),At.setAttributes(this.cropShadeElement,[["d",At.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},d.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)},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},d.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)},d.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()},d.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},d.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},d.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,p=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+=p,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+=p}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))},d.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),p=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<p/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=p,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)}},d.prototype.getRescaledRect=function(o,a,u,p,c,J){var Ge=u/o,we=p/a;return{x:(c.x-J)*Ge+J,y:(c.y-J)*we+J,width:c.width*Ge,height:c.height*we}},d.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)},d}(),fr=function(){function d(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(d.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),d.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},d.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},d.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},d.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},d.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();At.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},d.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)}},d.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 p=u%5==0?this.height/3:this.height/6;a+="h4v"+-p+"h1v"+p}a+="v1H0Z",this.scaleShape=At.createPath(a);var c=At.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=At.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=At.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var J=At.createTSpan("");return J.innerHTML="°",this.angleLabelElement.appendChild(J),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},d}(),pr=function(){function d(){this.naturalSize=!1,this.imageType="image/png"}return d.prototype.rasterize=function(o,a,u,p,c,J,Ge){var we=this;return new Promise(function(Ot){var $e=document.createElement("canvas");$e.width=o.width.baseVal.value-2*p,$e.height=o.height.baseVal.value-2*p;var Wt=1,dn=1;we.naturalSize===!0?(Wt=a.naturalWidth/(o.width.baseVal.value-2*p)/J,dn=a.naturalHeight/(o.height.baseVal.value-2*p)/Ge,$e.width=a.naturalWidth/J,$e.height=a.naturalHeight/Ge):we.width!==void 0&&we.height!==void 0&&(Wt=we.width/u.width,dn=we.height/u.height,$e.width*=Wt,$e.height*=dn);var Sn=$e.getContext("2d");Sn.translate($e.width/2,$e.height/2),Sn.rotate(c*Math.PI/180),Sn.scale(J,Ge),Sn.translate(-$e.width/2,-$e.height/2),Sn.drawImage(a,0,0,$e.width,$e.height);var Ri=document.createElement("canvas");Ri.width=u.width*Wt,Ri.height=u.height*dn,Ri.getContext("2d").putImageData(Sn.getImageData((u.x-p)*Wt,(u.y-p)*dn,u.width*Wt,u.height*dn),0,0),Ot(Ri.toDataURL(we.imageType,we.imageQuality))})},d}(),qe=function(){function d(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=d.instanceCounter++,this.styles=new hi(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(d.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(d.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(d.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(d.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(d.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(d.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}),d.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},d.prototype.show=function(){this.showUI(),this.open()},d.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)},d.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},d.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},d.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},d.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},d.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))},d.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)}},d.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},d.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",At.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},d.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()},d.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();At.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},d.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},d.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=At.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=At.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=At.createGroup(),this.editingTargetRotationScaleContainer=At.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=At.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=At.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=At.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)},d.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},d.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=At.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Yi(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()},d.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)}},d.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)},d.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},d.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},d.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"},d.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},d.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},d.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},d.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Si,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 Bi;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(dn){var Sn=new pn(hr.getIcon(dn.horizontal,dn.vertical),dn.horizontal===0&&dn.vertical===0?"FREE":dn.horizontal+":"+dn.vertical);Sn.onClick=function(){return o.ratioButtonClicked(dn)},u.push(Sn)}),this.aspectRatioButton=new ki(hr.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 p=new pn('<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");p.isActive=this.isGridVisible,p.onClick=function(){o.isGridVisible=!o.isGridVisible,p.isActive=o.isGridVisible},a.addButton(p);var c=new pn('<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(c.isActive=this.zoomToCropEnabled,c.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,c.isActive=o.zoomToCropEnabled},a.addButton(c),!Bn.isLicensed){var J=new Mt;this.topToolbar.addElementBlock(J);var Ge=document.createElement("div");Ge.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var we=document.createElement("a");we.style.color="currentColor",we.href="https://markerjs.com/products/cropro",we.target="_blank",we.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>',Ge.appendChild(we),J.addElement(Ge)}var Ot=new Bi;Ot.minWidth=3*this.toolbarHeight+"px",Ot.contentAlign="end",this.topToolbar.addButtonBlock(Ot);var $e=new pn('<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");$e.onClick=this.startRenderAndClose,Ot.addButton($e),this.styles.settings.toolbarOkButtonStyleColorsClassName&&($e.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Wt=new pn('<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");Wt.onClick=this.close,Ot.addButton(Wt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Wt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},d.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Si,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 Bi;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new pn('<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 p=new pn('<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");p.onClick=this.rotateRightButtonClicked,a.addButton(p);var c=new Mt;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new fr("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(Ot){o.rotateBy(Ot),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var J=new Bi;J.minWidth=2*this.toolbarHeight+"px",J.contentAlign="end",this.bottomToolbar.addButtonBlock(J);var Ge=new pn('<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");Ge.onClick=this.flipHorizontallyButtonClicked,J.addButton(Ge);var we=new pn('<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");we.onClick=this.flipVerticallyButtonClicked,J.addButton(we)},d.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},d.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=hr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},d.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Fi(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},d.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},d.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},d.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()}},d.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},d.prototype.onWindowResize=function(){this.positionUI()},d.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()},d.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)},d.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)},d.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},d.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},d.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},d.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},d.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},d.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},d.prototype.startRenderAndClose=function(){return Ft(this,void 0,void 0,function(){var o,a;return zn(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(p){return p(o,a)}),this.close(!0),[2]}})})},d.prototype.render=function(){return Ft(this,void 0,void 0,function(){var o;return zn(this,function(a){switch(a.label){case 0:return(o=new pr).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),At.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()]}})})},d.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ai("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 ai("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ai("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ai("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 ai("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ai("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new oi("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new oi("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ai("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 ai("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ai("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 ai("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 ai("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},d.instanceCounter=0,d}(),Ht=y("8hTe"),Ji=y.n(Ht),ar=/<pre[^>]*>/g;function mr(d){var o=document.createElement("div");return o.innerHTML=d,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var gr=Qe.a=function(d){var o=d.value,a=o===void 0?"":o,u=d.edit,p=u===void 0?!1:u,c=d.className,J=d.showTextOnly,Ge=d.showLines,we=d.replaces,Ot=d.zoomImg,$e=d.hasMask,Wt=d.style,dn=Wt===void 0?{}:Wt,Sn=d.stylesPrev,Ri=Sn===void 0?{}:Sn,Hi=String(a),ei=Object($.useRef)(),Zi=Object($.useRef)(),Gr=Object($.useState)(""),xi=Object(S.a)(Gr,2),_i=xi[0],sr=xi[1],vr=Object($.useState)("office"),Wi=Object(S.a)(vr,2),lr=Wi[0],zi=Wi[1],so=function(){var bn=new qe(Zi.current);bn.displayMode="popup",bn.addRenderEventListener(function(){var $n=Object(re.a)(U.a.mark(function yn(si){var Rn;return U.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ei.current.style.display="none",ti.next=3,Object(ot.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si}});case 3:Rn=ti.sent,Rn!=null&&Rn.id&&we(Zi.current.getAttribute("src").replace(Ie.a.API_SERVER,""),"/api/attachments/".concat(Rn==null?void 0:Rn.id,"?type=").concat(Rn.content_type));case 5:case"end":return ti.stop()}},yn)}));return function(yn){return $n.apply(this,arguments)}}()),bn.show()},Kr=function(){var bn=new Zt(Zi.current);bn.settings.displayMode="popup",bn.addEventListener("render",function(){var $n=Object(re.a)(U.a.mark(function yn(si){var Rn;return U.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:if(ei.current.style.display="none",!Zi.current){ti.next=6;break}return ti.next=4,Object(ot.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:si.dataUrl}});case 4:Rn=ti.sent,Rn!=null&&Rn.id&&we(Zi.current.getAttribute("src").replace(Ie.a.API_SERVER,""),"/api/attachments/".concat(Rn==null?void 0:Rn.id,"?type=").concat(Rn.content_type));case 6:case"end":return ti.stop()}},yn)}));return function(yn){return $n.apply(this,arguments)}}()),bn.show(),window.markerArea=bn},Li=Object($.useMemo)(function(){try{var Vn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,bn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,$n=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hi=Hi.replace(Vn,"("+Ie.a.API_SERVER+"/api/attachments/").replace(bn,'"'+Ie.a.API_SERVER+"/api/attachments/").replace($n,'"'+Ie.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,`
|
|
`),Hi=Hi.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
`)}catch(yr){}var yn=Le(Hi),si=ke();if(Hi.match(/\[TOC\]/)&&(yn=yn.replace("<p>[TOC]</p>",Ae()),Ke()),yn=yn.replace(/(__special_katext_id_\d+__)/g,function(yr,ti){var Zn=si[ti],ur=Zn.type,Or=Zn.expression;return Object(De.renderToString)(mr(Or)||"",{displayMode:ur==="block",throwOnError:!1,output:"html"})}),yn=yn.replace(/▁/g,"\u2581\u2581\u2581"),ve(),J){var Rn=document.createElement("div");return Rn.innerHTML=yn,Rn.innerText}return setTimeout(function(){return Ir()},500),yn},[Hi]),Jn=Object($.useRef)();_e.WebkitLineClamp=Ge,Ge&&(dn=Object(C.a)(Object(C.a)({},dn),_e));function _r(Vn){var bn=Vn.target;if(bn.tagName.toUpperCase()==="IMG"){if(Ot){var $n=bn.getAttribute("src");sr($n),zi("image")}}else if(bn.tagName.toUpperCase()==="A"){var yn=bn.getAttribute("href");if(yn.indexOf("office")>-1)Vn.preventDefault(),sr(yn),zi("office");else if(yn.indexOf("application/pdf")>-1)Vn.preventDefault(),sr(yn),zi("pdf");else if(yn.indexOf("type=text")>-1)Vn.preventDefault(),sr(yn),zi("html");else if(yn.startsWith("#")){Vn.preventDefault();var si=document.getElementById(yn.replace("#",""));si&&si.scrollIntoView(!0)}}}var Ir=function(){var bn,$n=(bn=Jn.current)===null||bn===void 0?void 0:bn.querySelectorAll("video");$n==null||$n.forEach(function(yn){if(yn.oncontextmenu=function(){return!1},yn.src.indexOf(".m3u8")>-1&&!yn.canPlayType("application/vnd.apple.mpegurl")){if(de.a.isSupported()){var si=new de.a;si.loadSource(yn.src),si.attachMedia(yn)}}})};Object($.useEffect)(function(){if(Jn.current&&Li&&(Li.match(ar)&&window.PR.prettyPrint()),Jn.current)return Jn.current.addEventListener("click",_r),function(){Jn.current.removeEventListener("click",_r),ve(),Ke()}},[Li,Jn.current,_r]);var Xr=function(bn){if(!p)return;bn.target.nodeName==="IMG"?(ei.current.style.display="flex",ei.current.style.width=bn.target.clientWidth+"px",ei.current.style.height=bn.target.clientHeight+"px",ei.current.style.top=bn.target.offsetTop+"px",ei.current.style.left=bn.target.offsetLeft+"px",Zi.current.src=bn.target.getAttribute("src")):ei.current.style.display="none"};return M.a.createElement("div",{style:{position:"relative"}},M.a.createElement("div",{ref:Jn,style:Object(C.a)({},dn),className:"".concat(c||""," markdown-body ").concat(Ji.a.mdBody),onMouseOver:Xr,dangerouslySetInnerHTML:{__html:Li}}),M.a.createElement("div",{ref:ei,className:Ji.a.button},M.a.createElement(ce.a,null,M.a.createElement(H.a,{onClick:function(){return so()}},"\u88C1\u526A"),M.a.createElement(H.a,{onClick:function(){return Kr()}},"\u7F16\u8F91"))),M.a.createElement("img",{ref:Zi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),M.a.createElement(rt.a,{close:!0,data:_i,hasMask:$e,type:_i!=null&&_i.length?lr:"",style:Object(C.a)({},Ri),onClose:function(){return sr("")}}))}},"9VGf":function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return V});var E=y("q1tI"),ce=y.n(E);function V(H,C){var re=Object(E.useRef)();Object(E.useEffect)(function(){re.current=H}),Object(E.useEffect)(function(){function S(){re.current()}if(C!==null){var F=setInterval(S,C);return function(){return clearInterval(F)}}},[C])}},Bd2K:function(vt,Qe,y){(function(E){E(y("VrN/"),y("osHv"))})(function(E){E.defineOption("autoCloseTags",!1,function(U,$,M){if(M!=E.Init&&M&&U.removeKeyMap("autoCloseTags"),!$)return;var O={name:"autoCloseTags"};(typeof $!="object"||$.whenClosing!==!1)&&(O["'/'"]=function(te){return re(te)}),(typeof $!="object"||$.whenOpening!==!1)&&(O["'>'"]=function(te){return H(te)}),U.addKeyMap(O)});var ce=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],V=["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 H(U){if(U.getOption("disableInput"))return E.Pass;for(var $=U.listSelections(),M=[],O=U.getOption("autoCloseTags"),te=0;te<$.length;te++){if(!$[te].empty())return E.Pass;var Q=$[te].head,K=U.getTokenAt(Q),N=E.innerMode(U.getMode(),K.state),W=N.state,ee=N.mode.xmlCurrentTag&&N.mode.xmlCurrentTag(W),fe=ee&&ee.name;if(!fe)return E.Pass;var Re=N.mode.configuration=="html",Ke=typeof O=="object"&&O.dontCloseTags||Re&&ce,_e=typeof O=="object"&&O.indentTags||Re&&V;K.end>Q.ch&&(fe=fe.slice(0,fe.length-K.end+Q.ch));var ye=fe.toLowerCase();if(!fe||K.type=="string"&&(K.end!=Q.ch||!/[\"\']/.test(K.string.charAt(K.string.length-1))||K.string.length==1)||K.type=="tag"&&ee.close||K.string.indexOf("/")==Q.ch-K.start-1||Ke&&S(Ke,ye)>-1||F(U,N.mode.xmlCurrentContext&&N.mode.xmlCurrentContext(W)||[],fe,Q,!0))return E.Pass;var Ae=typeof O=="object"&&O.emptyTags;if(Ae&&S(Ae,fe)>-1){M[te]={text:"/>",newPos:E.Pos(Q.line,Q.ch+2)};continue}var Ce=_e&&S(_e,ye)>-1;M[te]={indent:Ce,text:">"+(Ce?`
|
|
|
|
`:"")+"</"+fe+">",newPos:Ce?E.Pos(Q.line+1,0):E.Pos(Q.line,Q.ch+1)}}for(var Ee=typeof O=="object"&&O.dontIndentOnAutoClose,te=$.length-1;te>=0;te--){var Fe=M[te];U.replaceRange(Fe.text,$[te].head,$[te].anchor,"+insert");var me=U.listSelections().slice(0);me[te]={head:Fe.newPos,anchor:Fe.newPos},U.setSelections(me),!Ee&&Fe.indent&&(U.indentLine(Fe.newPos.line,null,!0),U.indentLine(Fe.newPos.line+1,null,!0))}}function C(U,$){for(var M=U.listSelections(),O=[],te=$?"/":"</",Q=U.getOption("autoCloseTags"),K=typeof Q=="object"&&Q.dontIndentOnSlash,N=0;N<M.length;N++){if(!M[N].empty())return E.Pass;var W=M[N].head,ee=U.getTokenAt(W),fe=E.innerMode(U.getMode(),ee.state),Re=fe.state;if($&&(ee.type=="string"||ee.string.charAt(0)!="<"||ee.start!=W.ch-1))return E.Pass;var Ke,_e=fe.mode.name!="xml"&&U.getMode().name=="htmlmixed";if(_e&&fe.mode.name=="javascript")Ke=te+"script";else if(_e&&fe.mode.name=="css")Ke=te+"style";else{var ye=fe.mode.xmlCurrentContext&&fe.mode.xmlCurrentContext(Re);if(!ye||ye.length&&F(U,ye,ye[ye.length-1],W))return E.Pass;Ke=te+ye[ye.length-1]}U.getLine(W.line).charAt(ee.end)!=">"&&(Ke+=">"),O[N]=Ke}if(U.replaceSelections(O),M=U.listSelections(),!K)for(var N=0;N<M.length;N++)(N==M.length-1||M[N].head.line<M[N+1].head.line)&&U.indentLine(M[N].head.line)}function re(U){return U.getOption("disableInput")?E.Pass:C(U,!0)}E.commands.closeTag=function(U){return C(U)};function S(U,$){if(U.indexOf)return U.indexOf($);for(var M=0,O=U.length;M<O;++M)if(U[M]==$)return M;return-1}function F(U,$,M,O,te){if(!E.scanForClosingTag)return!1;var Q=Math.min(U.lastLine()+1,O.line+500),K=E.scanForClosingTag(U,O,null,Q);if(!K||K.tag!=M)return!1;for(var N=te?1:0,W=$.length-1;W>=0&&$[W]==M;W--)++N;O=K.to;for(var W=1;W<N;W++){var ee=E.scanForClosingTag(U,O,null,Q);if(!ee||ee.tag!=M)return!1;O=ee.to}return!0}})},BjJ7:function(vt,Qe,y){"use strict";y.d(Qe,"d",function(){return ce}),y.d(Qe,"c",function(){return V}),y.d(Qe,"e",function(){return H}),y.d(Qe,"b",function(){return C}),y.d(Qe,"a",function(){return S});var E=y("m3rI");function ce(F){var U=!0;if(F.length>0){for(var $=0;$<F.length;$++)if(F[$].compile_success==0||!F[$].compile_success){U=!1;break}}else U=!1;return U}function V(F){for(var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",$=[],M=0;M<F.length;M++){var O=F[M],te=U?"".concat(U,"/").concat(O.name):"".concat(O.name);$.push({title:O.name,isLeaf:!(O.type==="tree"),key:te})}return $}function H(F,U,$){for(var M=0;M<F.length;M++){var O=F[M];if(O.key===U){O.children=$;break}O.children&&H(O.children,U,$)}return F}function C(F,U,$){var M;return function(){var O=this,te=arguments,Q=function(){M=null,$||F.apply(O,te)},K=$&&!M;clearTimeout(M),M=setTimeout(Q,U),K&&F.apply(O,te)}}var re=!0,S=E.a.API_SERVER},"C+DQ":function(vt,Qe,y){},D1Df:function(vt,Qe,y){"use strict";function E(k){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?E=function(le){return typeof le}:E=function(le){return le&&typeof Symbol=="function"&&le.constructor===Symbol&&le!==Symbol.prototype?"symbol":typeof le},E(k)}function ce(){return ce=Object.assign||function(k){for(var G=1;G<arguments.length;G++){var le=arguments[G];for(var X in le)Object.prototype.hasOwnProperty.call(le,X)&&(k[X]=le[X])}return k},ce.apply(this,arguments)}function V(k,G){var le=Object.keys(k);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(k);G&&(X=X.filter(function(Le){return Object.getOwnPropertyDescriptor(k,Le).enumerable})),le.push.apply(le,X)}return le}function H(k){for(var G=1;G<arguments.length;G++){var le=arguments[G]!=null?arguments[G]:{};G%2?V(le,!0).forEach(function(X){K(k,X,le[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(le)):V(le).forEach(function(X){Object.defineProperty(k,X,Object.getOwnPropertyDescriptor(le,X))})}return k}function C(k,G){if(k==null)return{};var le=re(k,G),X,Le;if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(k);for(Le=0;Le<T.length;Le++){if(X=T[Le],G.indexOf(X)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(k,X))continue;le[X]=k[X]}}return le}function re(k,G){if(k==null)return{};var le={},X=Object.keys(k),Le,T;for(T=0;T<X.length;T++){if(Le=X[T],G.indexOf(Le)>=0)continue;le[Le]=k[Le]}return le}function S(k,G){if(!(k instanceof G))throw new TypeError("Cannot call a class as a function")}function F(k,G){for(var le=0;le<G.length;le++){var X=G[le];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(k,X.key,X)}}function U(k,G,le){return G&&F(k.prototype,G),le&&F(k,le),k}function $(k,G){return G&&(E(G)==="object"||typeof G=="function")?G:O(k)}function M(k){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(le){return le.__proto__||Object.getPrototypeOf(le)},M(k)}function O(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function te(k,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(G&&G.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),G&&Q(k,G)}function Q(k,G){return Q=Object.setPrototypeOf||function(X,Le){return X.__proto__=Le,X},Q(k,G)}function K(k,G,le){return G in k?Object.defineProperty(k,G,{value:le,enumerable:!0,configurable:!0,writable:!0}):k[G]=le,k}var N=y("q1tI"),W=y("17x9"),ee=y("H38U"),fe=y("aRTE");function Re(k){for(var G="",le=0;le<k.length;le++){var X=k.charCodeAt(le);X<128?G+=String.fromCharCode(X):X<2048?(G+=String.fromCharCode(192|X>>6),G+=String.fromCharCode(128|X&63)):X<55296||X>=57344?(G+=String.fromCharCode(224|X>>12),G+=String.fromCharCode(128|X>>6&63),G+=String.fromCharCode(128|X&63)):(le++,X=65536+((X&1023)<<10|k.charCodeAt(le)&1023),G+=String.fromCharCode(240|X>>18),G+=String.fromCharCode(128|X>>12&63),G+=String.fromCharCode(128|X>>6&63),G+=String.fromCharCode(128|X&63))}return G}var Ke={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},_e={},ye=4,Ae=.1;function Ce(k){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,le=[];return k.forEach(function(X,Le){var T=null;X.forEach(function(g,de){if(!g&&T!==null){le.push("M".concat(T+G," ").concat(Le+G,"h").concat(de-T,"v1H").concat(T+G,"z")),T=null;return}if(de===X.length-1){if(!g)return;T===null?le.push("M".concat(de+G,",").concat(Le+G," h1v1H").concat(de+G,"z")):le.push("M".concat(T+G,",").concat(Le+G," h").concat(de+1-T,"v1H").concat(T+G,"z"));return}g&&T===null&&(T=de)})}),le.join("")}function Ee(k,G){return k.slice().map(function(le,X){return X<G.y||X>=G.y+G.h?le:le.map(function(Le,T){return T<G.x||T>=G.x+G.w?Le:!1})})}function Fe(k,G){var le=k.imageSettings,X=k.size,Le=k.includeMargin;if(le==null)return null;var T=Le?ye:0,g=G.length+T*2,de=Math.floor(X*Ae),Ie=g/X,De=(le.width||de)*Ie,rt=(le.height||de)*Ie,ot=le.x==null?G.length/2-De/2:le.x*Ie,He=le.y==null?G.length/2-rt/2:le.y*Ie,Ue=null;if(le.excavate){var Pe=Math.floor(ot),Be=Math.floor(He),ue=Math.ceil(De+ot-Pe),D=Math.ceil(rt+He-Be);Ue={x:Pe,y:Be,w:ue,h:D}}return{x:ot,y:He,h:rt,w:De,excavation:Ue}}var me=function(){try{new Path2D().addPath(new Path2D)}catch(k){return!1}return!0}(),L=function(k){te(G,k);function G(){var le,X;S(this,G);for(var Le=arguments.length,T=new Array(Le),g=0;g<Le;g++)T[g]=arguments[g];return X=$(this,(le=M(G)).call.apply(le,[this].concat(T))),K(O(X),"_canvas",void 0),K(O(X),"_image",void 0),K(O(X),"state",{imgLoaded:!1}),K(O(X),"handleImageLoad",function(){X.setState({imgLoaded:!0})}),X}return U(G,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var X=this.props,Le=X.value,T=X.size,g=X.level,de=X.bgColor,Ie=X.fgColor,De=X.includeMargin,rt=X.imageSettings,ot=new ee(-1,fe[g]);if(ot.addData(Re(Le)),ot.make(),this._canvas!=null){var He=this._canvas,Ue=He.getContext("2d");if(!Ue)return;var Pe=ot.modules;if(Pe===null)return;var Be=De?ye:0,ue=Pe.length+Be*2,D=Fe(this.props,Pe);rt!=null&&D!=null&&(D.excavation!=null&&(Pe=Ee(Pe,D.excavation)));var Ze=window.devicePixelRatio||1;He.height=He.width=T*Ze;var mt=T/ue*Ze;Ue.scale(mt,mt),Ue.fillStyle=de,Ue.fillRect(0,0,ue,ue),Ue.fillStyle=Ie,me?Ue.fill(new Path2D(Ce(Pe,Be))):Pe.forEach(function(Ct,ut){Ct.forEach(function(st,he){st&&Ue.fillRect(he+Be,ut+Be,1,1)})}),this.state.imgLoaded&&this._image&&D!=null&&Ue.drawImage(this._image,D.x+Be,D.y+Be,D.w,D.h)}}},{key:"render",value:function(){var X=this,Le=this.props,T=Le.value,g=Le.size,de=Le.level,Ie=Le.bgColor,De=Le.fgColor,rt=Le.style,ot=Le.includeMargin,He=Le.imageSettings,Ue=C(Le,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),Pe=H({height:g,width:g},rt),Be=null,ue=He&&He.src;return He!=null&&ue!=null&&(Be=N.createElement("img",{src:ue,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(Ze){return X._image=Ze}})),N.createElement(N.Fragment,null,N.createElement("canvas",ce({style:Pe,height:g,width:g,ref:function(Ze){return X._canvas=Ze}},Ue)),Be)}}]),G}(N.PureComponent);K(L,"defaultProps",Ke);var ke=function(k){te(G,k);function G(){return S(this,G),$(this,M(G).apply(this,arguments))}return U(G,[{key:"render",value:function(){var X=this.props,Le=X.value,T=X.size,g=X.level,de=X.bgColor,Ie=X.fgColor,De=X.includeMargin,rt=X.imageSettings,ot=C(X,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),He=new ee(-1,fe[g]);He.addData(Re(Le)),He.make();var Ue=He.modules;if(Ue===null)return null;var Pe=De?ye:0,Be=Ue.length+Pe*2,ue=Fe(this.props,Ue),D=null;rt!=null&&ue!=null&&(ue.excavation!=null&&(Ue=Ee(Ue,ue.excavation)),D=N.createElement("image",{xlinkHref:rt.src,height:ue.h,width:ue.w,x:ue.x+Pe,y:ue.y+Pe,preserveAspectRatio:"none"}));var Ze=Ce(Ue,Pe);return N.createElement("svg",ce({shapeRendering:"crispEdges",height:T,width:T,viewBox:"0 0 ".concat(Be," ").concat(Be)},ot),N.createElement("path",{fill:de,d:"M0,0 h".concat(Be,"v").concat(Be,"H0z")}),N.createElement("path",{fill:Ie,d:Ze}),D)}}]),G}(N.PureComponent);K(ke,"defaultProps",Ke);var ve=function(G){var le=G.renderAs,X=C(G,["renderAs"]),Le=le==="svg"?ke:L;return N.createElement(Le,X)};ve.defaultProps=H({renderAs:"canvas"},Ke),vt.exports=ve},DlQD:function(vt,Qe,y){(function(E,ce){vt.exports=ce()})(this,function(){"use strict";function E(ae,Z){for(var ne=0;ne<Z.length;ne++){var x=Z[ne];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(ae,x.key,x)}}function ce(ae,Z,ne){return Z&&E(ae.prototype,Z),ne&&E(ae,ne),ae}function V(ae,Z){if(!ae)return;if(typeof ae=="string")return H(ae,Z);var ne=Object.prototype.toString.call(ae).slice(8,-1);if(ne==="Object"&&ae.constructor&&(ne=ae.constructor.name),ne==="Map"||ne==="Set")return Array.from(ae);if(ne==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ne))return H(ae,Z)}function H(ae,Z){(Z==null||Z>ae.length)&&(Z=ae.length);for(var ne=0,x=new Array(Z);ne<Z;ne++)x[ne]=ae[ne];return x}function C(ae,Z){var ne;if(typeof Symbol=="undefined"||ae[Symbol.iterator]==null){if(Array.isArray(ae)||(ne=V(ae))||Z&&ae&&typeof ae.length=="number"){ne&&(ae=ne);var x=0;return function(){return x>=ae.length?{done:!0}:{done:!1,value:ae[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 ne=ae[Symbol.iterator](),ne.next.bind(ne)}function re(ae,Z){return Z={exports:{}},ae(Z,Z.exports),Z.exports}var S=re(function(ae){function Z(){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 ne(x){ae.exports.defaults=x}ae.exports={defaults:Z(),getDefaults:Z,changeDefaults:ne}}),F=S.defaults,U=S.getDefaults,$=S.changeDefaults,M=/[&<>"']/,O=/[&<>"']/g,te=/[<>"']|&(?!#?\w+;)/,Q=/[<>"']|&(?!#?\w+;)/g,K={"&":"&","<":"<",">":">",'"':""","'":"'"},N=function(Z){return K[Z]};function W(ae,Z){if(Z){if(M.test(ae))return ae.replace(O,N)}else if(te.test(ae))return ae.replace(Q,N);return ae}var ee=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function fe(ae){return ae.replace(ee,function(Z,ne){return ne=ne.toLowerCase(),ne==="colon"?":":ne.charAt(0)==="#"?ne.charAt(1)==="x"?String.fromCharCode(parseInt(ne.substring(2),16)):String.fromCharCode(+ne.substring(1)):""})}var Re=/(^|[^\[])\^/g;function Ke(ae,Z){ae=ae.source||ae,Z=Z||"";var ne={replace:function(w,A){return A=A.source||A,A=A.replace(Re,"$1"),ae=ae.replace(w,A),ne},getRegex:function(){return new RegExp(ae,Z)}};return ne}var _e=/[^\w:]/g,ye=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Ae(ae,Z,ne){if(ae){var x;try{x=decodeURIComponent(fe(ne)).replace(_e,"").toLowerCase()}catch(w){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}Z&&!ye.test(ne)&&(ne=L(Z,ne));try{ne=encodeURI(ne).replace(/%25/g,"%")}catch(w){return null}return ne}var Ce={},Ee=/^[^:]+:\/*[^/]*$/,Fe=/^([^:]+:)[\s\S]*$/,me=/^([^:]+:\/*[^/]*)[\s\S]*$/;function L(ae,Z){Ce[" "+ae]||(Ee.test(ae)?Ce[" "+ae]=ae+"/":Ce[" "+ae]=G(ae,"/",!0)),ae=Ce[" "+ae];var ne=ae.indexOf(":")===-1;return Z.substring(0,2)==="//"?ne?Z:ae.replace(Fe,"$1")+Z:Z.charAt(0)==="/"?ne?Z:ae.replace(me,"$1")+Z:ae+Z}var ke={exec:function(){}};function ve(ae){for(var Z=1,ne,x;Z<arguments.length;Z++){ne=arguments[Z];for(x in ne)Object.prototype.hasOwnProperty.call(ne,x)&&(ae[x]=ne[x])}return ae}function k(ae,Z){var ne=ae.replace(/\|/g,function(A,P,be){for(var Te=!1,Xe=P;--Xe>=0&&be[Xe]==="\\";)Te=!Te;return Te?"|":" |"}),x=ne.split(/ \|/),w=0;if(x.length>Z)x.splice(Z);else for(;x.length<Z;)x.push("");for(;w<x.length;w++)x[w]=x[w].trim().replace(/\\\|/g,"|");return x}function G(ae,Z,ne){var x=ae.length;if(x===0)return"";for(var w=0;w<x;){var A=ae.charAt(x-w-1);if(A===Z&&!ne)w++;else if(A!==Z&&ne)w++;else break}return ae.substr(0,x-w)}function le(ae,Z){if(ae.indexOf(Z[1])===-1)return-1;for(var ne=ae.length,x=0,w=0;w<ne;w++)if(ae[w]==="\\")w++;else if(ae[w]===Z[0])x++;else if(ae[w]===Z[1]&&(x--,x<0))return w;return-1}function X(ae){ae&&ae.sanitize&&!ae.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var Le={escape:W,unescape:fe,edit:Ke,cleanUrl:Ae,resolveUrl:L,noopTest:ke,merge:ve,splitCells:k,rtrim:G,findClosingBracket:le,checkSanitizeDeprecation:X},T=S.defaults,g=Le.rtrim,de=Le.splitCells,Ie=Le.escape,De=Le.findClosingBracket;function rt(ae,Z,ne){var x=Z.href,w=Z.title?Ie(Z.title):null,A=ae[1].replace(/\\([\[\]])/g,"$1");return ae[0].charAt(0)!=="!"?{type:"link",raw:ne,href:x,title:w,text:A}:{type:"image",raw:ne,href:x,title:w,text:Ie(A)}}function ot(ae,Z){var ne=ae.match(/^(\s+)(?:```)/);if(ne===null)return Z;var x=ne[1];return Z.split(`
|
|
`).map(function(w){var A=w.match(/^\s+/);if(A===null)return w;var P=A[0];return P.length>=x.length?w.slice(x.length):w}).join(`
|
|
`)}var He=function(){function ae(ne){this.options=ne||T}var Z=ae.prototype;return Z.space=function(x){var w=this.rules.block.newline.exec(x);if(w)return w[0].length>1?{type:"space",raw:w[0]}:{raw:`
|
|
`}},Z.code=function(x,w){var A=this.rules.block.code.exec(x);if(A){var P=w[w.length-1];if(P&&P.type==="paragraph")return{raw:A[0],text:A[0].trimRight()};var be=A[0].replace(/^ {4}/gm,"");return{type:"code",raw:A[0],codeBlockStyle:"indented",text:this.options.pedantic?be:g(be,`
|
|
`)}}},Z.fences=function(x){var w=this.rules.block.fences.exec(x);if(w){var A=w[0],P=ot(A,w[3]||"");return{type:"code",raw:A,lang:w[2]?w[2].trim():w[2],text:P}}},Z.heading=function(x){var w=this.rules.block.heading.exec(x);if(w)return{type:"heading",raw:w[0],depth:w[1].length,text:w[2]}},Z.nptable=function(x){var w=this.rules.block.nptable.exec(x);if(w){var A={type:"table",header:de(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
|
|
`):[],raw:w[0]};if(A.header.length===A.align.length){var P=A.align.length,be;for(be=0;be<P;be++)/^ *-+: *$/.test(A.align[be])?A.align[be]="right":/^ *:-+: *$/.test(A.align[be])?A.align[be]="center":/^ *:-+ *$/.test(A.align[be])?A.align[be]="left":A.align[be]=null;for(P=A.cells.length,be=0;be<P;be++)A.cells[be]=de(A.cells[be],A.header.length);return A}}},Z.hr=function(x){var w=this.rules.block.hr.exec(x);if(w)return{type:"hr",raw:w[0]}},Z.blockquote=function(x){var w=this.rules.block.blockquote.exec(x);if(w){var A=w[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:w[0],text:A}}},Z.list=function(x){var w=this.rules.block.list.exec(x);if(w){for(var A=w[0],P=w[2],be=P.length>1,Te=P[P.length-1]===")",Xe={type:"list",raw:A,ordered:be,start:be?+P.slice(0,-1):"",loose:!1,items:[]},Et=w[0].match(this.rules.block.item),Gt=!1,Ve,Pt,St,ht,on,Zt,En,vn=Et.length,Ft=0;Ft<vn;Ft++)Ve=Et[Ft],A=Ve,Pt=Ve.length,Ve=Ve.replace(/^ *([*+-]|\d+[.)]) */,""),~Ve.indexOf(`
|
|
`)&&(Pt-=Ve.length,Ve=this.options.pedantic?Ve.replace(/^ {1,4}/gm,""):Ve.replace(new RegExp("^ {1,"+Pt+"}","gm"),"")),Ft!==vn-1&&(St=this.rules.block.bullet.exec(Et[Ft+1])[0],(be?St.length===1||!Te&&St[St.length-1]===")":St.length>1||this.options.smartLists&&St!==P)&&(ht=Et.slice(Ft+1).join(`
|
|
`),Xe.raw=Xe.raw.substring(0,Xe.raw.length-ht.length),Ft=vn-1)),on=Gt||/\n\n(?!\s*$)/.test(Ve),Ft!==vn-1&&(Gt=Ve.charAt(Ve.length-1)===`
|
|
`,on||(on=Gt)),on&&(Xe.loose=!0),Zt=/^\[[ xX]\] /.test(Ve),En=void 0,Zt&&(En=Ve[1]!==" ",Ve=Ve.replace(/^\[[ xX]\] +/,"")),Xe.items.push({type:"list_item",raw:A,task:Zt,checked:En,loose:on,text:Ve});return Xe}},Z.html=function(x){var w=this.rules.block.html.exec(x);if(w)return{type:this.options.sanitize?"paragraph":"html",raw:w[0],pre:!this.options.sanitizer&&(w[1]==="pre"||w[1]==="script"||w[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(w[0]):Ie(w[0]):w[0]}},Z.def=function(x){var w=this.rules.block.def.exec(x);if(w){w[3]&&(w[3]=w[3].substring(1,w[3].length-1));var A=w[1].toLowerCase().replace(/\s+/g," ");return{tag:A,raw:w[0],href:w[2],title:w[3]}}},Z.table=function(x){var w=this.rules.block.table.exec(x);if(w){var A={type:"table",header:de(w[1].replace(/^ *| *\| *$/g,"")),align:w[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:w[3]?w[3].replace(/\n$/,"").split(`
|
|
`):[]};if(A.header.length===A.align.length){A.raw=w[0];var P=A.align.length,be;for(be=0;be<P;be++)/^ *-+: *$/.test(A.align[be])?A.align[be]="right":/^ *:-+: *$/.test(A.align[be])?A.align[be]="center":/^ *:-+ *$/.test(A.align[be])?A.align[be]="left":A.align[be]=null;for(P=A.cells.length,be=0;be<P;be++)A.cells[be]=de(A.cells[be].replace(/^ *\| *| *\| *$/g,""),A.header.length);return A}}},Z.lheading=function(x){var w=this.rules.block.lheading.exec(x);if(w)return{type:"heading",raw:w[0],depth:w[2].charAt(0)==="="?1:2,text:w[1]}},Z.paragraph=function(x){var w=this.rules.block.paragraph.exec(x);if(w)return{type:"paragraph",raw:w[0],text:w[1].charAt(w[1].length-1)===`
|
|
`?w[1].slice(0,-1):w[1]}},Z.text=function(x,w){var A=this.rules.block.text.exec(x);if(A){var P=w[w.length-1];return P&&P.type==="text"?{raw:A[0],text:A[0]}:{type:"text",raw:A[0],text:A[0]}}},Z.escape=function(x){var w=this.rules.inline.escape.exec(x);if(w)return{type:"escape",raw:w[0],text:Ie(w[1])}},Z.tag=function(x,w,A){var P=this.rules.inline.tag.exec(x);if(P)return!w&&/^<a /i.test(P[0])?w=!0:w&&/^<\/a>/i.test(P[0])&&(w=!1),!A&&/^<(pre|code|kbd|script)(\s|>)/i.test(P[0])?A=!0:A&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(P[0])&&(A=!1),{type:this.options.sanitize?"text":"html",raw:P[0],inLink:w,inRawBlock:A,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(P[0]):Ie(P[0]):P[0]}},Z.link=function(x){var w=this.rules.inline.link.exec(x);if(w){var A=De(w[2],"()");if(A>-1){var P=w[0].indexOf("!")===0?5:4,be=P+w[1].length+A;w[2]=w[2].substring(0,A),w[0]=w[0].substring(0,be).trim(),w[3]=""}var Te=w[2],Xe="";if(this.options.pedantic){var Et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Te);Et?(Te=Et[1],Xe=Et[3]):Xe=""}else Xe=w[3]?w[3].slice(1,-1):"";Te=Te.trim().replace(/^<([\s\S]*)>$/,"$1");var Gt=rt(w,{href:Te&&Te.replace(this.rules.inline._escapes,"$1"),title:Xe&&Xe.replace(this.rules.inline._escapes,"$1")},w[0]);return Gt}},Z.reflink=function(x,w){var A;if((A=this.rules.inline.reflink.exec(x))||(A=this.rules.inline.nolink.exec(x))){var P=(A[2]||A[1]).replace(/\s+/g," ");if(P=w[P.toLowerCase()],!P||!P.href){var be=A[0].charAt(0);return{type:"text",raw:be,text:be}}var Te=rt(A,P,A[0]);return Te}},Z.strong=function(x,w,A){A===void 0&&(A="");var P=this.rules.inline.strong.start.exec(x);if(P&&(!P[1]||P[1]&&(A===""||this.rules.inline.punctuation.exec(A)))){w=w.slice(-1*x.length);var be=P[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var Te;(P=be.exec(w))!=null;)if(Te=this.rules.inline.strong.middle.exec(w.slice(0,P.index+3)),Te)return{type:"strong",raw:x.slice(0,Te[0].length),text:x.slice(2,Te[0].length-2)}}},Z.em=function(x,w,A){A===void 0&&(A="");var P=this.rules.inline.em.start.exec(x);if(P&&(!P[1]||P[1]&&(A===""||this.rules.inline.punctuation.exec(A)))){w=w.slice(-1*x.length);var be=P[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var Te;(P=be.exec(w))!=null;)if(Te=this.rules.inline.em.middle.exec(w.slice(0,P.index+2)),Te)return{type:"em",raw:x.slice(0,Te[0].length),text:x.slice(1,Te[0].length-1)}}},Z.codespan=function(x){var w=this.rules.inline.code.exec(x);if(w){var A=w[2].replace(/\n/g," "),P=/[^ ]/.test(A),be=A.startsWith(" ")&&A.endsWith(" ");return P&&be&&(A=A.substring(1,A.length-1)),A=Ie(A,!0),{type:"codespan",raw:w[0],text:A}}},Z.br=function(x){var w=this.rules.inline.br.exec(x);if(w)return{type:"br",raw:w[0]}},Z.del=function(x){var w=this.rules.inline.del.exec(x);if(w)return{type:"del",raw:w[0],text:w[1]}},Z.autolink=function(x,w){var A=this.rules.inline.autolink.exec(x);if(A){var P,be;return A[2]==="@"?(P=Ie(this.options.mangle?w(A[1]):A[1]),be="mailto:"+P):(P=Ie(A[1]),be=P),{type:"link",raw:A[0],text:P,href:be,tokens:[{type:"text",raw:P,text:P}]}}},Z.url=function(x,w){var A;if(A=this.rules.inline.url.exec(x)){var P,be;if(A[2]==="@")P=Ie(this.options.mangle?w(A[0]):A[0]),be="mailto:"+P;else{var Te;do Te=A[0],A[0]=this.rules.inline._backpedal.exec(A[0])[0];while(Te!==A[0]);P=Ie(A[0]),A[1]==="www."?be="http://"+P:be=P}return{type:"link",raw:A[0],text:P,href:be,tokens:[{type:"text",raw:P,text:P}]}}},Z.inlineText=function(x,w,A){var P=this.rules.inline.text.exec(x);if(P){var be;return w?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(P[0]):Ie(P[0]):P[0]:be=Ie(this.options.smartypants?A(P[0]):P[0]),{type:"text",raw:P[0],text:be}}},ae}(),Ue=Le.noopTest,Pe=Le.edit,Be=Le.merge,ue={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:Ue,table:Ue,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ue._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ue._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ue.def=Pe(ue.def).replace("label",ue._label).replace("title",ue._title).getRegex(),ue.bullet=/(?:[*+-]|\d{1,9}[.)])/,ue.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ue.item=Pe(ue.item,"gm").replace(/bull/g,ue.bullet).getRegex(),ue.list=Pe(ue.list).replace(/bull/g,ue.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ue.def.source+")").getRegex(),ue._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",ue._comment=/<!--(?!-?>)[\s\S]*?-->/,ue.html=Pe(ue.html,"i").replace("comment",ue._comment).replace("tag",ue._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ue.paragraph=Pe(ue._paragraph).replace("hr",ue.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",ue._tag).getRegex(),ue.blockquote=Pe(ue.blockquote).replace("paragraph",ue.paragraph).getRegex(),ue.normal=Be({},ue),ue.gfm=Be({},ue.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*|$)"}),ue.gfm.nptable=Pe(ue.gfm.nptable).replace("hr",ue.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",ue._tag).getRegex(),ue.gfm.table=Pe(ue.gfm.table).replace("hr",ue.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",ue._tag).getRegex(),ue.pedantic=Be({},ue.normal,{html:Pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ue._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:Ue,paragraph:Pe(ue.normal._paragraph).replace("hr",ue.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",ue.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var D={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ue,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:Ue,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};D._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",D.punctuation=Pe(D.punctuation).replace(/punctuation/g,D._punctuation).getRegex(),D._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",D._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",D.em.start=Pe(D.em.start).replace(/punctuation/g,D._punctuation).getRegex(),D.em.middle=Pe(D.em.middle).replace(/punctuation/g,D._punctuation).replace(/overlapSkip/g,D._overlapSkip).getRegex(),D.em.endAst=Pe(D.em.endAst,"g").replace(/punctuation/g,D._punctuation).getRegex(),D.em.endUnd=Pe(D.em.endUnd,"g").replace(/punctuation/g,D._punctuation).getRegex(),D.strong.start=Pe(D.strong.start).replace(/punctuation/g,D._punctuation).getRegex(),D.strong.middle=Pe(D.strong.middle).replace(/punctuation/g,D._punctuation).replace(/blockSkip/g,D._blockSkip).getRegex(),D.strong.endAst=Pe(D.strong.endAst,"g").replace(/punctuation/g,D._punctuation).getRegex(),D.strong.endUnd=Pe(D.strong.endUnd,"g").replace(/punctuation/g,D._punctuation).getRegex(),D.blockSkip=Pe(D._blockSkip,"g").getRegex(),D.overlapSkip=Pe(D._overlapSkip,"g").getRegex(),D._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,D._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,D._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])?)+(?![-_])/,D.autolink=Pe(D.autolink).replace("scheme",D._scheme).replace("email",D._email).getRegex(),D._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,D.tag=Pe(D.tag).replace("comment",ue._comment).replace("attribute",D._attribute).getRegex(),D._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,D._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,D._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,D.link=Pe(D.link).replace("label",D._label).replace("href",D._href).replace("title",D._title).getRegex(),D.reflink=Pe(D.reflink).replace("label",D._label).getRegex(),D.reflinkSearch=Pe(D.reflinkSearch,"g").replace("reflink",D.reflink).replace("nolink",D.nolink).getRegex(),D.normal=Be({},D),D.pedantic=Be({},D.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:Pe(/^!?\[(label)\]\((.*?)\)/).replace("label",D._label).getRegex(),reflink:Pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",D._label).getRegex()}),D.gfm=Be({},D.normal,{escape:Pe(D.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),D.gfm.url=Pe(D.gfm.url,"i").replace("email",D.gfm._extended_email).getRegex(),D.breaks=Be({},D.gfm,{br:Pe(D.br).replace("{2,}","*").getRegex(),text:Pe(D.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ze={block:ue,inline:D},mt=S.defaults,Ct=Ze.block,ut=Ze.inline;function st(ae){return ae.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function he(ae){var Z="",ne,x,w=ae.length;for(ne=0;ne<w;ne++)x=ae.charCodeAt(ne),Math.random()>.5&&(x="x"+x.toString(16)),Z+="&#"+x+";";return Z}var Me=function(){function ae(ne){this.tokens=[],this.tokens.links=Object.create(null),this.options=ne||mt,this.options.tokenizer=this.options.tokenizer||new He,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var x={block:Ct.normal,inline:ut.normal};this.options.pedantic?(x.block=Ct.pedantic,x.inline=ut.pedantic):this.options.gfm&&(x.block=Ct.gfm,this.options.breaks?x.inline=ut.breaks:x.inline=ut.gfm),this.tokenizer.rules=x}ae.lex=function(x,w){var A=new ae(w);return A.lex(x)};var Z=ae.prototype;return Z.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},Z.blockTokens=function(x,w,A){w===void 0&&(w=[]),A===void 0&&(A=!0),x=x.replace(/^ +$/gm,"");for(var P,be,Te,Xe;x;){if(P=this.tokenizer.space(x)){x=x.substring(P.raw.length),P.type&&w.push(P);continue}if(P=this.tokenizer.code(x,w)){x=x.substring(P.raw.length),P.type?w.push(P):(Xe=w[w.length-1],Xe.raw+=`
|
|
`+P.raw,Xe.text+=`
|
|
`+P.text);continue}if(P=this.tokenizer.fences(x)){x=x.substring(P.raw.length),w.push(P);continue}if(P=this.tokenizer.heading(x)){x=x.substring(P.raw.length),w.push(P);continue}if(P=this.tokenizer.nptable(x)){x=x.substring(P.raw.length),w.push(P);continue}if(P=this.tokenizer.hr(x)){x=x.substring(P.raw.length),w.push(P);continue}if(P=this.tokenizer.blockquote(x)){x=x.substring(P.raw.length),P.tokens=this.blockTokens(P.text,[],A),w.push(P);continue}if(P=this.tokenizer.list(x)){for(x=x.substring(P.raw.length),Te=P.items.length,be=0;be<Te;be++)P.items[be].tokens=this.blockTokens(P.items[be].text,[],!1);w.push(P);continue}if(P=this.tokenizer.html(x)){x=x.substring(P.raw.length),w.push(P);continue}if(A&&(P=this.tokenizer.def(x))){x=x.substring(P.raw.length),this.tokens.links[P.tag]||(this.tokens.links[P.tag]={href:P.href,title:P.title});continue}if(P=this.tokenizer.table(x)){x=x.substring(P.raw.length),w.push(P);continue}if(P=this.tokenizer.lheading(x)){x=x.substring(P.raw.length),w.push(P);continue}if(A&&(P=this.tokenizer.paragraph(x))){x=x.substring(P.raw.length),w.push(P);continue}if(P=this.tokenizer.text(x,w)){x=x.substring(P.raw.length),P.type?w.push(P):(Xe=w[w.length-1],Xe.raw+=`
|
|
`+P.raw,Xe.text+=`
|
|
`+P.text);continue}if(x){var Et="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(Et);break}else throw new Error(Et)}}return w},Z.inline=function(x){var w,A,P,be,Te,Xe,Et=x.length;for(w=0;w<Et;w++){Xe=x[w];switch(Xe.type){case"paragraph":case"text":case"heading":{Xe.tokens=[],this.inlineTokens(Xe.text,Xe.tokens);break}case"table":{for(Xe.tokens={header:[],cells:[]},be=Xe.header.length,A=0;A<be;A++)Xe.tokens.header[A]=[],this.inlineTokens(Xe.header[A],Xe.tokens.header[A]);for(be=Xe.cells.length,A=0;A<be;A++)for(Te=Xe.cells[A],Xe.tokens.cells[A]=[],P=0;P<Te.length;P++)Xe.tokens.cells[A][P]=[],this.inlineTokens(Te[P],Xe.tokens.cells[A][P]);break}case"blockquote":{this.inline(Xe.tokens);break}case"list":{for(be=Xe.items.length,A=0;A<be;A++)this.inline(Xe.items[A].tokens);break}}}return x},Z.inlineTokens=function(x,w,A,P,be){w===void 0&&(w=[]),A===void 0&&(A=!1),P===void 0&&(P=!1),be===void 0&&(be="");var Te,Xe=x,Et;if(this.tokens.links){var Gt=Object.keys(this.tokens.links);if(Gt.length>0)for(;(Et=this.tokenizer.rules.inline.reflinkSearch.exec(Xe))!=null;)Gt.includes(Et[0].slice(Et[0].lastIndexOf("[")+1,-1))&&(Xe=Xe.slice(0,Et.index)+"["+"a".repeat(Et[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Et=this.tokenizer.rules.inline.blockSkip.exec(Xe))!=null;)Xe=Xe.slice(0,Et.index)+"["+"a".repeat(Et[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;x;){if(Te=this.tokenizer.escape(x)){x=x.substring(Te.raw.length),w.push(Te);continue}if(Te=this.tokenizer.tag(x,A,P)){x=x.substring(Te.raw.length),A=Te.inLink,P=Te.inRawBlock,w.push(Te);continue}if(Te=this.tokenizer.link(x)){x=x.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,P)),w.push(Te);continue}if(Te=this.tokenizer.reflink(x,this.tokens.links)){x=x.substring(Te.raw.length),Te.type==="link"&&(Te.tokens=this.inlineTokens(Te.text,[],!0,P)),w.push(Te);continue}if(Te=this.tokenizer.strong(x,Xe,be)){x=x.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],A,P),w.push(Te);continue}if(Te=this.tokenizer.em(x,Xe,be)){x=x.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],A,P),w.push(Te);continue}if(Te=this.tokenizer.codespan(x)){x=x.substring(Te.raw.length),w.push(Te);continue}if(Te=this.tokenizer.br(x)){x=x.substring(Te.raw.length),w.push(Te);continue}if(Te=this.tokenizer.del(x)){x=x.substring(Te.raw.length),Te.tokens=this.inlineTokens(Te.text,[],A,P),w.push(Te);continue}if(Te=this.tokenizer.autolink(x,he)){x=x.substring(Te.raw.length),w.push(Te);continue}if(!A&&(Te=this.tokenizer.url(x,he))){x=x.substring(Te.raw.length),w.push(Te);continue}if(Te=this.tokenizer.inlineText(x,P,st)){x=x.substring(Te.raw.length),be=Te.raw.slice(-1),w.push(Te);continue}if(x){var Ve="Infinite loop on byte: "+x.charCodeAt(0);if(this.options.silent){console.error(Ve);break}else throw new Error(Ve)}}return w},ce(ae,null,[{key:"rules",get:function(){return{block:Ct,inline:ut}}}]),ae}(),Oe=S.defaults,Se=Le.cleanUrl,tt=Le.escape,Ye=function(){function ae(ne){this.options=ne||Oe}var Z=ae.prototype;return Z.code=function(x,w,A){var P=(w||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(x,P);be!=null&&be!==x&&(A=!0,x=be)}return P?'<pre><code class="'+this.options.langPrefix+tt(P,!0)+'">'+(A?x:tt(x,!0))+`</code></pre>
|
|
`:"<pre><code>"+(A?x:tt(x,!0))+`</code></pre>
|
|
`},Z.blockquote=function(x){return`<blockquote>
|
|
`+x+`</blockquote>
|
|
`},Z.html=function(x){return x},Z.heading=function(x,w,A,P){return this.options.headerIds?"<h"+w+' id="'+this.options.headerPrefix+P.slug(A)+'">'+x+"</h"+w+`>
|
|
`:"<h"+w+">"+x+"</h"+w+`>
|
|
`},Z.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},Z.list=function(x,w,A){var P=w?"ol":"ul",be=w&&A!==1?' start="'+A+'"':"";return"<"+P+be+`>
|
|
`+x+"</"+P+`>
|
|
`},Z.listitem=function(x){return"<li>"+x+`</li>
|
|
`},Z.checkbox=function(x){return"<input "+(x?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Z.paragraph=function(x){return"<p>"+x+`</p>
|
|
`},Z.table=function(x,w){return w&&(w="<tbody>"+w+"</tbody>"),`<table>
|
|
<thead>
|
|
`+x+`</thead>
|
|
`+w+`</table>
|
|
`},Z.tablerow=function(x){return`<tr>
|
|
`+x+`</tr>
|
|
`},Z.tablecell=function(x,w){var A=w.header?"th":"td",P=w.align?"<"+A+' align="'+w.align+'">':"<"+A+">";return P+x+"</"+A+`>
|
|
`},Z.strong=function(x){return"<strong>"+x+"</strong>"},Z.em=function(x){return"<em>"+x+"</em>"},Z.codespan=function(x){return"<code>"+x+"</code>"},Z.br=function(){return this.options.xhtml?"<br/>":"<br>"},Z.del=function(x){return"<del>"+x+"</del>"},Z.link=function(x,w,A){if(x=Se(this.options.sanitize,this.options.baseUrl,x),x===null)return A;var P='<a href="'+tt(x)+'"';return w&&(P+=' title="'+w+'"'),P+=">"+A+"</a>",P},Z.image=function(x,w,A){if(x=Se(this.options.sanitize,this.options.baseUrl,x),x===null)return A;var P='<img src="'+x+'" alt="'+A+'"';return w&&(P+=' title="'+w+'"'),P+=this.options.xhtml?"/>":">",P},Z.text=function(x){return x},ae}(),lt=function(){function ae(){}var Z=ae.prototype;return Z.strong=function(x){return x},Z.em=function(x){return x},Z.codespan=function(x){return x},Z.del=function(x){return x},Z.html=function(x){return x},Z.text=function(x){return x},Z.link=function(x,w,A){return""+A},Z.image=function(x,w,A){return""+A},Z.br=function(){return""},ae}(),Nt=function(){function ae(){this.seen={}}var Z=ae.prototype;return Z.slug=function(x){var w=x.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(w)){var A=w;do this.seen[A]++,w=A+"-"+this.seen[A];while(this.seen.hasOwnProperty(w))}return this.seen[w]=0,w},ae}(),_t=S.defaults,xt=Le.unescape,dt=function(){function ae(ne){this.options=ne||_t,this.options.renderer=this.options.renderer||new Ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new lt,this.slugger=new Nt}ae.parse=function(x,w){var A=new ae(w);return A.parse(x)};var Z=ae.prototype;return Z.parse=function(x,w){w===void 0&&(w=!0);var A="",P,be,Te,Xe,Et,Gt,Ve,Pt,St,ht,on,Zt,En,vn,Ft,zn,Bn,At,hi=x.length;for(P=0;P<hi;P++){ht=x[P];switch(ht.type){case"space":continue;case"hr":{A+=this.renderer.hr();continue}case"heading":{A+=this.renderer.heading(this.parseInline(ht.tokens),ht.depth,xt(this.parseInline(ht.tokens,this.textRenderer)),this.slugger);continue}case"code":{A+=this.renderer.code(ht.text,ht.lang,ht.escaped);continue}case"table":{for(Pt="",Ve="",Xe=ht.header.length,be=0;be<Xe;be++)Ve+=this.renderer.tablecell(this.parseInline(ht.tokens.header[be]),{header:!0,align:ht.align[be]});for(Pt+=this.renderer.tablerow(Ve),St="",Xe=ht.cells.length,be=0;be<Xe;be++){for(Gt=ht.tokens.cells[be],Ve="",Et=Gt.length,Te=0;Te<Et;Te++)Ve+=this.renderer.tablecell(this.parseInline(Gt[Te]),{header:!1,align:ht.align[Te]});St+=this.renderer.tablerow(Ve)}A+=this.renderer.table(Pt,St);continue}case"blockquote":{St=this.parse(ht.tokens),A+=this.renderer.blockquote(St);continue}case"list":{for(on=ht.ordered,Zt=ht.start,En=ht.loose,Xe=ht.items.length,St="",be=0;be<Xe;be++)Ft=ht.items[be],zn=Ft.checked,Bn=Ft.task,vn="",Ft.task&&(At=this.renderer.checkbox(zn),En?Ft.tokens.length>0&&Ft.tokens[0].type==="text"?(Ft.tokens[0].text=At+" "+Ft.tokens[0].text,Ft.tokens[0].tokens&&Ft.tokens[0].tokens.length>0&&Ft.tokens[0].tokens[0].type==="text"&&(Ft.tokens[0].tokens[0].text=At+" "+Ft.tokens[0].tokens[0].text)):Ft.tokens.unshift({type:"text",text:At}):vn+=At),vn+=this.parse(Ft.tokens,En),St+=this.renderer.listitem(vn,Bn,zn);A+=this.renderer.list(St,on,Zt);continue}case"html":{A+=this.renderer.html(ht.text);continue}case"paragraph":{A+=this.renderer.paragraph(this.parseInline(ht.tokens));continue}case"text":{for(St=ht.tokens?this.parseInline(ht.tokens):ht.text;P+1<hi&&x[P+1].type==="text";)ht=x[++P],St+=`
|
|
`+(ht.tokens?this.parseInline(ht.tokens):ht.text);A+=w?this.renderer.paragraph(St):St;continue}default:{var oi='Token with "'+ht.type+'" type was not found.';if(this.options.silent){console.error(oi);return}else throw new Error(oi)}}}return A},Z.parseInline=function(x,w){w=w||this.renderer;var A="",P,be,Te=x.length;for(P=0;P<Te;P++){be=x[P];switch(be.type){case"escape":{A+=w.text(be.text);break}case"html":{A+=w.html(be.text);break}case"link":{A+=w.link(be.href,be.title,this.parseInline(be.tokens,w));break}case"image":{A+=w.image(be.href,be.title,be.text);break}case"strong":{A+=w.strong(this.parseInline(be.tokens,w));break}case"em":{A+=w.em(this.parseInline(be.tokens,w));break}case"codespan":{A+=w.codespan(be.text);break}case"br":{A+=w.br();break}case"del":{A+=w.del(this.parseInline(be.tokens,w));break}case"text":{A+=w.text(be.text);break}default:{var Xe='Token with "'+be.type+'" type was not found.';if(this.options.silent){console.error(Xe);return}else throw new Error(Xe)}}}return A},ae}(),Lt=Le.merge,wt=Le.checkSanitizeDeprecation,gt=Le.escape,Ne=S.getDefaults,Dt=S.changeDefaults,yt=S.defaults;function We(ae,Z,ne){if(typeof ae=="undefined"||ae===null)throw new Error("marked(): input parameter is undefined or null");if(typeof ae!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(ae)+", string expected");if(typeof Z=="function"&&(ne=Z,Z=null),Z=Lt({},We.defaults,Z||{}),wt(Z),ne){var x=Z.highlight,w;try{w=Me.lex(ae,Z)}catch(Te){return ne(Te)}var A=function(Xe){var Et;if(!Xe)try{Et=dt.parse(w,Z)}catch(Gt){Xe=Gt}return Z.highlight=x,Xe?ne(Xe):ne(null,Et)};if(!x||x.length<3)return A();if(delete Z.highlight,!w.length)return A();var P=0;We.walkTokens(w,function(Te){Te.type==="code"&&(P++,setTimeout(function(){x(Te.text,Te.lang,function(Xe,Et){if(Xe)return A(Xe);Et!=null&&Et!==Te.text&&(Te.text=Et,Te.escaped=!0),P--,P===0&&A()})},0))}),P===0&&A();return}try{var be=Me.lex(ae,Z);return Z.walkTokens&&We.walkTokens(be,Z.walkTokens),dt.parse(be,Z)}catch(Te){if(Te.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,Z.silent)return"<p>An error occurred:</p><pre>"+gt(Te.message+"",!0)+"</pre>";throw Te}}We.options=We.setOptions=function(ae){return Lt(We.defaults,ae),Dt(We.defaults),We},We.getDefaults=Ne,We.defaults=yt,We.use=function(ae){var Z=Lt({},ae);if(ae.renderer&&function(){var x=We.defaults.renderer||new Ye,w=function(be){var Te=x[be];x[be]=function(){for(var Xe=arguments.length,Et=new Array(Xe),Gt=0;Gt<Xe;Gt++)Et[Gt]=arguments[Gt];var Ve=ae.renderer[be].apply(x,Et);return Ve===!1&&(Ve=Te.apply(x,Et)),Ve}};for(var A in ae.renderer)w(A);Z.renderer=x}(),ae.tokenizer&&function(){var x=We.defaults.tokenizer||new He,w=function(be){var Te=x[be];x[be]=function(){for(var Xe=arguments.length,Et=new Array(Xe),Gt=0;Gt<Xe;Gt++)Et[Gt]=arguments[Gt];var Ve=ae.tokenizer[be].apply(x,Et);return Ve===!1&&(Ve=Te.apply(x,Et)),Ve}};for(var A in ae.tokenizer)w(A);Z.tokenizer=x}(),ae.walkTokens){var ne=We.defaults.walkTokens;Z.walkTokens=function(x){ae.walkTokens(x),ne&&ne(x)}}We.setOptions(Z)},We.walkTokens=function(ae,Z){for(var ne=C(ae),x;!(x=ne()).done;){var w=x.value;Z(w);switch(w.type){case"table":{for(var A=C(w.tokens.header),P;!(P=A()).done;){var be=P.value;We.walkTokens(be,Z)}for(var Te=C(w.tokens.cells),Xe;!(Xe=Te()).done;)for(var Et=Xe.value,Gt=C(Et),Ve;!(Ve=Gt()).done;){var Pt=Ve.value;We.walkTokens(Pt,Z)}break}case"list":{We.walkTokens(w.items,Z);break}default:w.tokens&&We.walkTokens(w.tokens,Z)}}},We.Parser=dt,We.parser=dt.parse,We.Renderer=Ye,We.TextRenderer=lt,We.Lexer=Me,We.lexer=Me.lex,We.Tokenizer=He,We.Slugger=Nt,We.parse=We;var et=We;return et})},E9nw:function(vt,Qe){vt.exports=function(){var y=document.getSelection();if(!y.rangeCount)return function(){};for(var E=document.activeElement,ce=[],V=0;V<y.rangeCount;V++)ce.push(y.getRangeAt(V));switch(E.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":E.blur();break;default:E=null;break}return y.removeAllRanges(),function(){y.type==="Caret"&&y.removeAllRanges(),y.rangeCount||ce.forEach(function(H){y.addRange(H)}),E&&E.focus()}}},ELLl:function(vt,Qe,y){(function(E){E(y("VrN/"))})(function(E){var ce={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},V=E.Pos;E.defineOption("autoCloseBrackets",!1,function(K,N,W){W&&W!=E.Init&&(K.removeKeyMap(C),K.state.closeBrackets=null),N&&(re(H(N,"pairs")),K.state.closeBrackets=N,K.addKeyMap(C))});function H(K,N){return N=="pairs"&&typeof K=="string"?K:typeof K=="object"&&K[N]!=null?K[N]:ce[N]}var C={Backspace:U,Enter:$};function re(K){for(var N=0;N<K.length;N++){var W=K.charAt(N),ee="'"+W+"'";C[ee]||(C[ee]=S(W))}}re(ce.pairs+"`");function S(K){return function(N){return O(N,K)}}function F(K){var N=K.state.closeBrackets;if(!N||N.override)return N;var W=K.getModeAt(K.getCursor());return W.closeBrackets||N}function U(K){var N=F(K);if(!N||K.getOption("disableInput"))return E.Pass;for(var W=H(N,"pairs"),ee=K.listSelections(),fe=0;fe<ee.length;fe++){if(!ee[fe].empty())return E.Pass;var Re=te(K,ee[fe].head);if(!Re||W.indexOf(Re)%2!=0)return E.Pass}for(var fe=ee.length-1;fe>=0;fe--){var Ke=ee[fe].head;K.replaceRange("",V(Ke.line,Ke.ch-1),V(Ke.line,Ke.ch+1),"+delete")}}function $(K){var N=F(K),W=N&&H(N,"explode");if(!W||K.getOption("disableInput"))return E.Pass;for(var ee=K.listSelections(),fe=0;fe<ee.length;fe++){if(!ee[fe].empty())return E.Pass;var Re=te(K,ee[fe].head);if(!Re||W.indexOf(Re)%2!=0)return E.Pass}K.operation(function(){var Ke=K.lineSeparator()||`
|
|
`;K.replaceSelection(Ke+Ke,null),K.execCommand("goCharLeft"),ee=K.listSelections();for(var _e=0;_e<ee.length;_e++){var ye=ee[_e].head.line;K.indentLine(ye,null,!0),K.indentLine(ye+1,null,!0)}})}function M(K){var N=E.cmpPos(K.anchor,K.head)>0;return{anchor:new V(K.anchor.line,K.anchor.ch+(N?-1:1)),head:new V(K.head.line,K.head.ch+(N?1:-1))}}function O(K,N){var W=F(K);if(!W||K.getOption("disableInput"))return E.Pass;var ee=H(W,"pairs"),fe=ee.indexOf(N);if(fe==-1)return E.Pass;for(var Re=H(W,"closeBefore"),Ke=H(W,"triples"),_e=ee.charAt(fe+1)==N,ye=K.listSelections(),Ae=fe%2==0,Ce,Ee=0;Ee<ye.length;Ee++){var Fe=ye[Ee],me=Fe.head,L,ke=K.getRange(me,V(me.line,me.ch+1));if(Ae&&!Fe.empty())L="surround";else if((_e||!Ae)&&ke==N)_e&&Q(K,me)?L="both":Ke.indexOf(N)>=0&&K.getRange(me,V(me.line,me.ch+3))==N+N+N?L="skipThree":L="skip";else if(_e&&me.ch>1&&Ke.indexOf(N)>=0&&K.getRange(V(me.line,me.ch-2),me)==N+N){if(me.ch>2&&/\bstring/.test(K.getTokenTypeAt(V(me.line,me.ch-2))))return E.Pass;L="addFour"}else if(_e){var ve=me.ch==0?" ":K.getRange(V(me.line,me.ch-1),me);if(!E.isWordChar(ke)&&ve!=N&&!E.isWordChar(ve))L="both";else return E.Pass}else if(Ae&&(ke.length===0||/\s/.test(ke)||Re.indexOf(ke)>-1))L="both";else return E.Pass;if(!Ce)Ce=L;else if(Ce!=L)return E.Pass}var k=fe%2?ee.charAt(fe-1):N,G=fe%2?N:ee.charAt(fe+1);K.operation(function(){if(Ce=="skip")K.execCommand("goCharRight");else if(Ce=="skipThree")for(var le=0;le<3;le++)K.execCommand("goCharRight");else if(Ce=="surround"){for(var X=K.getSelections(),le=0;le<X.length;le++)X[le]=k+X[le]+G;K.replaceSelections(X,"around"),X=K.listSelections().slice();for(var le=0;le<X.length;le++)X[le]=M(X[le]);K.setSelections(X)}else Ce=="both"?(K.replaceSelection(k+G,null),K.triggerElectric(k+G),K.execCommand("goCharLeft")):Ce=="addFour"&&(K.replaceSelection(k+k+k+k,"before"),K.execCommand("goCharRight"))})}function te(K,N){var W=K.getRange(V(N.line,N.ch-1),V(N.line,N.ch+1));return W.length==2?W:null}function Q(K,N){var W=K.getTokenAt(V(N.line,N.ch+1));return/\bstring/.test(W.type)&&W.start==N.ch&&(N.ch==0||!/\bstring/.test(K.getTokenTypeAt(N)))}})},Gytx:function(vt,Qe){vt.exports=function(E,ce,V,H){var C=V?V.call(H,E,ce):void 0;if(C!==void 0)return!!C;if(E===ce)return!0;if(typeof E!="object"||!E||typeof ce!="object"||!ce)return!1;var re=Object.keys(E),S=Object.keys(ce);if(re.length!==S.length)return!1;for(var F=Object.prototype.hasOwnProperty.bind(ce),U=0;U<re.length;U++){var $=re[U];if(!F($))return!1;var M=E[$],O=ce[$];if(C=V?V.call(H,M,O,$):void 0,C===!1||C===void 0&&M!==O)return!1}return!0}},H38U:function(vt,Qe,y){var E=y("f4xo"),ce=y("rcnY"),V=y("wU8J"),H=y("Iq15"),C=y("dWSS");function re(F,U){this.typeNumber=F,this.errorCorrectLevel=U,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var S=re.prototype;S.addData=function(F){var U=new E(F);this.dataList.push(U),this.dataCache=null},S.isDark=function(F,U){if(F<0||this.moduleCount<=F||U<0||this.moduleCount<=U)throw new Error(F+","+U);return this.modules[F][U]},S.getModuleCount=function(){return this.moduleCount},S.make=function(){if(this.typeNumber<1){var F=1;for(F=1;F<40;F++){for(var U=ce.getRSBlocks(F,this.errorCorrectLevel),$=new V,M=0,O=0;O<U.length;O++)M+=U[O].dataCount;for(var O=0;O<this.dataList.length;O++){var te=this.dataList[O];$.put(te.mode,4),$.put(te.getLength(),H.getLengthInBits(te.mode,F)),te.write($)}if($.getLengthInBits()<=M*8)break}this.typeNumber=F}this.makeImpl(!1,this.getBestMaskPattern())},S.makeImpl=function(F,U){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var $=0;$<this.moduleCount;$++){this.modules[$]=new Array(this.moduleCount);for(var M=0;M<this.moduleCount;M++)this.modules[$][M]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(F,U),this.typeNumber>=7&&this.setupTypeNumber(F),this.dataCache==null&&(this.dataCache=re.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,U)},S.setupPositionProbePattern=function(F,U){for(var $=-1;$<=7;$++){if(F+$<=-1||this.moduleCount<=F+$)continue;for(var M=-1;M<=7;M++){if(U+M<=-1||this.moduleCount<=U+M)continue;0<=$&&$<=6&&(M==0||M==6)||0<=M&&M<=6&&($==0||$==6)||2<=$&&$<=4&&2<=M&&M<=4?this.modules[F+$][U+M]=!0:this.modules[F+$][U+M]=!1}}},S.getBestMaskPattern=function(){for(var F=0,U=0,$=0;$<8;$++){this.makeImpl(!0,$);var M=H.getLostPoint(this);($==0||F>M)&&(F=M,U=$)}return U},S.createMovieClip=function(F,U,$){var M=F.createEmptyMovieClip(U,$),O=1;this.make();for(var te=0;te<this.modules.length;te++)for(var Q=te*O,K=0;K<this.modules[te].length;K++){var N=K*O,W=this.modules[te][K];W&&(M.beginFill(0,100),M.moveTo(N,Q),M.lineTo(N+O,Q),M.lineTo(N+O,Q+O),M.lineTo(N,Q+O),M.endFill())}return M},S.setupTimingPattern=function(){for(var F=8;F<this.moduleCount-8;F++){if(this.modules[F][6]!=null)continue;this.modules[F][6]=F%2==0}for(var U=8;U<this.moduleCount-8;U++){if(this.modules[6][U]!=null)continue;this.modules[6][U]=U%2==0}},S.setupPositionAdjustPattern=function(){for(var F=H.getPatternPosition(this.typeNumber),U=0;U<F.length;U++)for(var $=0;$<F.length;$++){var M=F[U],O=F[$];if(this.modules[M][O]!=null)continue;for(var te=-2;te<=2;te++)for(var Q=-2;Q<=2;Q++)te==-2||te==2||Q==-2||Q==2||te==0&&Q==0?this.modules[M+te][O+Q]=!0:this.modules[M+te][O+Q]=!1}},S.setupTypeNumber=function(F){for(var U=H.getBCHTypeNumber(this.typeNumber),$=0;$<18;$++){var M=!F&&(U>>$&1)==1;this.modules[Math.floor($/3)][$%3+this.moduleCount-8-3]=M}for(var $=0;$<18;$++){var M=!F&&(U>>$&1)==1;this.modules[$%3+this.moduleCount-8-3][Math.floor($/3)]=M}},S.setupTypeInfo=function(F,U){for(var $=this.errorCorrectLevel<<3|U,M=H.getBCHTypeInfo($),O=0;O<15;O++){var te=!F&&(M>>O&1)==1;O<6?this.modules[O][8]=te:O<8?this.modules[O+1][8]=te:this.modules[this.moduleCount-15+O][8]=te}for(var O=0;O<15;O++){var te=!F&&(M>>O&1)==1;O<8?this.modules[8][this.moduleCount-O-1]=te:O<9?this.modules[8][15-O-1+1]=te:this.modules[8][15-O-1]=te}this.modules[this.moduleCount-8][8]=!F},S.mapData=function(F,U){for(var $=-1,M=this.moduleCount-1,O=7,te=0,Q=this.moduleCount-1;Q>0;Q-=2)for(Q==6&&Q--;;){for(var K=0;K<2;K++)if(this.modules[M][Q-K]==null){var N=!1;te<F.length&&(N=(F[te]>>>O&1)==1);var W=H.getMask(U,M,Q-K);W&&(N=!N),this.modules[M][Q-K]=N,O--,O==-1&&(te++,O=7)}if(M+=$,M<0||this.moduleCount<=M){M-=$,$=-$;break}}},re.PAD0=236,re.PAD1=17,re.createData=function(F,U,$){for(var M=ce.getRSBlocks(F,U),O=new V,te=0;te<$.length;te++){var Q=$[te];O.put(Q.mode,4),O.put(Q.getLength(),H.getLengthInBits(Q.mode,F)),Q.write(O)}for(var K=0,te=0;te<M.length;te++)K+=M[te].dataCount;if(O.getLengthInBits()>K*8)throw new Error("code length overflow. ("+O.getLengthInBits()+">"+K*8+")");for(O.getLengthInBits()+4<=K*8&&O.put(0,4);O.getLengthInBits()%8!=0;)O.putBit(!1);for(;!(O.getLengthInBits()>=K*8);){if(O.put(re.PAD0,8),O.getLengthInBits()>=K*8)break;O.put(re.PAD1,8)}return re.createBytes(O,M)},re.createBytes=function(F,U){for(var $=0,M=0,O=0,te=new Array(U.length),Q=new Array(U.length),K=0;K<U.length;K++){var N=U[K].dataCount,W=U[K].totalCount-N;M=Math.max(M,N),O=Math.max(O,W),te[K]=new Array(N);for(var ee=0;ee<te[K].length;ee++)te[K][ee]=255&F.buffer[ee+$];$+=N;var fe=H.getErrorCorrectPolynomial(W),Re=new C(te[K],fe.getLength()-1),Ke=Re.mod(fe);Q[K]=new Array(fe.getLength()-1);for(var ee=0;ee<Q[K].length;ee++){var _e=ee+Ke.getLength()-Q[K].length;Q[K][ee]=_e>=0?Ke.get(_e):0}}for(var ye=0,ee=0;ee<U.length;ee++)ye+=U[ee].totalCount;for(var Ae=new Array(ye),Ce=0,ee=0;ee<M;ee++)for(var K=0;K<U.length;K++)ee<te[K].length&&(Ae[Ce++]=te[K][ee]);for(var ee=0;ee<O;ee++)for(var K=0;K<U.length;K++)ee<Q[K].length&&(Ae[Ce++]=Q[K][ee]);return Ae},vt.exports=re},HmJG:function(vt,Qe,y){},I8Z2:function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return H}),y.d(Qe,"b",function(){return te}),y.d(Qe,"c",function(){return K});var E=y("q1tI"),ce=function(){var N=function(W,ee){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(fe,Re){fe.__proto__=Re}||function(fe,Re){for(var Ke in Re)Re.hasOwnProperty(Ke)&&(fe[Ke]=Re[Ke])},N(W,ee)};return function(W,ee){N(W,ee);function fe(){this.constructor=W}W.prototype=ee===null?Object.create(ee):(fe.prototype=ee.prototype,new fe)}}(),V=E.createContext(null),H=function(N){ce(W,N);function W(){return N!==null&&N.apply(this,arguments)||this}return W.prototype.render=function(){return E.createElement(V.Provider,{value:this.props.store},this.props.children)},W}(E.Component),C=y("Gytx"),re=y.n(C),S=y("2mql"),F=y.n(S),U=function(){var N=function(W,ee){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(fe,Re){fe.__proto__=Re}||function(fe,Re){for(var Ke in Re)Re.hasOwnProperty(Ke)&&(fe[Ke]=Re[Ke])},N(W,ee)};return function(W,ee){N(W,ee);function fe(){this.constructor=W}W.prototype=ee===null?Object.create(ee):(fe.prototype=ee.prototype,new fe)}}(),$=function(){return $=Object.assign||function(N){for(var W,ee=1,fe=arguments.length;ee<fe;ee++){W=arguments[ee];for(var Re in W)Object.prototype.hasOwnProperty.call(W,Re)&&(N[Re]=W[Re])}return N},$.apply(this,arguments)};function M(N){return N.displayName||N.name||"Component"}var O=function(){return{}};function te(N,W){W===void 0&&(W={});var ee=!!N,fe=N||O;return function(Ke){var _e=function(Ae){U(Ce,Ae);function Ce(Ee,Fe){var me=Ae.call(this,Ee,Fe)||this;return me.unsubscribe=null,me.handleChange=function(){if(!me.unsubscribe)return;var L=fe(me.store.getState(),me.props);me.setState({subscribed:L})},me.store=me.context,me.state={subscribed:fe(me.store.getState(),Ee),store:me.store,props:Ee},me}return Ce.getDerivedStateFromProps=function(Ee,Fe){return N&&N.length===2&&Ee!==Fe.props?{subscribed:fe(Fe.store.getState(),Ee),props:Ee}:{props:Ee}},Ce.prototype.componentDidMount=function(){this.trySubscribe()},Ce.prototype.componentWillUnmount=function(){this.tryUnsubscribe()},Ce.prototype.shouldComponentUpdate=function(Ee,Fe){return!re()(this.props,Ee)||!re()(this.state.subscribed,Fe.subscribed)},Ce.prototype.trySubscribe=function(){ee&&(this.unsubscribe=this.store.subscribe(this.handleChange),this.handleChange())},Ce.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},Ce.prototype.render=function(){var Ee=$($($({},this.props),this.state.subscribed),{store:this.store});return E.createElement(Ke,$({},Ee,{ref:this.props.miniStoreForwardedRef}))},Ce.displayName="Connect("+M(Ke)+")",Ce.contextType=V,Ce}(E.Component);if(W.forwardRef){var ye=E.forwardRef(function(Ae,Ce){return E.createElement(_e,$({},Ae,{miniStoreForwardedRef:Ce}))});return F()(ye,Ke)}return F()(_e,Ke)}}var Q=function(){return Q=Object.assign||function(N){for(var W,ee=1,fe=arguments.length;ee<fe;ee++){W=arguments[ee];for(var Re in W)Object.prototype.hasOwnProperty.call(W,Re)&&(N[Re]=W[Re])}return N},Q.apply(this,arguments)};function K(N){var W=N,ee=[];function fe(_e){W=Q(Q({},W),_e);for(var ye=0;ye<ee.length;ye++)ee[ye]()}function Re(){return W}function Ke(_e){return ee.push(_e),function(){var Ae=ee.indexOf(_e);ee.splice(Ae,1)}}return{setState:fe,getState:Re,subscribe:Ke}}},Iq15:function(vt,Qe,y){var E=y("nVVt"),ce=y("dWSS"),V=y("dQei"),H={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},C={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(re){for(var S=re<<10;C.getBCHDigit(S)-C.getBCHDigit(C.G15)>=0;)S^=C.G15<<C.getBCHDigit(S)-C.getBCHDigit(C.G15);return(re<<10|S)^C.G15_MASK},getBCHTypeNumber:function(re){for(var S=re<<12;C.getBCHDigit(S)-C.getBCHDigit(C.G18)>=0;)S^=C.G18<<C.getBCHDigit(S)-C.getBCHDigit(C.G18);return re<<12|S},getBCHDigit:function(re){for(var S=0;re!=0;)S++,re>>>=1;return S},getPatternPosition:function(re){return C.PATTERN_POSITION_TABLE[re-1]},getMask:function(re,S,F){switch(re){case H.PATTERN000:return(S+F)%2==0;case H.PATTERN001:return S%2==0;case H.PATTERN010:return F%3==0;case H.PATTERN011:return(S+F)%3==0;case H.PATTERN100:return(Math.floor(S/2)+Math.floor(F/3))%2==0;case H.PATTERN101:return S*F%2+S*F%3==0;case H.PATTERN110:return(S*F%2+S*F%3)%2==0;case H.PATTERN111:return(S*F%3+(S+F)%2)%2==0;default:throw new Error("bad maskPattern:"+re)}},getErrorCorrectPolynomial:function(re){for(var S=new ce([1],0),F=0;F<re;F++)S=S.multiply(new ce([1,V.gexp(F)],0));return S},getLengthInBits:function(re,S){if(1<=S&&S<10)switch(re){case E.MODE_NUMBER:return 10;case E.MODE_ALPHA_NUM:return 9;case E.MODE_8BIT_BYTE:return 8;case E.MODE_KANJI:return 8;default:throw new Error("mode:"+re)}else if(S<27)switch(re){case E.MODE_NUMBER:return 12;case E.MODE_ALPHA_NUM:return 11;case E.MODE_8BIT_BYTE:return 16;case E.MODE_KANJI:return 10;default:throw new Error("mode:"+re)}else if(S<41)switch(re){case E.MODE_NUMBER:return 14;case E.MODE_ALPHA_NUM:return 13;case E.MODE_8BIT_BYTE:return 16;case E.MODE_KANJI:return 12;default:throw new Error("mode:"+re)}else throw new Error("type:"+S)},getLostPoint:function(re){for(var S=re.getModuleCount(),F=0,U=0;U<S;U++)for(var $=0;$<S;$++){for(var M=0,O=re.isDark(U,$),te=-1;te<=1;te++){if(U+te<0||S<=U+te)continue;for(var Q=-1;Q<=1;Q++){if($+Q<0||S<=$+Q)continue;if(te==0&&Q==0)continue;O==re.isDark(U+te,$+Q)&&M++}}M>5&&(F+=3+M-5)}for(var U=0;U<S-1;U++)for(var $=0;$<S-1;$++){var K=0;re.isDark(U,$)&&K++,re.isDark(U+1,$)&&K++,re.isDark(U,$+1)&&K++,re.isDark(U+1,$+1)&&K++,(K==0||K==4)&&(F+=3)}for(var U=0;U<S;U++)for(var $=0;$<S-6;$++)re.isDark(U,$)&&!re.isDark(U,$+1)&&re.isDark(U,$+2)&&re.isDark(U,$+3)&&re.isDark(U,$+4)&&!re.isDark(U,$+5)&&re.isDark(U,$+6)&&(F+=40);for(var $=0;$<S;$++)for(var U=0;U<S-6;U++)re.isDark(U,$)&&!re.isDark(U+1,$)&&re.isDark(U+2,$)&&re.isDark(U+3,$)&&re.isDark(U+4,$)&&!re.isDark(U+5,$)&&re.isDark(U+6,$)&&(F+=40);for(var N=0,$=0;$<S;$++)for(var U=0;U<S;U++)re.isDark(U,$)&&N++;var W=Math.abs(100*N/S/S-50)/5;return F+=W*10,F}};vt.exports=C},LdHM:function(vt,Qe,y){"use strict";y.d(Qe,"b",function(){return Re}),y.d(Qe,"a",function(){return _e});var E=y("1OyB"),ce=y("vuIU"),V=y("Ji7U"),H=y("LK+K"),C=y("q1tI"),re=y("rePB"),S=y("Ff2n"),F=y("ODXe"),U=y("4IlW"),$=y("bX4T"),M=y("YrtM"),O=y("TSYQ"),te=y.n(O),Q=y("+nKL"),K=y("8OUc"),N=function(de,Ie){var De=de.prefixCls,rt=de.id,ot=de.flattenOptions,He=de.childrenAsData,Ue=de.values,Pe=de.searchValue,Be=de.multiple,ue=de.defaultActiveFirstOption,D=de.height,Ze=de.itemHeight,mt=de.notFoundContent,Ct=de.open,ut=de.menuItemSelectedIcon,st=de.virtual,he=de.onSelect,Me=de.onToggleOpen,Oe=de.onActiveValue,Se=de.onScroll,tt=de.onMouseEnter,Ye="".concat(De,"-item"),lt=Object(M.a)(function(){return ot},[Ct,ot],function(et,ae){return ae[0]&&et[1]!==ae[1]}),Nt=C.useRef(null),_t=function(ae){ae.preventDefault()},xt=function(ae){Nt.current&&Nt.current.scrollTo({index:ae})},dt=function(ae){for(var Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ne=lt.length,x=0;x<ne;x+=1){var w=(ae+x*Z+ne)%ne,A=lt[w],P=A.group,be=A.data;if(!P&&!be.disabled)return w}return-1},Lt=C.useState(function(){return dt(0)}),wt=Object(F.a)(Lt,2),gt=wt[0],Ne=wt[1],Dt=function(ae){Ne(ae);var Z=lt[ae];if(!Z){Oe(null,-1);return}Oe(Z.data.value,ae)};C.useEffect(function(){Dt(ue!==!1?dt(0):-1)},[lt.length,Pe]),C.useEffect(function(){var et=setTimeout(function(){if(!Be&&Ct&&Ue.size===1){var ae=Array.from(Ue)[0],Z=lt.findIndex(function(ne){var x=ne.data;return x.value===ae});Dt(Z),xt(Z)}});return function(){return clearTimeout(et)}},[Ct]);var yt=function(ae){ae!==void 0&&he(ae,{selected:!Ue.has(ae)}),Be||Me(!1)};if(C.useImperativeHandle(Ie,function(){return{onKeyDown:function(ae){var Z=ae.which;switch(Z){case U.a.UP:case U.a.DOWN:{var ne=0;if(Z===U.a.UP?ne=-1:Z===U.a.DOWN&&(ne=1),ne!==0){var x=dt(gt+ne,ne);xt(x),Dt(x)}break}case U.a.ENTER:{var w=lt[gt];w&&!w.data.disabled?yt(w.data.value):yt(void 0),Ct&&ae.preventDefault();break}case U.a.ESC:Me(!1)}},onKeyUp:function(){},scrollTo:function(ae){xt(ae)}}}),lt.length===0)return C.createElement("div",{role:"listbox",id:"".concat(rt,"_list"),className:"".concat(Ye,"-empty"),onMouseDown:_t},mt);function We(et){var ae=lt[et];if(!ae)return null;var Z=ae.data||{},ne=Z.value,x=Z.label,w=Z.children,A=Object($.a)(Z,!0),P=He?w:x;return ae?C.createElement("div",Object.assign({"aria-label":typeof P=="string"?P:null},A,{key:et,role:"option",id:"".concat(rt,"_list_").concat(et),"aria-selected":Ue.has(ne)}),ne):null}return C.createElement(C.Fragment,null,C.createElement("div",{role:"listbox",id:"".concat(rt,"_list"),style:{height:0,width:0,overflow:"hidden"}},We(gt-1),We(gt),We(gt+1)),C.createElement(Q.a,{itemKey:"key",ref:Nt,data:lt,height:D,itemHeight:Ze,fullHeight:!1,onMouseDown:_t,onScroll:Se,virtual:st,onMouseEnter:tt},function(et,ae){var Z,ne=et.group,x=et.groupOption,w=et.data,A=w.label,P=w.key;if(ne)return C.createElement("div",{className:te()(Ye,"".concat(Ye,"-group"))},A!==void 0?A:P);var be=w.disabled,Te=w.value,Xe=w.title,Et=w.children,Gt=w.style,Ve=w.className,Pt=Object(S.a)(w,["disabled","value","title","children","style","className"]),St=Ue.has(Te),ht="".concat(Ye,"-option"),on=te()(Ye,ht,Ve,(Z={},Object(re.a)(Z,"".concat(ht,"-grouped"),x),Object(re.a)(Z,"".concat(ht,"-active"),gt===ae&&!be),Object(re.a)(Z,"".concat(ht,"-disabled"),be),Object(re.a)(Z,"".concat(ht,"-selected"),St),Z)),Zt=He?Et:A,En=!ut||typeof ut=="function"||St;return C.createElement("div",Object.assign({},Pt,{"aria-selected":St,className:on,title:Xe,onMouseMove:function(){if(gt===ae||be)return;Dt(ae)},onClick:function(){be||yt(Te)},style:Gt}),C.createElement("div",{className:"".concat(ht,"-content")},Zt||Te),C.isValidElement(ut)||St,En&&C.createElement(K.a,{className:"".concat(Ye,"-option-state"),customizeIcon:ut,customizeIconProps:{isSelected:St}},St?"\u2713":null))}))},W=C.forwardRef(N);W.displayName="OptionList";var ee=W,fe=function(){return null};fe.isSelectOption=!0;var Re=fe,Ke=function(){return null};Ke.isSelectOptGroup=!0;var _e=Ke,ye=y("VTBJ"),Ae=y("Zm9Q");function Ce(g){var de=g.key,Ie=g.props,De=Ie.children,rt=Ie.value,ot=Object(S.a)(Ie,["children","value"]);return Object(ye.a)({key:de,value:rt!==void 0?rt:de,children:De},ot)}function Ee(g){var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(Ae.a)(g).map(function(Ie,De){if(!C.isValidElement(Ie)||!Ie.type)return null;var rt=Ie.type.isSelectOptGroup,ot=Ie.key,He=Ie.props,Ue=He.children,Pe=Object(S.a)(He,["children"]);return de||!rt?Ce(Ie):Object(ye.a)(Object(ye.a)({key:"__RC_SELECT_GRP__".concat(ot===null?De:ot,"__"),label:ot},Pe),{},{options:Ee(Ue)})}).filter(function(Ie){return Ie})}var Fe=y("2Qr1"),me=y("qNPg"),L=y("U8pU"),ke=y("Kwbf"),ve=y("WKfj");function k(g){var de=g.mode,Ie=g.options,De=g.children,rt=g.backfill,ot=g.allowClear,He=g.placeholder,Ue=g.getInputElement,Pe=g.showSearch,Be=g.onSearch,ue=g.defaultOpen,D=g.autoFocus,Ze=g.labelInValue,mt=g.value,Ct=g.inputValue,ut=g.optionLabelProp,st=de==="multiple"||de==="tags",he=Pe!==void 0?Pe:st||de==="combobox",Me=Ie||Ee(De);if(Object(ke.a)(de!=="tags"||Me.every(function(Ye){return!Ye.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),de==="tags"||de==="combobox"){var Oe=Me.some(function(Ye){return Ye.options?Ye.options.some(function(lt){return typeof("value"in lt?lt.value:lt.key)=="number"}):typeof("value"in Ye?Ye.value:Ye.key)=="number"});Object(ke.a)(!Oe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(ke.a)(de!=="combobox"||!ut,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(ke.a)(de==="combobox"||!rt,"`backfill` only works with `combobox` mode."),Object(ke.a)(de==="combobox"||!Ue,"`getInputElement` only work with `combobox` mode."),Object(ke.b)(de!=="combobox"||!Ue||!ot||!He,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Be&&!he&&de!=="combobox"&&de!=="tags"&&Object(ke.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(ke.b)(!ue||D,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),mt!=null){var Se=Object(ve.d)(mt);Object(ke.a)(!Ze||Se.every(function(Ye){return Object(L.a)(Ye)==="object"&&("key"in Ye||"value"in Ye)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(ke.a)(!st||Array.isArray(mt),"`value` should be array when `mode` is `multiple` or `tags`")}if(De){var tt=null;Object(Ae.a)(De).some(function(Ye){if(!C.isValidElement(Ye)||!Ye.type)return!1;var lt=Ye.type;if(lt.isSelectOption)return!1;if(lt.isSelectOptGroup){var Nt=Object(Ae.a)(Ye.props.children).every(function(_t){return!C.isValidElement(_t)||!Ye.type||_t.type.isSelectOption?!0:(tt=_t.type,!1)});return!Nt}return tt=lt,!0}),tt&&Object(ke.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(tt.displayName||tt.name||tt,"`.")),Object(ke.a)(Ct===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var G=k,le=Object(me.a)({prefixCls:"rc-select",components:{optionList:ee},convertChildrenToData:Ee,flattenOptions:Fe.d,getLabeledValue:Fe.e,filterOptions:Fe.b,isValueDisabled:Fe.g,findValueOption:Fe.c,warningProps:G,fillOptionsWithMissingValue:Fe.a}),X=function(g){Object(V.a)(Ie,g);var de=Object(H.a)(Ie);function Ie(){var De;return Object(E.a)(this,Ie),De=de.apply(this,arguments),De.selectRef=C.createRef(),De.focus=function(){De.selectRef.current.focus()},De.blur=function(){De.selectRef.current.blur()},De}return Object(ce.a)(Ie,[{key:"render",value:function(){return C.createElement(le,Object.assign({ref:this.selectRef},this.props))}}]),Ie}(C.Component);X.Option=Re,X.OptGroup=_e;var Le=X,T=Qe.c=Le},M8RZ:function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return U});var E=y("fWQN"),ce=y("mtLc"),V=y("yKVA"),H=y("879j"),C=y("q1tI"),re=y.n(C),S=y("i8i4"),F=y.n(S),U=function($){Object(V.a)(O,$);var M=Object(H.a)(O);function O(te){var Q;Object(E.a)(this,O),Q=M.call(this,te);var K=window.document;return Q.node=K.createElement("div"),K.body.appendChild(Q.node),Q}return Object(ce.a)(O,[{key:"render",value:function(){var Q=this.props.children;return Object(S.createPortal)(Q,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),O}(re.a.Component)},OLES:function(vt,Qe,y){"use strict";var E=y("U8pU"),ce=y("VTBJ"),V=y("Ff2n"),H=y("q1tI"),C=y("uciX"),re=y("7ixt"),S=function(te){var Q=te.overlay,K=te.prefixCls,N=te.id,W=te.overlayInnerStyle;return H.createElement("div",{className:"".concat(K,"-inner"),id:N,role:"tooltip",style:W},typeof Q=="function"?Q():Q)},F=S,U=function(te,Q){var K=te.overlayClassName,N=te.trigger,W=N===void 0?["hover"]:N,ee=te.mouseEnterDelay,fe=ee===void 0?0:ee,Re=te.mouseLeaveDelay,Ke=Re===void 0?.1:Re,_e=te.overlayStyle,ye=te.prefixCls,Ae=ye===void 0?"rc-tooltip":ye,Ce=te.children,Ee=te.onVisibleChange,Fe=te.afterVisibleChange,me=te.transitionName,L=te.animation,ke=te.placement,ve=ke===void 0?"right":ke,k=te.align,G=k===void 0?{}:k,le=te.destroyTooltipOnHide,X=le===void 0?!1:le,Le=te.defaultVisible,T=te.getTooltipContainer,g=te.overlayInnerStyle,de=Object(V.a)(te,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Ie=Object(H.useRef)(null);Object(H.useImperativeHandle)(Q,function(){return Ie.current});var De=Object(ce.a)({},de);"visible"in te&&(De.popupVisible=te.visible);var rt=function(){var Be=te.arrowContent,ue=Be===void 0?null:Be,D=te.overlay,Ze=te.id;return[H.createElement("div",{className:"".concat(Ae,"-arrow"),key:"arrow"},ue),H.createElement(F,{key:"content",prefixCls:Ae,id:Ze,overlay:D,overlayInnerStyle:g})]},ot=!1,He=!1;if(typeof X=="boolean")ot=X;else if(X&&Object(E.a)(X)==="object"){var Ue=X.keepParent;ot=Ue===!0,He=Ue===!1}return H.createElement(C.a,Object.assign({popupClassName:K,prefixCls:Ae,popup:rt,action:W,builtinPlacements:re.a,popupPlacement:ve,ref:Ie,popupAlign:G,getPopupContainer:T,onPopupVisibleChange:Ee,afterPopupVisibleChange:Fe,popupTransitionName:me,popupAnimation:L,defaultPopupVisible:Le,destroyPopupOnHide:ot,autoDestroy:He,mouseLeaveDelay:Ke,popupStyle:_e,mouseEnterDelay:fe},De),Ce)},$=Object(H.forwardRef)(U),M=Qe.a=$},Ot1p:function(vt,Qe,y){"use strict";var E=y("2qtc"),ce=y("kLXV"),V=y("rAM+"),H=y("miYZ"),C=y("tsqr"),re=y("9og8"),S=y("tJVT"),F=y("jrin"),U=y("WmNS"),$=y.n(U),M=y("q1tI"),O=y.n(M),te=y("VrN/"),Q=y.n(te),K=y("bdgK"),N=y("p77/"),W=y("Bd2K"),ee=y("ELLl"),fe=y("19Vz"),Re=y("lZu9"),Ke=y("+NIl"),_e=y("kSUc"),ye=y("9Bee"),Ae=function(Ve){var Pt=Ve.value,St=Pt===void 0?"":Pt,ht=Ve.className,on=Ve.showTextOnly,Zt=Ve.showLines,En=Ve.style,vn=En===void 0?{}:En,Ft=Object(M.useMemo)(function(){return""},[St]);return O.a.createElement(O.a.Fragment,null,O.a.createElement("div",{dangerouslySetInnerHTML:{__html:Ft}}))},Ce=y("Q9mQ"),Ee=y("diRs"),Fe=y("0Owb"),me=y("dejd"),L=y("C+DQ"),ke=y("D1Df"),ve=y.n(ke),k=y("1vsH"),G=y("m3rI"),le=[{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 X(Ve){var Pt=Ve.onActionCallback,St=Ve.title,ht=Ve.icon,on=Ve.actionName,Zt=Ve.className,En=Zt===void 0?"":Zt,vn=Ve.children;function Ft(){Pt(on)}return O.a.createElement("a",{title:St,className:En,onClick:Ft},O.a.createElement("i",{className:"md-iconfont ".concat(ht)}),vn)}var Le=function(Ve){var Pt=Ve.watch,St=Ve.showNullButton,ht=Ve.onActionCallback,on=Ve.fullScreen,Zt=Ve.insertTemp,En=Ve.hidetoolBar,vn=Ve.uuid,Ft=Ve.setOpenPhones,zn=Object(k.E)("_educoder_session_login"),Bn=Object(k.E)("_educoder_session"),At=[].concat(le,[{title:"".concat(Pt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Pt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return O.a.createElement("ul",{className:"markdown-toolbar-container"},!En&&At.map(function(hi,oi){return O.a.createElement("li",{key:oi},hi.actionName?O.a.createElement(X,Object(Fe.a)({},hi,{onActionCallback:ht})):O.a.createElement("span",{className:"v-line"}))}),St?O.a.createElement("li",null,O.a.createElement(X,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ht},O.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Zt&&O.a.createElement("li",null,O.a.createElement(X,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Zt),onActionCallback:ht},O.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),O.a.createElement("li",null,O.a.createElement(Ee.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:O.a.createElement("div",null,O.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+zn+"&_educoder_session="+Bn+"&key="+vn+"&api="+encodeURIComponent(G.a.API_SERVER)),O.a.createElement(ve.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+zn+"&_educoder_session="+Bn+"&key="+vn+"&api="+encodeURIComponent(G.a.API_SERVER)}))},O.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return Ft(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),O.a.createElement("li",{className:"btn-full-screen"},O.a.createElement(X,{icon:"".concat(on?"icon-shrink":"icon-enlarge"),title:on?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ht})))},T=y("M8RZ"),g=y("+L6B"),de=y("2/Rp"),Ie=y("y8nQ"),De=y("Vl3Y"),rt=y("5NDa"),ot=y("5rEg"),He={labelCol:{span:4},wrapperCol:{span:20}},Ue=function(Ve){var Pt=Ve.callback,St=Ve.onCancel;function ht(on){Pt(on)}return O.a.createElement(De.a,Object(Fe.a)({},He,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ht}),O.a.createElement(De.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},O.a.createElement(ot.a,null)),O.a.createElement(De.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},O.a.createElement(ot.a,null)),O.a.createElement("div",{className:"flex-container flex-end"},O.a.createElement(de.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(de.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))},Pe=y("7ahc"),Be=y("k1fw"),ue=y("HmJG"),D=y("BjJ7"),Ze=De.a.useForm,mt={width:280,marginRight:10},Ct={labelCol:{span:5},wrapperCol:{span:19}},ut=function(Ve){var Pt=Ve.callback,St=Ve.onCancel,ht=Ze(),on=Object(S.a)(ht,1),Zt=on[0],En=Object(M.useRef)();function vn(Bn){Pt(Object(Be.a)(Object(Be.a)({},Bn),{},{name:En.current}))}function Ft(Bn,At){Zt.setFieldsValue({src:"/api/attachments/".concat(Bn.id,"?type=").concat(Bn.content_type),type:At.type})}function zn(Bn){var At=Bn.target.files[0];En.current=At.name,he(At,Ft)}return O.a.createElement(De.a,Object(Fe.a)({form:Zt},Ct,{className:"upload-image-panel",onFinish:vn}),O.a.createElement(De.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},O.a.createElement("div",{className:"flex-container"},O.a.createElement(De.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},O.a.createElement(ot.a,{style:mt})),O.a.createElement(st,{onFileChange:zn}))),O.a.createElement(De.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},O.a.createElement(ot.a,{style:{width:264}})),O.a.createElement(De.a.Item,{style:{textAlign:"right"}},O.a.createElement(de.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(de.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))};function st(Ve){var Pt=Ve.onFileChange;return O.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",O.a.createElement("input",{type:"file",onChange:Pt}))}function he(Ve,Pt){if(!Ve)throw new String("\u6CA1\u6709\u6587\u4EF6");var St=new FormData;St.append("editormd-image-file",Ve),St.append("file_param_name","editormd-image-file"),St.append("byxhr","true");var ht=new window.XMLHttpRequest;ht.withCredentials=!0,ht.addEventListener("load",function(on){Pt(JSON.parse(on.target.responseText),Ve)},!1),ht.addEventListener("error",function(on){console.error(on)},!1),ht.open("POST","".concat(D.a,"/api/attachments.json")),ht.send(St)}var Me=y("giR+"),Oe=y("fyUT"),Se=y("7Kak"),tt=y("9yH6"),Ye=tt.a.Group,lt={margin:"0 8px"},Nt=function(Ve){var Pt=Ve.callback,St=Ve.onCancel;function ht(on){Pt(on)}return O.a.createElement(De.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ht},O.a.createElement("div",{className:"flex-container"},O.a.createElement("span",{style:lt},"\u5355\u5143\u683C\u6570\uFF1A"),O.a.createElement("span",{style:lt},"\u884C\u6570"),O.a.createElement(De.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},O.a.createElement(Oe.a,null)),O.a.createElement("span",{style:lt},"\u5217\u6570"),O.a.createElement(De.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},O.a.createElement(Oe.a,null))),O.a.createElement("div",{className:"flex-container",style:{marginTop:12}},O.a.createElement("span",{style:lt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),O.a.createElement(De.a.Item,{name:"align"},O.a.createElement(Ye,null,O.a.createElement(tt.a,{value:"default"},O.a.createElement("i",{className:"fa fa-align-justify"})),O.a.createElement(tt.a,{value:"left"},O.a.createElement("i",{className:"fa fa-align-left"})),O.a.createElement(tt.a,{value:"center"},O.a.createElement("i",{className:"fa fa-align-center"})),O.a.createElement(tt.a,{value:"right"},O.a.createElement("i",{className:"fa fa-align-right"}))))),O.a.createElement("div",{className:"flex-container flex-end"},O.a.createElement(de.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(de.a,{type:"ghost",onClick:St},"\u53D6\u6D88")))},_t=y("ErOA"),xt=y("7Cbv"),dt="link",Lt="upload-image",wt="code-block",gt="add-table",Ne="------------",Dt={default:Ne,left:":".concat(Ne),center:":".concat(Ne,":"),right:"".concat(Ne,":")},yt=y("9VGf"),We,et;function ae(){}var Z=0,ne=1e4,x="\u2581",w=`
|
|
**\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 A(Ve){return/^\d+$/.test(Ve)?"".concat(Ve,"px"):Ve}var P=navigator.platform.toUpperCase().indexOf("MAC")>=0,be=P?"Cmd":"Ctrl",Te=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Xe=(We={},Object(F.a)(We,be+"-B","bold"),Object(F.a)(We,be+"-I","italic"),We),Et=(et={},Object(F.a)(et,dt,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(et,wt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(et,Lt,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(et,gt,"\u6DFB\u52A0\u8868\u683C"),et),Gt=Qe.a=function(Ve){var Pt=Ve.defaultValue,St=Pt===void 0?"":Pt,ht=Ve.onChange,on=Ve.width,Zt=on===void 0?"100%":on,En=Ve.height,vn=En===void 0?400:En,Ft=Ve.miniToolbar,zn=Ft===void 0?!1:Ft,Bn=Ve.isFocus,At=Bn===void 0?!1:Bn,hi=Ve.watch,oi=Ve.insertTemp,ai=Ve.mode,Si=ai===void 0?"markdown":ai,or=Ve.id,Bi=or===void 0?"markdown-editor-id":or,pn=Ve.showResizeBar,Mt=pn===void 0?!1:pn,Fi=Ve.noStorage,hr=Fi===void 0?!1:Fi,ki=Ve.showNullButton,ln=ki===void 0?!1:ki,Yi=Ve.hidetoolBar,fr=Yi===void 0?!1:Yi,pr=Ve.fullScreen,qe=pr===void 0?!1:pr,Ht=Ve.onBlur,Ji=Ve.onCMBeforeChange,ar=Ve.onFullScreen,mr=Ve.className,gr=mr===void 0?"":mr,d=Ve.disablePaste,o=d===void 0?!1:d,a=Ve.placeholder,u=a===void 0?"":a,p=Ve.values,c=p===void 0?"":p,J=Object(M.useState)(null),Ge=Object(S.a)(J,2),we=Ge[0],Ot=Ge[1],$e=Object(M.useState)(St),Wt=Object(S.a)($e,2),dn=Wt[0],Sn=Wt[1],Ri=Object(M.useState)(hi),Hi=Object(S.a)(Ri,2),ei=Hi[0],Zi=Hi[1],Gr=Object(M.useState)(qe),xi=Object(S.a)(Gr,2),_i=xi[0],sr=xi[1],vr=Object(M.useState)(""),Wi=Object(S.a)(vr,2),lr=Wi[0],zi=Wi[1],so=Object(M.useState)(0),Kr=Object(S.a)(so,2),Li=Kr[0],Jn=Kr[1],_r=Object(M.useState)(vn),Ir=Object(S.a)(_r,2),Xr=Ir[0],Vn=Ir[1],bn=Object(M.useState)(!1),$n=Object(S.a)(bn,2),yn=$n[0],si=$n[1],Rn=Object(M.useRef)(Object(xt.a)()),yr=Object(M.useRef)(!1),ti=Object(M.useRef)(),Zn=Object(M.useRef)(),ur=Object(M.useRef)(),Or=Object(M.useRef)(),qi=Object(M.useRef)(),br=function(){var Tt=Object(re.a)($.a.mark(function Kt(){var jt,an;return $.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(_t.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Rn.current}});case 2:an=kn.sent,an!=null&&(jt=an.attachments)!==null&&jt!==void 0&&jt.length&&(console.log("cm:",we,Zn),an.attachments.map(function(un){un.content_type.indexOf("image")>-1?we.replaceSelection(".concat(un.content_type,")")):un.content_type.indexOf("video")>-1?we.replaceSelection('<video width="100%" controls src="'.concat(G.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):un.content_type.indexOf("pdf")>-1?we.replaceSelection('<a href="'.concat(G.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,'&disposition=inline" target="_blank">').concat(un.name,"</a>")):we.replaceSelection("[".concat(un.name,"](").concat(G.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,")"))}));case 4:case"end":return kn.stop()}},Kt)}));return function(){return Tt.apply(this,arguments)}}();Object(M.useEffect)(function(){Sn(c),we==null||we.setValue(c)},[c]),Object(M.useEffect)(function(){ar==null||ar(_i)},[_i]),Object(M.useEffect)(function(){if(Zn.current){var Tt=Q.a.fromTextArea(Zn.current,{mode:Si,lineNumbers:!zn,lineWrapping:!0,value:St,autoCloseTags:!0,autoCloseBrackets:!0});At&&Tt.focus();function Kt(jt,an){if(o){an.preventDefault();return}var mn=an.clipboardData;if(mn){var kn=mn.types.toString(),un=mn.items;if(kn==="Files"||mn.types.indexOf("Files")>-1){if(an.preventDefault(),Si=="stex")return;try{var Un,li=un[1];((Un=un[0])===null||Un===void 0?void 0:Un.kind)==="file"&&(li=un[0]);var tn=li.getAsFile(),Cr=tn.name.split(".").pop();he(tn,function(On){if(On.id){var ui,xn,Vi;(tn==null||((ui=tn.type)===null||ui===void 0)?void 0:ui.indexOf("image"))>-1?Tt.replaceSelection(".concat(On.content_type,")")):(tn==null||((xn=tn.type)===null||xn===void 0)?void 0:xn.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(G.a.API_SERVER,"/api/attachments/").concat(On.id,'"></video>')):(tn==null||((Vi=tn.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(G.a.API_SERVER,"/api/attachments/").concat(On.id,"?type=").concat(tn.type,'&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Te.includes(Cr)?Tt.replaceSelection('<a href="'.concat(G.a.API_SERVER,"/api/attachments/").concat(On.id,'?type=office&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Tt.replaceSelection("[".concat(tn.name,"](").concat(G.a.API_SERVER,"/api/attachments/").concat(On.id,"?type=").concat(On.content_type,")"))}else(On==null?void 0:On.status)===401&&(document.location.href="/user/login")})}catch(On){C.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Tt.on("paste",Kt),Tt.on("dragleave",function(jt,an){ur.current.classList.remove("mouse-hover-md")}),Tt.on("dragover",function(jt,an){ur.current.classList.add("mouse-hover-md")}),Tt.on("drop",function(jt,an){ur.current.classList.add("mouse-hover-md");var mn;if(mn=an.dataTransfer.files,mn.length>0){an.preventDefault(),an.stopPropagation();for(var kn=function(li){var tn=mn[li],Cr=tn.name.split(".").pop();he(tn,function(On){if(On.id){var ui,xn,Vi;(tn==null||((ui=tn.type)===null||ui===void 0)?void 0:ui.indexOf("image"))>-1?Tt.replaceSelection(".concat(On.content_type,")")):(tn==null||((xn=tn.type)===null||xn===void 0)?void 0:xn.indexOf("video"))>-1?Tt.replaceSelection('<video width="100%" controls src="'.concat(G.a.API_SERVER,"/api/attachments/").concat(On.id,'"></video>')):(tn==null||((Vi=tn.type)===null||Vi===void 0)?void 0:Vi.indexOf("pdf"))>-1?Tt.replaceSelection('<a href="'.concat(G.a.API_SERVER,"/api/attachments/").concat(On.id,"?type=").concat(tn.type,'&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Te.includes(Cr)?Tt.replaceSelection('<a href="'.concat(G.a.API_SERVER,"/api/attachments/").concat(On.id,'?type=office&disposition=inline" target="_blank">').concat(tn.name,"</a>")):Tt.replaceSelection("[".concat(tn.name,"](").concat(G.a.API_SERVER,"/api/attachments/").concat(On.id,"?type=").concat(On.content_type,")"))}else(On==null?void 0:On.status)===401&&(document.location.href="/user/login")})},un=0;un<mn.length;un++)kn(un)}}),Ot(Tt),function(){Tt.off("paste",Kt)}}},[]);var Di=Object(M.useCallback)(function(){if(ur.current)try{}catch(Tt){console.log(Tt,"---- to set md editor body height")}},[Xr,ur,_i]);Object(M.useEffect)(function(){function Tt(){var jt=new K.default(function(an){var mn=Object(V.a)(an),kn;try{for(mn.s();!(kn=mn.n()).done;){var un=kn.value;(un.target.offsetHeight>0||un.target.offsetWidth>0)&&(Di(),we.setSize("100%","100%"),we.refresh())}}catch(Un){mn.e(Un)}finally{mn.f()}});return jt.observe(Zn.current.parentElement),jt}if(we){var Kt=Tt();return function(){Kt.unobserve(Zn.current.parentElement)}}},[we,Di]),Object(M.useEffect)(function(){if(we){for(var Tt=[],Kt=function(){var un=an[jt];mn=Object(S.a)(un,2);var Un=mn[0],li=mn[1],tn=Object(F.a)({},Un,function(){$r(li)});Tt.push(tn),we.addKeyMap(tn)},jt=0,an=Object.entries(Xe);jt<an.length;jt++){var mn;Kt()}return ti.current=setInterval(function(){yr.current&&br()},4e3),function(){clearInterval(ti.current);var kn=Object(V.a)(Tt),un;try{for(kn.s();!(un=kn.n()).done;){var Un=un.value;we.removeKeyMap(Un)}}catch(li){kn.e(li)}finally{kn.f()}}}},[we]),Object(M.useEffect)(function(){qe!==_i&&sr(qe)},[qe]),Object(yt.a)(function(){if(!hr&&Li>0){var Tt=new Date().getTime(),Kt=window.sessionStorage.getItem(Bi);Tt>=Li+ne&&(!Kt||Kt!==dn)&&(window.sessionStorage.setItem(Bi,dn),si(!0))}},ne),Object(M.useEffect)(function(){Zi(hi)},[we,hi]),Object(M.useEffect)(function(){we&&(At&&we.focus())},[we,At]),Object(M.useEffect)(function(){if(ei&&we){var Tt=we.getScrollerElement();function Kt(jt){var an=jt.target;if(qi.current){var mn=an.scrollTop/an.scrollHeight;qi.current.scrollTop=qi.current.scrollHeight*mn}}return Tt.addEventListener("scroll",Kt),function(){Tt.removeEventListener("scroll",Kt)}}},[we,ei]),Object(M.useEffect)(function(){if(we&&Ji){function Tt(Kt,jt){Ji(Kt,jt)}return we.on("beforeChange",Tt),function(){we.off("beforeChange",Tt)}}},[we,Ji]),Object(M.useEffect)(function(){if(we&&Ht){function Tt(){Ht(we.getValue())}return we.on("blur",Tt),function(){we.off("blur",Tt)}}},[we,Ht]),Object(M.useEffect)(function(){if(we){function Tt(Kt){var jt=Kt.getValue();Sn(jt),Jn(new Date().getTime()),Kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ht&&ht(jt)}return we.on("change",Tt),function(){we.off("change",Tt)}}},[we,ht]),Object(M.useEffect)(function(){we&&(St==null?(we.setValue(""),Sn("")):St!==we.getValue()&&(we.setValue(St),Sn(St),we.setCursor(we.lineCount(),0)))},[we,St]);var $r=Object(M.useCallback)(function(Tt){var Kt=we.getCursor(),jt=we.getSelection(),an=jt.split(`
|
|
`);switch(Tt){case"bold":return we.replaceSelection("**"+jt+"**"),jt===""&&we.setCursor(Kt.line,Kt.ch+2),we.focus();case"italic":return we.replaceSelection("*"+jt+"*"),jt===""&&we.setCursor(Kt.line,Kt.ch+1),we.focus();case"code":return we.replaceSelection("`"+jt+"`"),jt===""&&we.setCursor(Kt.line,Kt.ch+1),we.focus();case"inline-latex":return we.replaceSelection("`$$"+jt+"$$`"),jt===""&&we.setCursor(Kt.line,Kt.ch+3),we.focus();case"latex":return we.replaceSelection("```latex\n"+jt+"\n```"),we.setCursor(Kt.line+1,jt.length+1),we.focus();case"line-break":return we.replaceSelection(`<br/>
|
|
`),we.focus();case"list-ul":return jt===""?we.replaceSelection("- "+jt):we.replaceSelection(an.map(function(mn){return mn===""?"":"- ".concat(mn)}).join(`
|
|
`)),we.focus();case"list-ol":return jt===""?we.replaceSelection("1. "+jt):we.replaceSelection(an.map(function(mn,kn){return mn===""?"":"".concat(kn+1,". ").concat(mn)}).join(`
|
|
`)),we.focus();case"add-null-ch":return jt===""&&we.setCursor(Kt.line,Kt.ch+1),we.replaceSelection(x),we.focus();case"inster-template-1":return jt===""&&we.setCursor(Kt.line,Kt.ch),we.replaceSelection(w),we.focus();case"eraser":return we.setValue(""),we.focus();case"trigger-watch":return Zi(!ei),we.focus();case"trigger-full-screen":return sr(!_i),we.focus();case dt:zi(dt);return;case wt:zi(wt);return;case Lt:zi(Lt);return;case gt:zi(gt);return;default:throw new Error}},[we,ei,_i]),Oi=Object(M.useCallback)(function(Tt){zi("");switch(lr){case dt:var Kt=Tt.title,jt=Tt.link;return we.replaceSelection("[".concat(Kt,"](").concat(jt,")")),we.focus();case wt:var an=Tt.language,mn=Tt.content;return we.replaceSelection(["```"+an,mn,"```"].join(`
|
|
`)),we.focus();case Lt:var kn=Tt.src,un=Tt.alt,Un=Tt.name;return kn.indexOf("type=image")>-1?we.replaceSelection(".concat(kn,' "').concat(un||"",'" )')):kn.indexOf("type=application/pdf")>-1?we.replaceSelection('<a href="'.concat(kn,'&disposition=inline" target="_blank">').concat(Un,"</a>")):we.replaceSelection('<a href="'.concat(kn,'" target="_blank">').concat(Un,"</a>")),we.focus();case gt:for(var li=Tt.row,tn=Tt.col,Cr=Tt.align,On=`
|
|
`,ui=0;ui<li;ui++){for(var xn=[],Vi=[],lo=0;lo<tn;lo++)ui===1&&Vi.push(Dt[Cr]),xn.push(" ");ui===1&&(On+="| ".concat(Vi.join(" | "),` |
|
|
`)),On+="| ".concat(xn.join(tn===1?"":" | "),` |
|
|
`)}return we.replaceSelection(On+`
|
|
`),we.focus();default:throw new Error}},[we,lr]),Yr=Object(M.useMemo)(function(){switch(lr){case dt:return O.a.createElement(Ue,{callback:Oi,onCancel:cr});case wt:return O.a.createElement(Pe.b,{callback:Oi,onCancel:cr});case Lt:return O.a.createElement(ut,{callback:Oi,onCancel:cr});case gt:return O.a.createElement(Nt,{callback:Oi,onCancel:cr});default:return null}},[lr]);function cr(){zi("")}Object(M.useEffect)(function(){if(Or.current){var Tt=Or.current,Kt=!1,jt=0;function an(un){Kt=!0,jt=un.pageY}function mn(){Kt=!1}function kn(un){if(Kt){var Un=un.pageY-jt;Un<0&&(Un=0),Un>300&&(Un=300);var li=vn+Un+"px";Vn(li)}}return Tt.addEventListener("mousedown",an),document.addEventListener("mousemove",kn),document.addEventListener("mouseup",mn),function(){Tt.removeEventListener("mousedown",an),document.removeEventListener("mousemove",kn),document.removeEventListener("mouseup",mn)}}},[we,Or]),Object(M.useEffect)(function(){Vn(vn)},[vn]);var Mr=A(Zt),Ho=A(Xr),yo={width:Mr,height:Ho},ya=Object(M.useMemo)(function(){if(Li){var Tt=new Date(Li),Kt=Tt.getHours(),jt=Tt.getMinutes(),an=Tt.getSeconds();return Kt=Kt<10?"0"+Kt:Kt,jt=jt<10?"0"+jt:jt,an=an<10?"0"+an:an,"".concat(Kt,":").concat(jt,":").concat(an)}return 0},[Li]);function bo(){window.sessionStorage.removeItem(Bi),si(!1),Jn(0)}function Wo(){si(!1),Jn(0),we.setValue(window.sessionStorage.getItem(Bi))}function Co(Tt,Kt){var jt=we.getValue();jt=jt.replace(Tt,Kt),Sn(jt),we==null||we.setValue(jt)}return O.a.createElement(M.Fragment,null,O.a.createElement("div",{className:"markdown-editor-wrapper",ref:ur},O.a.createElement("div",{className:"markdown-editor-container ".concat(gr," ").concat(ei?"on-preview":""," ").concat(zn?"mini":""," ").concat(_i?"full-screen":""),style:yo},O.a.createElement(Le,{insertTemp:oi,watch:ei,fullScreen:_i,showNullButton:ln,onActionCallback:$r,hidetoolBar:fr,uuid:Rn.current,setOpenPhones:function(){yr.current=!0}}),O.a.createElement("div",{className:"markdown-editor-body"},O.a.createElement("div",{className:"codemirror-container"},O.a.createElement("textarea",{ref:Zn,placeholder:u})),ei?O.a.createElement("div",{ref:qi,className:"preview-container"},Si==="stex"&&O.a.createElement(Ae,{value:dn}),Si!=="stex"&&O.a.createElement(ye.a,{edit:!0,value:dn,replaces:Co})):null))),Mt?O.a.createElement("a",{ref:Or,className:"editor-resize"}):null,O.a.createElement(T.a,null,Et[lr]?O.a.createElement(ce.a,{centered:!0,title:Et[lr],visible:!0,onCancel:cr,footer:null},Yr):null))}},PRkG:function(vt,Qe,y){"use strict";y.r(Qe);var E=y("T2oS"),ce=y("W9HT"),V=y("0Owb"),H=y("k1fw"),C=y("+L6B"),re=y("2/Rp"),S=y("/zsF"),F=y("PArb"),U=y("+BJd"),$=y("mr32"),M=y("14J3"),O=y("BMrR"),te=y("jCWc"),Q=y("kPKH"),K=y("9og8"),N=y("tJVT"),W=y("Znn+"),ee=y("ZTPi"),fe=y("tU7J"),Re=y("wFql"),Ke=y("WmNS"),_e=y.n(Ke),ye=y("q1tI"),Ae=y.n(ye),Ce=y("Ty5D"),Ee=y("9kvl"),Fe=y("xz5A"),me=y.n(Fe),L=y("fr4D"),ke=y("9Bee"),ve=y("Ot1p"),k=y("m3rI"),G=y("wd/R"),le=y.n(G),X=y("TTx2"),Le=y.n(X),T=y("p5ED"),g=y("V0Rq"),de=Re.a.Paragraph,Ie=ee.a.TabPane,De;(function(ot){ot[ot.Preview=0]="Preview",ot[ot.Download=1]="Download"})(De||(De={}));var rt=function(He){var Ue,Pe,Be,ue,D,Ze,mt,Ct,ut=He.user,st=He.globalSetting,he=Object(ye.useState)(),Me=Object(N.a)(he,2),Oe=Me[0],Se=Me[1],tt=Object(ye.useState)(!1),Ye=Object(N.a)(tt,2),lt=Ye[0],Nt=Ye[1],_t=Object(Ce.i)(),xt=_t.id;Object(ye.useEffect)(function(){dt()},[]);var dt=function(){var Xe=Object(K.a)(_e.a.mark(function Et(){var Gt,Ve;return _e.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return Nt(!0),St.next=3,Object(L.l)({attachment_id:xt});case 3:if(Ve=St.sent,Nt(!1),!(Ve.status!==0)){St.next=7;break}return St.abrupt("return");case 7:Se(Ve.attachment_info),et((Gt=Ve.attachment_info)===null||Gt===void 0?void 0:Gt.introduce);case 9:case"end":return St.stop()}},Et)}));return function(){return Xe.apply(this,arguments)}}(),Lt=Object(ye.useState)(!1),wt=Object(N.a)(Lt,2),gt=wt[0],Ne=wt[1],Dt=Object(ye.useState)(""),yt=Object(N.a)(Dt,2),We=yt[0],et=yt[1],ae=Object(ye.useState)({name:"",filename:"",type:"",className:"",data:"",close:!0,hasMask:!0,style:{position:"fixed",zIndex:9999,background:"rgba(0,0,0,.7)"},monacoEditor:{value:"",language:"",theme:"vs",options:{readOnly:!0}}}),Z=Object(N.a)(ae,2),ne=Z[0],x=Z[1],w=function(){var Xe=Object(K.a)(_e.a.mark(function Et(){var Gt;return _e.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(L.w)({attachment_id:xt,introduce:We});case 2:Gt=Pt.sent,Gt.status===0&&(Ne(!1),dt());case 4:case"end":return Pt.stop()}},Et)}));return function(){return Xe.apply(this,arguments)}}(),A="".concat(st==null||((Ue=st.setting)===null||Ue===void 0)?void 0:Ue.bigfiles_upload,"/file/download/").concat((Pe=ut.userInfo)===null||Pe===void 0?void 0:Pe.login,"/").concat(Oe==null?void 0:Oe.disk_filename,"?fileName=").concat(encodeURIComponent(Oe==null?void 0:Oe.filename)),P=Oe!=null&&(Be=Oe.cover_img_file)!==null&&Be!==void 0&&(ue=Be[0])!==null&&ue!==void 0&&ue.url?"".concat(k.a.API_SERVER).concat(Oe==null||((D=Oe.cover_img_file)===null||D===void 0||((Ze=D[0])===null||Ze===void 0))?void 0:Ze.url):Le.a,be=["audio","video","html","pdf","image"].includes(Oe==null?void 0:Oe.file_type)?"".concat(A,"&type=").concat(De.Preview):"".concat(A,"&type=").concat(De.Download),Te=(Oe==null?void 0:Oe.is_show_edit_button)===void 0||(Oe==null?void 0:Oe.is_show_edit_button);return Ae.a.createElement(ce.a,{spinning:lt},Oe&&Ae.a.createElement("div",{className:me.a.wrapper},Ae.a.createElement(O.a,{align:"bottom",className:me.a.mainInfo},Ae.a.createElement(Q.a,null,Ae.a.createElement("img",{src:P,alt:"",className:me.a.cover})),Ae.a.createElement(Q.a,{className:me.a.mainText},Ae.a.createElement("div",{className:me.a.title},Oe.alias_name),Ae.a.createElement(de,{ellipsis:{rows:3,expandable:!0,symbol:Ae.a.createElement("span",{style:{color:"#165dff"}},"\u5C55\u5F00")},className:me.a.desc},Oe.description))),Ae.a.createElement(O.a,{justify:"space-between"},Ae.a.createElement(Q.a,{className:me.a.info},Ae.a.createElement("span",null,"\u6700\u540E\u4FEE\u6539\u4EBA\uFF1A",Oe.author),Ae.a.createElement("span",{className:me.a.create_time},"\u521B\u5EFA\u65F6\u95F4\uFF1A",le()(Oe.created_on).format("YYYY-MM-DD HH:mm")),Ae.a.createElement("span",{className:me.a.create_time},"\u5927\u5C0F\uFF1A",Oe.filesize),((mt=Oe.tags)===null||mt===void 0?void 0:mt.length)>0&&Ae.a.createElement("span",{className:me.a.tagWrapper},"\u6807\u7B7E\uFF1A",(Ct=Oe.tags)===null||Ct===void 0?void 0:Ct.map(function(Xe){return Ae.a.createElement($.a,{key:Xe.id},Xe.name)})))),Ae.a.createElement(F.a,null),Ae.a.createElement(ee.a,null,Ae.a.createElement(Ie,{tab:"\u6570\u636E\u96C6\u4ECB\u7ECD",key:"1"},Te&&Ae.a.createElement(O.a,{justify:"end",className:me.a.btnWrapper},gt?Ae.a.createElement(Q.a,null,Ae.a.createElement(re.a,{className:me.a.btn,onClick:function(){return Ne(!1)}},"\u53D6\u6D88"),Ae.a.createElement(re.a,{className:me.a.btn,style:{marginLeft:12},onClick:w,type:"primary"},"\u4FDD\u5B58")):Ae.a.createElement(re.a,{className:me.a.btn,onClick:function(){return Ne(!0)}},"\u7F16\u8F91")),gt?Ae.a.createElement(ve.a,{defaultValue:Oe.introduce||"",onChange:function(Et){et(Et)}}):Ae.a.createElement(ke.a,{value:Oe.introduce||""})),Ae.a.createElement(Ie,{tab:"\u6570\u636E\u96C6\u6587\u4EF6",key:"2"},Ae.a.createElement(O.a,{className:me.a.fileWrapper,align:"middle"},Ae.a.createElement("a",{onClick:Object(K.a)(_e.a.mark(function Xe(){var Et;return _e.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(!["xlsx","docx","doc","pptx","office"].includes(Oe.file_type)){Ve.next=7;break}return Ve.next=3,Object(g.U)({attachment_id:Oe==null?void 0:Oe.attachment_id});case 3:Et=Ve.sent,x(Object(H.a)(Object(H.a)({},ne),{},{filename:Oe.filename,type:Et.fileType,data:k.a.API_SERVER+Et.url,otherData:Et})),Ve.next=9;break;case 7:return x(Object(H.a)(Object(H.a)({},ne),{},{filename:Oe.filename,type:Oe.file_type,data:k.a.API_SERVER+Oe.url})),Ve.abrupt("return");case 9:case"end":return Ve.stop()}},Xe)}))},Ae.a.createElement("span",null,Oe.filename)),Ae.a.createElement("span",{className:me.a.fileSize},"(".concat(Oe.filesize,")")),Ae.a.createElement("a",{className:me.a.download,download:Oe.filename,href:"".concat(A,"&type=").concat(De.Download)},"\u4E0B\u8F7D"))))),Ae.a.createElement(T.a,Object(V.a)({},ne,{onClose:function(){x(Object(H.a)(Object(H.a)({},ne),{},{type:""}))}})))};Qe.default=Object(Ee.a)(function(ot){var He=ot.user,Ue=ot.globalSetting;return{user:He,globalSetting:Ue}})(rt)},SJMd:function(vt,Qe){/**
|
|
* @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,E,ce,V=!1,H,C;window.PR_SHOULD_USE_CONTINUATION=!0;var re,S;(function(){var F=window,U=["break,continue,do,else,for,if,return,while"],$=[U,"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"],M=[$,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],O=[M,"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"],te=[M,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],Q=[M,"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"],K="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",N=[M,"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",ee=[U,"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"],fe=[U,"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"],Re=[U,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ke=[O,Q,te,N,W,ee,fe,Re],_e=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ye="str",Ae="kwd",Ce="com",Ee="typ",Fe="lit",me="pun",L="pln",ke="tag",ve="dec",k="src",G="atn",le="atv",X="nocode",Le="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function T(he){for(var Me=0,Oe=!1,Se=!1,tt=0,Ye=he.length;tt<Ye;++tt){var lt=he[tt];if(lt.ignoreCase)Se=!0;else if(/[a-z]/i.test(lt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Oe=!0,Se=!1;break}}var Nt={b:8,t:9,n:10,v:11,f:12,r:13};function _t(gt){var Ne=gt.charCodeAt(0);if(Ne!==92)return Ne;var Dt=gt.charAt(1);return Ne=Nt[Dt],Ne||("0"<=Dt&&Dt<="7"?parseInt(gt.substring(1),8):Dt==="u"||Dt==="x"?parseInt(gt.substring(2),16):gt.charCodeAt(1))}function xt(gt){if(gt<32)return(gt<16?"\\x0":"\\x")+gt.toString(16);var Ne=String.fromCharCode(gt);return Ne==="\\"||Ne==="-"||Ne==="]"||Ne==="^"?"\\"+Ne:Ne}function dt(gt){var Ne=gt.substring(1,gt.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")),Dt=[],yt=Ne[0]==="^",We=["["];yt&&We.push("^");for(var et=yt?1:0,ae=Ne.length;et<ae;++et){var Z=Ne[et];if(/\\[bdsw]/i.test(Z))We.push(Z);else{var ne=_t(Z),x;et+2<ae&&Ne[et+1]==="-"?(x=_t(Ne[et+2]),et+=2):x=ne,Dt.push([ne,x]),x<65||ne>122||(x<65||ne>90||Dt.push([Math.max(65,ne)|32,Math.min(x,90)|32]),x<97||ne>122||Dt.push([Math.max(97,ne)&~32,Math.min(x,122)&~32]))}}Dt.sort(function(be,Te){return be[0]-Te[0]||Te[1]-be[1]});for(var w=[],A=[],et=0;et<Dt.length;++et){var P=Dt[et];P[0]<=A[1]+1?A[1]=Math.max(A[1],P[1]):w.push(A=P)}for(var et=0;et<w.length;++et){var P=w[et];We.push(xt(P[0])),P[1]>P[0]&&(P[1]+1>P[0]&&We.push("-"),We.push(xt(P[1])))}return We.push("]"),We.join("")}function Lt(gt){for(var Ne=gt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Dt=Ne.length,yt=[],We=0,et=0;We<Dt;++We){var ae=Ne[We];if(ae==="(")++et;else if(ae.charAt(0)==="\\"){var Z=+ae.substring(1);Z&&(Z<=et?yt[Z]=-1:Ne[We]=xt(Z))}}for(var We=1;We<yt.length;++We)yt[We]===-1&&(yt[We]=++Me);for(var We=0,et=0;We<Dt;++We){var ae=Ne[We];if(ae==="(")++et,yt[et]||(Ne[We]="(?:");else if(ae.charAt(0)==="\\"){var Z=+ae.substring(1);Z&&Z<=et&&(Ne[We]="\\"+yt[Z])}}for(var We=0;We<Dt;++We)Ne[We]==="^"&&Ne[We+1]!=="^"&&(Ne[We]="");if(gt.ignoreCase&&Oe)for(var We=0;We<Dt;++We){var ae=Ne[We],ne=ae.charAt(0);ae.length>=2&&ne==="["?Ne[We]=dt(ae):ne!=="\\"&&(Ne[We]=ae.replace(/[a-zA-Z]/g,function(A){var P=A.charCodeAt(0);return"["+String.fromCharCode(P&~32,P|32)+"]"}))}return Ne.join("")}for(var wt=[],tt=0,Ye=he.length;tt<Ye;++tt){var lt=he[tt];if(lt.global||lt.multiline)throw new Error(""+lt);wt.push("(?:"+Lt(lt)+")")}return new RegExp(wt.join("|"),Se?"gi":"g")}function g(he,Me){var Oe=/(?:^|\s)nocode(?:\s|$)/,Se=[],tt=0,Ye=[],lt=0;function Nt(_t){var xt=_t.nodeType;if(xt==1){if(Oe.test(_t.className))return;for(var dt=_t.firstChild;dt;dt=dt.nextSibling)Nt(dt);var Lt=_t.nodeName.toLowerCase();(Lt==="br"||Lt==="li")&&(Se[lt]=`
|
|
`,Ye[lt<<1]=tt++,Ye[lt++<<1|1]=_t)}else if(xt==3||xt==4){var wt=_t.nodeValue;wt.length&&(Me?wt=wt.replace(/\r\n?/g,`
|
|
`):wt=wt.replace(/[ \t\r\n]+/g," "),Se[lt]=wt,Ye[lt<<1]=tt,tt+=wt.length,Ye[lt++<<1|1]=_t)}}return Nt(he),{sourceCode:Se.join("").replace(/\n$/,""),spans:Ye}}function de(he,Me,Oe,Se,tt){if(!Oe)return;var Ye={sourceNode:he,pre:1,langExtension:null,numberLines:null,sourceCode:Oe,spans:null,basePos:Me,decorations:null};Se(Ye),tt.push.apply(tt,Ye.decorations)}var Ie=/\S/;function De(he){for(var Me=void 0,Oe=he.firstChild;Oe;Oe=Oe.nextSibling){var Se=Oe.nodeType;Me=Se===1?Me?he:Oe:Se===3&&Ie.test(Oe.nodeValue)?he:Me}return Me===he?void 0:Me}function rt(he,Me){var Oe={},Se;(function(){for(var lt=he.concat(Me),Nt=[],_t={},xt=0,dt=lt.length;xt<dt;++xt){var Lt=lt[xt],wt=Lt[3];if(wt)for(var gt=wt.length;--gt>=0;)Oe[wt.charAt(gt)]=Lt;var Ne=Lt[1],Dt=""+Ne;_t.hasOwnProperty(Dt)||(Nt.push(Ne),_t[Dt]=null)}Nt.push(/[\0-\uffff]/),Se=T(Nt)})();var tt=Me.length,Ye=function(lt){for(var Nt=lt.sourceCode,_t=lt.basePos,xt=lt.sourceNode,dt=[_t,L],Lt=0,wt=Nt.match(Se)||[],gt={},Ne=0,Dt=wt.length;Ne<Dt;++Ne){var yt=wt[Ne],We=gt[yt],et=void 0,ae;if(typeof We=="string")ae=!1;else{var Z=Oe[yt.charAt(0)];if(Z)et=yt.match(Z[1]),We=Z[0];else{for(var ne=0;ne<tt;++ne)if(Z=Me[ne],et=yt.match(Z[1]),et){We=Z[0];break}et||(We=L)}ae=We.length>=5&&We.substring(0,5)==="lang-",ae&&!(et&&typeof et[1]=="string")&&(ae=!1,We=k),ae||(gt[yt]=We)}var x=Lt;if(Lt+=yt.length,!ae)dt.push(_t+x,We);else{var w=et[1],A=yt.indexOf(w),P=A+w.length;et[2]&&(P=yt.length-et[2].length,A=P-w.length);var be=We.substring(5);de(xt,_t+x,yt.substring(0,A),Ye,dt),de(xt,_t+x+A,w,D(be,w),dt),de(xt,_t+x+P,yt.substring(P),Ye,dt)}}lt.decorations=dt};return Ye}function ot(he){var Me=[],Oe=[];he.tripleQuotedStrings?Me.push([ye,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):he.multiLineStrings?Me.push([ye,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([ye,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),he.verbatimStrings&&Oe.push([ye,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Se=he.hashComments;Se&&(he.cStyleComments?(Se>1?Me.push([Ce,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([Ce,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Oe.push([ye,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([Ce,/^#[^\r\n]*/,null,"#"])),he.cStyleComments&&(Oe.push([Ce,/^\/\/[^\r\n]*/,null]),Oe.push([Ce,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var tt=he.regexLiterals;if(tt){var Ye=tt>1?"":`
|
|
\r`,lt=Ye?".":"[\\S\\s]",Nt="/(?=[^/*"+Ye+"])(?:[^/\\x5B\\x5C"+Ye+"]|\\x5C"+lt+"|\\x5B(?:[^\\x5C\\x5D"+Ye+"]|\\x5C"+lt+")*(?:\\x5D|$))+/";Oe.push(["lang-regex",RegExp("^"+Le+"("+Nt+")")])}var _t=he.types;_t&&Oe.push([Ee,_t]);var xt=(""+he.keywords).replace(/^ | $/g,"");xt.length&&Oe.push([Ae,new RegExp("^(?:"+xt.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([L,/^\s+/,null,` \r
|
|
\xA0`]);var dt="^.[^\\s\\w.$@'\"`/\\\\]*";return he.regexLiterals&&(dt+="(?!s*/)"),Oe.push([Fe,/^@[a-z_$][a-z_$@0-9]*/i,null],[Ee,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[L,/^[a-z_$][a-z_$@0-9]*/i,null],[Fe,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[L,/^\\[\s\S]?/,null],[me,new RegExp(dt),null]),rt(Me,Oe)}var He=ot({keywords:Ke,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ue(he,Me,Oe){for(var Se=/(?:^|\s)nocode(?:\s|$)/,tt=/\r\n?|\n/,Ye=he.ownerDocument,lt=Ye.createElement("li");he.firstChild;)lt.appendChild(he.firstChild);var Nt=[lt];function _t(Ne){var Dt=Ne.nodeType;if(Dt==1&&!Se.test(Ne.className))if(Ne.nodeName==="br")xt(Ne),Ne.parentNode&&Ne.parentNode.removeChild(Ne);else for(var yt=Ne.firstChild;yt;yt=yt.nextSibling)_t(yt);else if((Dt==3||Dt==4)&&Oe){var We=Ne.nodeValue,et=We.match(tt);if(et){var ae=We.substring(0,et.index);Ne.nodeValue=ae;var Z=We.substring(et.index+et[0].length);if(Z){var ne=Ne.parentNode;ne.insertBefore(Ye.createTextNode(Z),Ne.nextSibling)}xt(Ne),ae||Ne.parentNode.removeChild(Ne)}}}function xt(Ne){for(;!Ne.nextSibling;)if(Ne=Ne.parentNode,!Ne)return;function Dt(et,ae){var Z=ae?et.cloneNode(!1):et,ne=et.parentNode;if(ne){var x=Dt(ne,1),w=et.nextSibling;x.appendChild(Z);for(var A=w;A;A=w)w=A.nextSibling,x.appendChild(A)}return Z}for(var yt=Dt(Ne.nextSibling,0),We;(We=yt.parentNode)&&We.nodeType===1;)yt=We;Nt.push(yt)}for(var dt=0;dt<Nt.length;++dt)_t(Nt[dt]);Me===(Me|0)&&Nt[0].setAttribute("value",Me);var Lt=Ye.createElement("ol");Lt.className="linenums";for(var wt=Math.max(0,Me-1|0)||0,dt=0,gt=Nt.length;dt<gt;++dt)lt=Nt[dt],lt.className="L"+(dt+wt)%10,lt.firstChild||lt.appendChild(Ye.createTextNode("\xA0")),Lt.appendChild(lt);he.appendChild(Lt)}function Pe(he){var Me=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Me=Me&&+Me[1]<=8;var Oe=/\n/g,Se=he.sourceCode,tt=Se.length,Ye=0,lt=he.spans,Nt=lt.length,_t=0,xt=he.decorations,dt=xt.length,Lt=0;xt[dt]=tt;var wt,gt;for(gt=wt=0;gt<dt;)xt[gt]!==xt[gt+2]?(xt[wt++]=xt[gt++],xt[wt++]=xt[gt++]):gt+=2;for(dt=wt,gt=wt=0;gt<dt;){for(var Ne=xt[gt],Dt=xt[gt+1],yt=gt+2;yt+2<=dt&&xt[yt+1]===Dt;)yt+=2;xt[wt++]=Ne,xt[wt++]=Dt,gt=yt}dt=xt.length=wt;var We=he.sourceNode,et="";We&&(et=We.style.display,We.style.display="none");try{for(var ae=null;_t<Nt;){var Z=lt[_t],ne=lt[_t+2]||tt,x=xt[Lt+2]||tt,yt=Math.min(ne,x),w=lt[_t+1],A;if(w.nodeType!==1&&(A=Se.substring(Ye,yt))){Me&&(A=A.replace(Oe,"\r")),w.nodeValue=A;var P=w.ownerDocument,be=P.createElement("span");be.className=xt[Lt+1];var Te=w.parentNode;Te.replaceChild(be,w),be.appendChild(w),Ye<ne&&(lt[_t+1]=w=P.createTextNode(Se.substring(yt,ne)),Te.insertBefore(w,be.nextSibling))}Ye=yt,Ye>=ne&&(_t+=2),Ye>=x&&(Lt+=2)}}finally{We&&(We.style.display=et)}}var Be={};function ue(he,Me){for(var Oe=Me.length;--Oe>=0;){var Se=Me[Oe];Be.hasOwnProperty(Se)?F.console&&console.warn("cannot override language handler %s",Se):Be[Se]=he}}function D(he,Me){return he&&Be.hasOwnProperty(he)||(he=/^\s*</.test(Me)?"default-markup":"default-code"),Be[he]}ue(He,["default-code"]),ue(rt([],[[L,/^[^<?]+/],[ve,/^<!\w[^>]*(?:>|$)/],[Ce,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[me,/^(?:<[%?]|[%?]>)/],["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"]),ue(rt([[L,/^[\s]+/,null,` \r
|
|
`],[le,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[ke,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[G,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[me,/^[=<>\/]+/],["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"]),ue(rt([],[[le,/^[\s\S]+/]]),["uq.val"]),ue(ot({keywords:O,hashComments:!0,cStyleComments:!0,types:_e}),["c","cc","cpp","cxx","cyc","m"]),ue(ot({keywords:"null,true,false"}),["json"]),ue(ot({keywords:Q,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:_e}),["cs"]),ue(ot({keywords:te,cStyleComments:!0}),["java"]),ue(ot({keywords:Re,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ue(ot({keywords:ee,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ue(ot({keywords:W,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ue(ot({keywords:fe,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ue(ot({keywords:N,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ue(ot({keywords:K,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ue(rt([],[[ye,/^[\s\S]+/]]),["regex"]);function Ze(he){var Me=he.langExtension;try{var Oe=g(he.sourceNode,he.pre),Se=Oe.sourceCode;he.sourceCode=Se,he.spans=Oe.spans,he.basePos=0,D(Me,Se)(he),Pe(he)}catch(tt){F.console&&console.log(tt&&tt.stack||tt)}}function mt(he,Me,Oe){var Se=Oe||!1,tt=Me||null,Ye=document.createElement("div");Ye.innerHTML="<pre>"+he+"</pre>",Ye=Ye.firstChild,Se&&Ue(Ye,Se,!0);var lt={langExtension:tt,numberLines:Se,sourceNode:Ye,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ze(lt),Ye.innerHTML}function Ct(he,Me){var Oe=Me||document.body,Se=Oe.ownerDocument||document;function tt(Z){return Oe.getElementsByTagName(Z)}for(var Ye=[tt("pre"),tt("code"),tt("xmp")],lt=[],Nt=0;Nt<Ye.length;++Nt)for(var _t=0,xt=Ye[Nt].length;_t<xt;++_t)lt.push(Ye[Nt][_t]);Ye=null;var dt=Date;dt.now||(dt={now:function(){return+new Date}});var Lt=0,wt=/\blang(?:uage)?-([\w.]+)(?!\S)/,gt=/\bprettyprint\b/,Ne=/\bprettyprinted\b/,Dt=/pre|xmp/i,yt=/^code$/i,We=/^(?:pre|code|xmp)$/i,et={};function ae(){for(var Z=F.PR_SHOULD_USE_CONTINUATION?dt.now()+250:Infinity;Lt<lt.length&&dt.now()<Z;Lt++){for(var ne=lt[Lt],x=et,w=ne;w=w.previousSibling;){var A=w.nodeType,P=(A===7||A===8)&&w.nodeValue;if(P?!/^\??prettify\b/.test(P):A!==3||/\S/.test(w.nodeValue))break;if(P){x={},P.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vn,Ft,zn){x[Ft]=zn});break}}var be=ne.className;if((x!==et||gt.test(be))&&!Ne.test(be)){for(var Te=!1,Xe=ne.parentNode;Xe;Xe=Xe.parentNode){var Et=Xe.tagName;if(We.test(Et)&&Xe.className&>.test(Xe.className)){Te=!0;break}}if(!Te){ne.className+=" prettyprinted";var Gt=x.lang;if(!Gt){Gt=be.match(wt);var Ve;!Gt&&(Ve=De(ne))&&yt.test(Ve.tagName)&&(Gt=Ve.className.match(wt)),Gt&&(Gt=Gt[1])}var Pt;if(Dt.test(ne.tagName))Pt=1;else{var St=ne.currentStyle,ht=Se.defaultView,on=St?St.whiteSpace:ht&&ht.getComputedStyle?ht.getComputedStyle(ne,null).getPropertyValue("white-space"):0;Pt=on&&on.substring(0,3)==="pre"}var Zt=x.linenums;(Zt=Zt==="true"||+Zt)||(Zt=be.match(/\blinenums\b(?::(\d+))?/),Zt=Zt?Zt[1]&&Zt[1].length?+Zt[1]:!0:!1),Zt&&Ue(ne,Zt,Pt);var En={langExtension:Gt,sourceNode:ne,numberLines:Zt,pre:Pt,sourceCode:null,basePos:null,spans:null,decorations:null};Ze(En)}}}Lt<lt.length?F.setTimeout(ae,250):typeof he=="function"&&he()}ae()}var ut=F.PR={createSimpleLexer:rt,registerLangHandler:ue,sourceDecorator:ot,PR_ATTRIB_NAME:G,PR_ATTRIB_VALUE:le,PR_COMMENT:Ce,PR_DECLARATION:ve,PR_KEYWORD:Ae,PR_LITERAL:Fe,PR_NOCODE:X,PR_PLAIN:L,PR_PUNCTUATION:me,PR_SOURCE:k,PR_STRING:ye,PR_TAG:ke,PR_TYPE:Ee,prettyPrintOne:V?F.prettyPrintOne=mt:re=mt,prettyPrint:S=V?F.prettyPrint=Ct:S=Ct},st=F.define;typeof st=="function"&&st.amd&&st("google-code-prettify",[],function(){return ut})})()},TTx2:function(vt,Qe,y){vt.exports=y.p+"static/default-dataset-img.6335ca49.png"},"VrN/":function(vt,Qe,y){(function(E,ce){vt.exports=ce()})(this,function(){"use strict";var E=navigator.userAgent,ce=navigator.platform,V=/gecko\/\d/i.test(E),H=/MSIE \d/.test(E),C=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(E),re=/Edge\/(\d+)/.exec(E),S=H||C||re,F=S&&(H?document.documentMode||6:+(re||C)[1]),U=!re&&/WebKit\//.test(E),$=U&&/Qt\/\d+\.\d+/.test(E),M=!re&&/Chrome\//.test(E),O=/Opera\//.test(E),te=/Apple Computer/.test(navigator.vendor),Q=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(E),K=/PhantomJS/.test(E),N=!re&&/AppleWebKit/.test(E)&&/Mobile\/\w+/.test(E),W=/Android/.test(E),ee=N||W||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(E),fe=N||/Mac/.test(ce),Re=/\bCrOS\b/.test(E),Ke=/win/i.test(ce),_e=O&&E.match(/Version\/(\d*\.\d*)/);_e&&(_e=Number(_e[1])),_e&&_e>=15&&(O=!1,U=!0);var ye=fe&&($||O&&(_e==null||_e<12.11)),Ae=V||S&&F>=9;function Ce(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Ee=function(e,t){var i=e.className,n=Ce(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 Fe(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function me(e,t){return Fe(e).appendChild(t)}function L(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),typeof t=="string")r.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)r.appendChild(t[s]);return r}function ke(e,t,i,n){var r=L(e,t,i,n);return r.setAttribute("role","presentation"),r}var ve;document.createRange?ve=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:ve=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 k(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 G(){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 le(e,t){var i=e.className;Ce(t).test(i)||(e.className+=(i?" ":"")+t)}function X(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!Ce(i[n]).test(t)&&(t+=" "+i[n]);return t}var Le=function(e){e.select()};N?Le=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:S&&(Le=function(e){try{e.select()}catch(t){}});function T(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function g(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 de(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 h=e.indexOf(" ",s);if(h<0||h>=t)return l+(t-s);l+=h-s,l+=i-l%i,s=h+1}}var Ie=function(){this.id=null,this.f=null,this.time=0,this.handler=T(this.onTimeout,this)};Ie.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ie.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 De(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var rt=50,ot={toString:function(){return"CodeMirror.Pass"}},He={scroll:!1},Ue={origin:"*mouse"},Pe={origin:"+move"};function Be(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 ue=[""];function D(e){for(;ue.length<=e;)ue.push(Ze(ue)+" ");return ue[e]}function Ze(e){return e[e.length-1]}function mt(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function Ct(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function ut(){}function st(e,t){var i;return Object.create?i=Object.create(e):(ut.prototype=e,i=new ut),t&&g(t,i),i}var he=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Me(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||he.test(e))}function Oe(e,t){return t?t.source.indexOf("\\w")>-1&&Me(e)?!0:t.test(e):Me(e)}function Se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var tt=/[\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 Ye(e){return e.charCodeAt(0)>=768&&tt.test(e)}function lt(e,t,i){for(;(i<0?t>0:t<e.length)&&Ye(e.charAt(t));)t+=i;return t}function Nt(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 _t(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 xt=null;function dt(e,t,i){var n;xt=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:xt=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:xt=r)}return n!=null?n:xt}var Lt=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]/,h=/[1n]/;function f(v,I,Y){this.level=v,this.from=I,this.to=Y}return function(v,I){var Y=I=="ltr"?"L":"R";if(v.length==0||I=="ltr"&&!n.test(v))return!1;for(var xe=v.length,pe=[],ze=0;ze<xe;++ze)pe.push(i(v.charCodeAt(ze)));for(var Je=0,at=Y;Je<xe;++Je){var ft=pe[Je];ft=="m"?pe[Je]=at:at=ft}for(var bt=0,pt=Y;bt<xe;++bt){var kt=pe[bt];kt=="1"&&pt=="r"?pe[bt]="n":s.test(kt)&&(pt=kt,kt=="r"&&(pe[bt]="R"))}for(var Vt=1,Ut=pe[0];Vt<xe-1;++Vt){var en=pe[Vt];en=="+"&&Ut=="1"&&pe[Vt+1]=="1"?pe[Vt]="1":en==","&&Ut==pe[Vt+1]&&(Ut=="1"||Ut=="n")&&(pe[Vt]=Ut),Ut=en}for(var In=0;In<xe;++In){var bi=pe[In];if(bi==",")pe[In]="N";else if(bi=="%"){var Yn=void 0;for(Yn=In+1;Yn<xe&&pe[Yn]=="%";++Yn);for(var Qi=In&&pe[In-1]=="!"||Yn<xe&&pe[Yn]=="1"?"1":"N",Ki=In;Ki<Yn;++Ki)pe[Ki]=Qi;In=Yn-1}}for(var ci=0,Xi=Y;ci<xe;++ci){var Ei=pe[ci];Xi=="L"&&Ei=="1"?pe[ci]="L":s.test(Ei)&&(Xi=Ei)}for(var yi=0;yi<xe;++yi)if(r.test(pe[yi])){var di=void 0;for(di=yi+1;di<xe&&r.test(pe[di]);++di);for(var qn=(yi?pe[yi-1]:Y)=="L",$i=(di<xe?pe[di]:Y)=="L",Bo=qn==$i?qn?"L":"R":Y,ao=yi;ao<di;++ao)pe[ao]=Bo;yi=di-1}for(var Ai=[],jr,Ci=0;Ci<xe;)if(l.test(pe[Ci])){var ps=Ci;for(++Ci;Ci<xe&&l.test(pe[Ci]);++Ci);Ai.push(new f(0,ps,Ci))}else{var Vr=Ci,go=Ai.length,vo=I=="rtl"?1:0;for(++Ci;Ci<xe&&pe[Ci]!="L";++Ci);for(var Ui=Vr;Ui<Ci;)if(h.test(pe[Ui])){Vr<Ui&&(Ai.splice(go,0,new f(1,Vr,Ui)),go+=vo);var Fo=Ui;for(++Ui;Ui<Ci&&h.test(pe[Ui]);++Ui);Ai.splice(go,0,new f(2,Fo,Ui)),go+=vo,Vr=Ui}else++Ui;Vr<Ci&&Ai.splice(go,0,new f(1,Vr,Ci))}return I=="ltr"&&(Ai[0].level==1&&(jr=v.match(/^\s+/))&&(Ai[0].from=jr[0].length,Ai.unshift(new f(0,0,jr[0].length))),Ze(Ai).level==1&&(jr=v.match(/\s+$/))&&(Ze(Ai).to-=jr[0].length,Ai.push(new f(0,xe-jr[0].length,xe)))),I=="rtl"?Ai.reverse():Ai}}();function wt(e,t){var i=e.order;return i==null&&(i=e.order=Lt(e.text,t)),i}var gt=[],Ne=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]||gt).concat(i)}};function Dt(e,t){return e._handlers&&e._handlers[t]||gt}function yt(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=De(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function We(e,t){var i=Dt(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 et(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),We(e,i||t.type,e,t),A(t)||t.codemirrorIgnore}function ae(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)De(i,t[n])==-1&&i.push(t[n])}function Z(e,t){return Dt(e,t).length>0}function ne(e){e.prototype.on=function(t,i){Ne(this,t,i)},e.prototype.off=function(t,i){yt(this,t,i)}}function x(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function w(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function A(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function P(e){x(e),w(e)}function be(e){return e.target||e.srcElement}function Te(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),fe&&e.ctrlKey&&t==1&&(t=3),t}var Xe=function(){if(S&&F<9)return!1;var e=L("div");return"draggable"in e||"dragDrop"in e}(),Et;function Gt(e){if(Et==null){var t=L("span","\u200B");me(e,L("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Et=t.offsetWidth<=1&&t.offsetHeight>2&&!(S&&F<8))}var i=Et?L("span","\u200B"):L("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ve;function Pt(e){if(Ve!=null)return Ve;var t=me(e,document.createTextNode("A\u062EA")),i=ve(t,0,1).getBoundingClientRect(),n=ve(t,1,2).getBoundingClientRect();return Fe(e),!i||i.left==i.right?!1:Ve=n.right-i.right<3}var St=`
|
|
|
|
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/)},ht=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},on=function(){var e=L("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Zt=null;function En(e){if(Zt!=null)return Zt;var t=me(e,L("span","x")),i=t.getBoundingClientRect(),n=ve(t,0,1).getBoundingClientRect();return Zt=Math.abs(i.left-n.left)>1}var vn={},Ft={};function zn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),vn[e]=t}function Bn(e,t){Ft[e]=t}function At(e){if(typeof e=="string"&&Ft.hasOwnProperty(e))e=Ft[e];else if(e&&typeof e.name=="string"&&Ft.hasOwnProperty(e.name)){var t=Ft[e.name];typeof t=="string"&&(t={name:t}),e=st(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return At("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return At("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function hi(e,t){t=At(t);var i=vn[t.name];if(!i)return hi(e,"text/plain");var n=i(e,t);if(oi.hasOwnProperty(t.name)){var r=oi[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 oi={};function ai(e,t){var i=oi.hasOwnProperty(e)?oi[e]:oi[e]={};g(t,i)}function Si(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 or(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 Bi(e,t,i){return e.startState?e.startState(t,i):!0}var pn=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};pn.prototype.eol=function(){return this.pos>=this.string.length},pn.prototype.sol=function(){return this.pos==this.lineStart},pn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},pn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},pn.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},pn.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},pn.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},pn.prototype.skipToEnd=function(){this.pos=this.string.length},pn.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},pn.prototype.backUp=function(e){this.pos-=e},pn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=de(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?de(this.string,this.lineStart,this.tabSize):0)},pn.prototype.indentation=function(){return de(this.string,null,this.tabSize)-(this.lineStart?de(this.string,this.lineStart,this.tabSize):0)},pn.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)}},pn.prototype.current=function(){return this.string.slice(this.start,this.pos)},pn.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},pn.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},pn.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Mt(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 Fi(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 hr(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function ki(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function ln(e){if(e.parent==null)return null;for(var t=e.parent,i=De(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 Yi(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 h=e.lines[l],f=h.height;if(t<f)break;t-=f}return i+l}function fr(e,t){return t>=e.first&&t<e.first+e.size}function pr(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function qe(e,t,i){if(i===void 0&&(i=null),!(this instanceof qe))return new qe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ht(e,t){return e.line-t.line||e.ch-t.ch}function Ji(e,t){return e.sticky==t.sticky&&Ht(e,t)==0}function ar(e){return qe(e.line,e.ch)}function mr(e,t){return Ht(e,t)<0?t:e}function gr(e,t){return Ht(e,t)<0?e:t}function d(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 qe(e.first,0);var i=e.first+e.size-1;return t.line>i?qe(i,Mt(e,i).text.length):a(t,Mt(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?qe(e.line,t):i<0?qe(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 p=function(e,t){this.state=e,this.lookAhead=t},c=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};c.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},c.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}},c.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},c.fromSaved=function(e,t,i){return t instanceof p?new c(e,Si(e.mode,t.state),i,t.lookAhead):new c(e,Si(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Si(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new p(t,this.maxLookAhead):t};function J(e,t,i,n){var r=[e.state.modeGen],s={};Hi(e,t.text,e.doc.mode,i,function(v,I){return r.push(v,I)},s,n);for(var l=i.state,h=function(v){i.baseTokens=r;var I=e.state.overlays[v],Y=1,xe=0;i.state=!0,Hi(e,t.text,I.mode,i,function(pe,ze){for(var Je=Y;xe<pe;){var at=r[Y];at>pe&&r.splice(Y,1,pe,r[Y+1],at),Y+=2,xe=Math.min(pe,at)}if(!ze)return;if(I.opaque)r.splice(Je,Y-Je,pe,"overlay "+ze),Y=Je+2;else for(;Je<Y;Je+=2){var ft=r[Je+1];r[Je+1]=(ft?ft+" ":"")+"overlay "+ze}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},f=0;f<e.state.overlays.length;++f)h(f);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Ge(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=we(e,ln(t)),r=t.text.length>e.options.maxHighlightLength&&Si(e.doc.mode,n.state),s=J(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 we(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=ei(e,t,i),l=s>n.first&&Mt(n,s-1).stateAfter,h=l?c.fromSaved(n,l,s):new c(n,Bi(n.mode),s);return n.iter(s,t,function(f){Ot(e,f.text,h);var v=h.line;f.stateAfter=v==t-1||v%5==0||v>=r.viewFrom&&v<r.viewTo?h.save():null,h.nextLine()}),i&&(n.modeFrontier=h.line),h}function Ot(e,t,i,n){var r=e.doc.mode,s=new pn(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&$e(r,i.state);!s.eol();)Wt(r,s,i.state),s.start=s.pos}function $e(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=or(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function Wt(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=or(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 dn=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Sn(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var h=Mt(r,t.line),f=we(e,t.line,i),v=new pn(h.text,e.options.tabSize,f),I;for(n&&(I=[]);(n||v.pos<t.ch)&&!v.eol();)v.start=v.pos,l=Wt(s,v,f.state),n&&I.push(new dn(v,l,Si(r.mode,f.state)));return n?I:new dn(v,l,f.state)}function Ri(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 Hi(e,t,i,n,r,s,l){var h=i.flattenSpans;h==null&&(h=e.options.flattenSpans);var f=0,v=null,I=new pn(t,e.options.tabSize,n),Y,xe=e.options.addModeClass&&[null];for(t==""&&Ri($e(i,n.state),s);!I.eol();){if(I.pos>e.options.maxHighlightLength?(h=!1,l&&Ot(e,t,n,I.pos),I.pos=t.length,Y=null):Y=Ri(Wt(i,I,n.state,xe),s),xe){var pe=xe[0].name;pe&&(Y="m-"+(Y?pe+" "+Y:pe))}if(!h||v!=Y){for(;f<I.start;)f=Math.min(I.start,f+5e3),r(f,v);v=Y}I.start=I.pos}for(;f<I.pos;){var ze=Math.min(I.pos,f+5e3);r(ze,v),f=ze}}function ei(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>l;--h){if(h<=s.first)return s.first;var f=Mt(s,h-1),v=f.stateAfter;if(v&&(!i||h+(v instanceof p?v.lookAhead:0)<=s.modeFrontier))return h;var I=de(f.text,null,e.options.tabSize);(r==null||n>I)&&(r=h-1,n=I)}return r}function Zi(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=Mt(e,n).stateAfter;if(r&&(!(r instanceof p)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var Gr=!1,xi=!1;function _i(){Gr=!0}function sr(){xi=!0}function vr(e,t,i){this.marker=e,this.from=t,this.to=i}function Wi(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function lr(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function zi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function so(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,h=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(h||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new vr(l,s.from,f?null:s.to))}}return n}function Kr(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,h=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(h||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new vr(l,f?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Li(e,t){if(t.full)return null;var i=fr(e,t.from.line)&&Mt(e,t.from.line).markedSpans,n=fr(e,t.to.line)&&Mt(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=Ht(t.from,t.to)==0,h=so(i,r,l),f=Kr(n,s,l),v=t.text.length==1,I=Ze(t.text).length+(v?r:0);if(h)for(var Y=0;Y<h.length;++Y){var xe=h[Y];if(xe.to==null){var pe=Wi(f,xe.marker);pe?v&&(xe.to=pe.to==null?null:pe.to+I):xe.to=r}}if(f)for(var ze=0;ze<f.length;++ze){var Je=f[ze];if(Je.to!=null&&(Je.to+=I),Je.from==null){var at=Wi(h,Je.marker);at||(Je.from=I,v&&(h||(h=[])).push(Je))}else Je.from+=I,v&&(h||(h=[])).push(Je)}h&&(h=Jn(h)),f&&f!=h&&(f=Jn(f));var ft=[h];if(!v){var bt=t.text.length-2,pt;if(bt>0&&h)for(var kt=0;kt<h.length;++kt)h[kt].to==null&&(pt||(pt=[])).push(new vr(h[kt].marker,null,null));for(var Vt=0;Vt<bt;++Vt)ft.push(pt);ft.push(f)}return ft}function Jn(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 _r(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(pe){if(pe.markedSpans)for(var ze=0;ze<pe.markedSpans.length;++ze){var Je=pe.markedSpans[ze].marker;Je.readOnly&&(!n||De(n,Je)==-1)&&(n||(n=[])).push(Je)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],h=l.find(0),f=0;f<r.length;++f){var v=r[f];if(Ht(v.to,h.from)<0||Ht(v.from,h.to)>0)continue;var I=[f,1],Y=Ht(v.from,h.from),xe=Ht(v.to,h.to);(Y<0||!l.inclusiveLeft&&!Y)&&I.push({from:v.from,to:h.from}),(xe>0||!l.inclusiveRight&&!xe)&&I.push({from:h.to,to:v.to}),r.splice.apply(r,I),f+=I.length-3}return r}function Ir(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 Xr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function Vn(e){return e.inclusiveLeft?-1:0}function bn(e){return e.inclusiveRight?1:0}function $n(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=Ht(n.from,r.from)||Vn(e)-Vn(t);if(s)return-s;var l=Ht(n.to,r.to)||bn(e)-bn(t);return l||t.id-e.id}function yn(e,t){var i=xi&&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||$n(n,r.marker)<0)&&(n=r.marker);return n}function si(e){return yn(e,!0)}function Rn(e){return yn(e,!1)}function yr(e,t){var i=xi&&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||$n(n,s.marker)<0)&&(n=s.marker)}return n}function ti(e,t,i,n,r){var s=Mt(e,t),l=xi&&s.markedSpans;if(l)for(var h=0;h<l.length;++h){var f=l[h];if(!f.marker.collapsed)continue;var v=f.marker.find(0),I=Ht(v.from,i)||Vn(f.marker)-Vn(r),Y=Ht(v.to,n)||bn(f.marker)-bn(r);if(I>=0&&Y<=0||I<=0&&Y>=0)continue;if(I<=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?Ht(v.to,i)>=0:Ht(v.to,i)>0)||I>=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?Ht(v.from,n)<=0:Ht(v.from,n)<0))return!0}}function Zn(e){for(var t;t=si(e);)e=t.find(-1,!0).line;return e}function ur(e){for(var t;t=Rn(e);)e=t.find(1,!0).line;return e}function Or(e){for(var t,i;t=Rn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function qi(e,t){var i=Mt(e,t),n=Zn(i);return i==n?t:ln(n)}function br(e,t){if(t>e.lastLine())return t;var i=Mt(e,t),n;if(!Di(e,i))return t;for(;n=Rn(i);)i=n.find(1,!0).line;return ln(i)+1}function Di(e,t){var i=xi&&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&&$r(e,t,n))return!0}}function $r(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return $r(e,n.line,Wi(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)&&$r(e,t,r))return!0}function Oi(e){e=Zn(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 h=s.children[l];if(h==i)break;t+=h.height}return t}function Yr(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=si(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=Rn(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 cr(e){var t=e.display,i=e.doc;t.maxLine=Mt(i,i.first),t.maxLineLength=Yr(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Yr(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var Mr=function(e,t,i){this.text=e,Xr(this,t),this.height=i?i(this):1};Mr.prototype.lineNo=function(){return ln(this)},ne(Mr);function Ho(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ir(e),Xr(e,i);var r=n?n(e):1;r!=e.height&&ki(e,r)}function yo(e){e.parent=null,Ir(e)}var ya={},bo={};function Wo(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?bo:ya;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Co(e,t){var i=ke("span",null,null,U?"padding-right: .1px":null),n={pre:ke("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=Kt,Pt(e.display.measure)&&(l=wt(s,e.doc.direction))&&(n.addToken=an(n.addToken,l)),n.map=[];var h=t!=e.display.externalMeasured&&ln(s);kn(s,n,Ge(e,s,h)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=X(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=X(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Gt(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(U){var f=n.content.lastChild;(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return We(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=X(n.pre.className,n.textClass||"")),n}function Tt(e){var t=L("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Kt(e,t,i,n,r,s,l){if(!t)return;var h=e.splitSpaces?jt(t,e.trailingSpace):t,f=e.cm.state.specialChars,v=!1,I;if(!f.test(t))e.col+=t.length,I=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,I),S&&F<9&&(v=!0),e.pos+=t.length;else{I=document.createDocumentFragment();for(var Y=0;;){f.lastIndex=Y;var xe=f.exec(t),pe=xe?xe.index-Y:t.length-Y;if(pe){var ze=document.createTextNode(h.slice(Y,Y+pe));S&&F<9?I.appendChild(L("span",[ze])):I.appendChild(ze),e.map.push(e.pos,e.pos+pe,ze),e.col+=pe,e.pos+=pe}if(!xe)break;Y+=pe+1;var Je=void 0;if(xe[0]==" "){var at=e.cm.options.tabSize,ft=at-e.col%at;Je=I.appendChild(L("span",D(ft),"cm-tab")),Je.setAttribute("role","presentation"),Je.setAttribute("cm-text"," "),e.col+=ft}else xe[0]=="\r"||xe[0]==`
|
|
`?(Je=I.appendChild(L("span",xe[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Je.setAttribute("cm-text",xe[0]),e.col+=1):(Je=e.cm.options.specialCharPlaceholder(xe[0]),Je.setAttribute("cm-text",xe[0]),S&&F<9?I.appendChild(L("span",[Je])):I.appendChild(Je),e.col+=1);e.map.push(e.pos,e.pos+1,Je),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,i||n||r||v||s||l){var bt=i||"";n&&(bt+=n),r&&(bt+=r);var pt=L("span",[I],bt,s);if(l)for(var kt in l)l.hasOwnProperty(kt)&&kt!="style"&&kt!="class"&&pt.setAttribute(kt,l[kt]);return e.content.appendChild(pt)}e.content.appendChild(I)}function jt(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 an(e,t){return function(i,n,r,s,l,h,f){r=r?r+" cm-force-border":"cm-force-border";for(var v=i.pos,I=v+n.length;;){for(var Y=void 0,xe=0;xe<t.length&&!(Y=t[xe],Y.to>v&&Y.from<=v);xe++);if(Y.to>=I)return e(i,n,r,s,l,h,f);e(i,n.slice(0,Y.to-v),r,s,null,h,f),s=null,n=n.slice(Y.to-v),v=Y.to}}}function mn(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 kn(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]),Wo(i[l+1],t.cm.options));return}for(var h=r.length,f=0,v=1,I="",Y,xe,pe=0,ze,Je,at,ft,bt;;){if(pe==f){ze=Je=at=xe="",bt=null,ft=null,pe=Infinity;for(var pt=[],kt=void 0,Vt=0;Vt<n.length;++Vt){var Ut=n[Vt],en=Ut.marker;if(en.type=="bookmark"&&Ut.from==f&&en.widgetNode)pt.push(en);else if(Ut.from<=f&&(Ut.to==null||Ut.to>f||en.collapsed&&Ut.to==f&&Ut.from==f)){if(Ut.to!=null&&Ut.to!=f&&pe>Ut.to&&(pe=Ut.to,Je=""),en.className&&(ze+=" "+en.className),en.css&&(xe=(xe?xe+";":"")+en.css),en.startStyle&&Ut.from==f&&(at+=" "+en.startStyle),en.endStyle&&Ut.to==pe&&(kt||(kt=[])).push(en.endStyle,Ut.to),en.title&&((bt||(bt={})).title=en.title),en.attributes)for(var In in en.attributes)(bt||(bt={}))[In]=en.attributes[In];en.collapsed&&(!ft||$n(ft.marker,en)<0)&&(ft=Ut)}else Ut.from>f&&pe>Ut.from&&(pe=Ut.from)}if(kt)for(var bi=0;bi<kt.length;bi+=2)kt[bi+1]==pe&&(Je+=" "+kt[bi]);if(!ft||ft.from==f)for(var Yn=0;Yn<pt.length;++Yn)mn(t,0,pt[Yn]);if(ft&&(ft.from||0)==f){if(mn(t,(ft.to==null?h+1:ft.to)-f,ft.marker,ft.from==null),ft.to==null)return;ft.to==f&&(ft=!1)}}if(f>=h)break;for(var Qi=Math.min(h,pe);;){if(I){var Ki=f+I.length;if(!ft){var ci=Ki>Qi?I.slice(0,Qi-f):I;t.addToken(t,ci,Y?Y+ze:ze,at,f+ci.length==pe?Je:"",xe,bt)}if(Ki>=Qi){I=I.slice(Qi-f),f=Qi;break}f=Ki,at=""}I=r.slice(s,s=i[v++]),Y=Wo(i[v++],t.cm.options)}}}function un(e,t,i){this.line=t,this.rest=Or(t),this.size=this.rest?ln(Ze(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Di(e,t)}function Un(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new un(e.doc,Mt(e.doc,s),s);r=s+l.size,n.push(l)}return n}var li=null;function tn(e){li?li.ops.push(e):e.ownsGroup=li={ops:[e],delayedCallbacks:[]}}function Cr(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 On(e,t){var i=e.ownsGroup;if(!i)return;try{Cr(i)}finally{li=null,t(i)}}var ui=null;function xn(e,t){var i=Dt(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;li?r=li.delayedCallbacks:ui?r=ui:(r=ui=[],setTimeout(Vi,0));for(var s=function(h){r.push(function(){return i[h].apply(null,n)})},l=0;l<i.length;++l)s(l)}function Vi(){var e=ui;ui=null;for(var t=0;t<e.length;++t)e[t]()}function lo(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?ba(e,t):s=="gutter"?Go(e,t,i,n):s=="class"?Vo(e,t):s=="widget"&&Ga(e,t,n)}t.changes=null}function uo(e){return e.node==e.text&&(e.node=L("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),S&&F<8&&(e.node.style.zIndex=2)),e.node}function Va(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=uo(t);t.background=n.insertBefore(L("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function zo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Co(e,t)}function ba(e,t){var i=t.text.className,n=zo(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,Vo(e,t)):i&&(t.text.className=i)}function Vo(e,t){Va(e,t),t.line.wrapClass?uo(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 Go(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=uo(t);t.gutterBackground=L("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=uo(t),h=t.gutter=L("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(h),l.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(L("div",pr(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var f=0;f<e.display.gutterSpecs.length;++f){var v=e.display.gutterSpecs[f].className,I=s.hasOwnProperty(v)&&s[v];I&&h.appendChild(L("div",[I],"CodeMirror-gutter-elt","left: "+n.gutterLeft[v]+"px; width: "+n.gutterWidth[v]+"px"))}}}function Ga(e,t,i){t.alignable&&(t.alignable=null);for(var n=Ce("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);Ko(e,t,i)}function Ca(e,t,i,n){var r=zo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),Vo(e,t),Go(e,t,i,n),Ko(e,t,n),t.node}function Ko(e,t,i){if(xa(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)xa(e,t.rest[n],t,i,!1)}function xa(e,t,i,n,r){if(!t.widgets)return;for(var s=uo(i),l=0,h=t.widgets;l<h.length;++l){var f=h[l],v=L("div",[f.node],"CodeMirror-linewidget"+(f.className?" "+f.className:""));f.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),Ka(f,v,i,n),e.display.input.setUneditable(v),r&&f.above?s.insertBefore(v,i.gutter||i.text):s.appendChild(v),xn(f,"redraw")}}function Ka(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 Jr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!k(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;"),me(t.display.measure,L("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function xr(e,t){for(var i=be(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 Xo(e){return e.lineSpace.offsetTop}function R(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function q(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=me(e.measure,L("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function oe(e){return rt-e.display.nativeBarWidth}function j(e){return e.display.scroller.clientWidth-oe(e)-e.display.barWidth}function m(e){return e.display.scroller.clientHeight-oe(e)-e.display.barHeight}function _(e,t,i){var n=e.options.lineWrapping,r=n&&j(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(),h=0;h<l.length-1;h++){var f=l[h],v=l[h+1];Math.abs(f.bottom-v.bottom)>2&&s.push((f.bottom+v.top)/2-i.top)}}s.push(i.bottom-i.top)}}function b(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(ln(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function B(e,t){t=Zn(t);var i=ln(t),n=e.display.externalMeasured=new un(e.doc,t,i);n.lineN=i;var r=n.built=Co(e,n);return n.text=r.pre,me(e.display.lineMeasure,r.pre),n}function z(e,t,i,n){return ge(e,ie(e,t),i,n)}function se(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[jn(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function ie(e,t){var i=ln(t),n=se(e,i);n&&!n.text?n=null:n&&n.changes&&(lo(e,n,i,Gn(e)),e.curOp.forceUpdate=!0),n||(n=B(e,t));var r=b(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function ge(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||(_(e,t.view,t.rect),t.hasHeights=!0),l=ct(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 je={left:0,right:0,top:0,bottom:0};function it(e,t,i){for(var n,r,s,l,h,f,v=0;v<e.length;v+=3)if(h=e[v],f=e[v+1],t<h?(r=0,s=1,l="left"):t<f?(r=t-h,s=r+1):(v==e.length-3||t==f&&e[v+3]>t)&&(s=f-h,r=s-1,t>=f&&(l="right")),r!=null){if(n=e[v+2],h==f&&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==f-h)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:h,coverEnd:f}}function nt(e,t){var i=je;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 ct(e,t,i,n){var r=it(t.map,i,n),s=r.node,l=r.start,h=r.end,f=r.collapse,v;if(s.nodeType==3){for(var I=0;I<4;I++){for(;l&&Ye(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+h<r.coverEnd&&Ye(t.line.text.charAt(r.coverStart+h));)++h;if(S&&F<9&&l==0&&h==r.coverEnd-r.coverStart?v=s.parentNode.getBoundingClientRect():v=nt(ve(s,l,h).getClientRects(),n),v.left||v.right||l==0)break;h=l,l=l-1,f="right"}S&&F<11&&(v=zt(e.display.measure,v))}else{l>0&&(f=n="right");var Y;e.options.lineWrapping&&(Y=s.getClientRects()).length>1?v=Y[n=="right"?Y.length-1:0]:v=s.getBoundingClientRect()}if(S&&F<9&&!l&&(!v||!v.left&&!v.right)){var xe=s.parentNode.getClientRects()[0];xe?v={left:xe.left,right:xe.left+fi(e.display),top:xe.top,bottom:xe.bottom}:v=je}for(var pe=v.top-t.rect.top,ze=v.bottom-t.rect.top,Je=(pe+ze)/2,at=t.view.measure.heights,ft=0;ft<at.length-1&&!(Je<at[ft]);ft++);var bt=ft?at[ft-1]:0,pt=at[ft],kt={left:(f=="right"?v.right:v.left)-t.rect.left,right:(f=="left"?v.left:v.right)-t.rect.left,top:bt,bottom:pt};return!v.left&&!v.right&&(kt.bogus=!0),e.options.singleCursorHeightPerLine||(kt.rtop=pe,kt.rbottom=ze),kt}function zt(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!En(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 Qt(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 Xt(e){e.display.externalMeasure=null,Fe(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Qt(e.display.view[t])}function $t(e){Xt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function qt(){return M&&W?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Jt(){return M&&W?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Yt(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=Jr(e.widgets[i]));return t}function hn(e,t,i,n,r){if(!r){var s=Yt(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=Oi(t);if(n=="local"?l+=Xo(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var h=e.display.lineSpace.getBoundingClientRect();l+=h.top+(n=="window"?0:Jt());var f=h.left+(n=="window"?0:qt());i.left+=f,i.right+=f}return i.top+=l,i.bottom+=l,i}function nn(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=qt(),r-=Jt();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 Fn(e,t,i,n,r){return n||(n=Mt(e.doc,t.line)),hn(e,n,z(e,n,t.ch,r),i)}function rn(e,t,i,n,r,s){n=n||Mt(e.doc,t.line),r||(r=ie(e,n));function l(ze,Je){var at=ge(e,r,ze,Je?"right":"left",s);return Je?at.left=at.right:at.right=at.left,hn(e,n,at,i)}var h=wt(n,e.doc.direction),f=t.ch,v=t.sticky;if(f>=n.text.length?(f=n.text.length,v="before"):f<=0&&(f=0,v="after"),!h)return l(v=="before"?f-1:f,v=="before");function I(ze,Je,at){var ft=h[Je],bt=ft.level==1;return l(at?ze-1:ze,bt!=at)}var Y=dt(h,f,v),xe=xt,pe=I(f,Y,v=="before");return xe!=null&&(pe.other=I(f,xe,v!="before")),pe}function Bt(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=fi(e.display)*t.ch);var n=Mt(e.doc,t.line),r=Oi(n)+Xo(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function It(e,t,i,n,r){var s=qe(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function sn(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return It(n.first,0,null,-1,-1);var r=Yi(n,i),s=n.first+n.size-1;if(r>s)return It(n.first+n.size-1,Mt(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=Mt(n,r);;){var h=Hn(e,l,r,t,i),f=yr(l,h.ch+(h.xRel>0||h.outside>0?1:0));if(!f)return h;var v=f.find(1);if(v.line==r)return v;l=Mt(n,r=v.line)}}function fn(e,t,i,n){n-=Yt(t);var r=t.text.length,s=Nt(function(l){return ge(e,i,l-1).bottom<=n},r,0);return r=Nt(function(l){return ge(e,i,l).top>n},s,r),{begin:s,end:r}}function Rt(e,t,i,n){i||(i=ie(e,t));var r=hn(e,t,ge(e,i,n),"line").top;return fn(e,t,i,r)}function gn(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Hn(e,t,i,n,r){r-=Oi(t);var s=ie(e,t),l=Yt(t),h=0,f=t.text.length,v=!0,I=wt(t,e.doc.direction);if(I){var Y=(e.options.lineWrapping?Ln:Cn)(e,t,i,s,I,n,r);v=Y.level!=1,h=v?Y.from:Y.to-1,f=v?Y.to:Y.from-1}var xe=null,pe=null,ze=Nt(function(Vt){var Ut=ge(e,s,Vt);return Ut.top+=l,Ut.bottom+=l,gn(Ut,n,r,!1)?(Ut.top<=r&&Ut.left<=n&&(xe=Vt,pe=Ut),!0):!1},h,f),Je,at,ft=!1;if(pe){var bt=n-pe.left<pe.right-n,pt=bt==v;ze=xe+(pt?0:1),at=pt?"after":"before",Je=bt?pe.left:pe.right}else{!v&&(ze==f||ze==h)&&ze++,at=ze==0?"after":ze==t.text.length?"before":ge(e,s,ze-(v?1:0)).bottom+l<=r==v?"after":"before";var kt=rn(e,qe(i,ze,at),"line",t,s);Je=kt.left,ft=r<kt.top?-1:r>=kt.bottom?1:0}return ze=lt(t.text,ze,1),It(i,ze,at,ft,n-Je)}function Cn(e,t,i,n,r,s,l){var h=Nt(function(Y){var xe=r[Y],pe=xe.level!=1;return gn(rn(e,qe(i,pe?xe.to:xe.from,pe?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),f=r[h];if(h>0){var v=f.level!=1,I=rn(e,qe(i,v?f.from:f.to,v?"after":"before"),"line",t,n);gn(I,s,l,!0)&&I.top>l&&(f=r[h-1])}return f}function Ln(e,t,i,n,r,s,l){var h=fn(e,t,n,l),f=h.begin,v=h.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var I=null,Y=null,xe=0;xe<r.length;xe++){var pe=r[xe];if(pe.from>=v||pe.to<=f)continue;var ze=pe.level!=1,Je=ge(e,n,ze?Math.min(v,pe.to)-1:Math.max(f,pe.from)).right,at=Je<s?s-Je+1e9:Je-s;(!I||Y>at)&&(I=pe,Y=at)}return I||(I=r[r.length-1]),I.from<f&&(I={from:f,to:I.to,level:I.level}),I.to>v&&(I={from:I.from,to:v,level:I.level}),I}var Tn;function Qn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Tn==null){Tn=L("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Tn.appendChild(document.createTextNode("x")),Tn.appendChild(L("br"));Tn.appendChild(document.createTextNode("x"))}me(e.measure,Tn);var i=Tn.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Fe(e.measure),i||1}function fi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=L("span","xxxxxxxxxx"),i=L("pre",[t],"CodeMirror-line-like");me(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Gn(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var h=e.display.gutterSpecs[l].className;i[h]=s.offsetLeft+s.clientLeft+r,n[h]=s.clientWidth}return{fixedPos:Mi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Mi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function er(e){var t=Qn(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/fi(e.display)-3);return function(r){if(Di(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 Pi(e){var t=e.doc,i=er(e);t.iter(function(n){var r=i(n);r!=n.height&&ki(n,r)})}function pi(e,t,i,n){var r=e.display;if(!i&&be(t).getAttribute("cm-not-content")=="true")return null;var s,l,h=r.lineSpace.getBoundingClientRect();try{s=t.clientX-h.left,l=t.clientY-h.top}catch(Y){return null}var f=sn(e,s,l),v;if(n&&f.xRel>0&&(v=Mt(e.doc,f.line).text).length==f.ch){var I=de(v,v.length,e.options.tabSize)-v.length;f=qe(f.line,Math.max(0,Math.round((s-q(e.display).left)/fi(e.display))-I))}return f}function jn(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 Dn(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)xi&&qi(e.doc,t)<r.viewTo&&Wn(e);else if(i<=r.viewFrom)xi&&br(e.doc,i+n)>r.viewFrom?Wn(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Wn(e);else if(t<=r.viewFrom){var s=tr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Wn(e)}else if(i>=r.viewTo){var l=tr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Wn(e)}else{var h=tr(e,t,t,-1),f=tr(e,i,i+n,1);h&&f?(r.view=r.view.slice(0,h.index).concat(Un(e,h.lineN,f.lineN)).concat(r.view.slice(f.index)),r.viewTo+=n):Wn(e)}var v=r.externalMeasured;v&&(i<v.lineN?v.lineN+=n:t<v.lineN+v.size&&(r.externalMeasured=null))}function Kn(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[jn(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);De(l,i)==-1&&l.push(i)}function Wn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function tr(e,t,i,n){var r=jn(e,t),s,l=e.display.view;if(!xi||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var h=e.display.viewFrom,f=0;f<r;f++)h+=l[f].size;if(h!=t){if(n>0){if(r==l.length-1)return null;s=h+l[r].size-t,r++}else s=h-t;t+=s,i+=s}for(;qi(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 Tr(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Un(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Un(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(jn(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Un(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,jn(e,i)))),n.viewTo=i}function Ar(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 An(e){e.display.input.showSelection(e.display.input.prepareSelection())}function dr(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 h=i.sel.ranges[l];if(h.from().line>=e.display.viewTo||h.to().line<e.display.viewFrom)continue;var f=h.empty();(f||e.options.showCursorWhenSelecting)&&Rr(e,h.head,r),f||Mn(e,h,s)}return n}function Rr(e,t,i){var n=rn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(L("div","\xA0","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var s=i.appendChild(L("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Nn(e,t){return e.top-t.top||e.left-t.left}function Mn(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=q(e.display),h=l.left,f=Math.max(n.sizerWidth,j(e)-n.sizer.offsetLeft)-l.right,v=r.direction=="ltr";function I(pt,kt,Vt,Ut){kt<0&&(kt=0),kt=Math.round(kt),Ut=Math.round(Ut),s.appendChild(L("div",null,"CodeMirror-selected","position: absolute; left: "+pt+`px;
|
|
top: `+kt+"px; width: "+(Vt==null?f-pt:Vt)+`px;
|
|
height: `+(Ut-kt)+"px"))}function Y(pt,kt,Vt){var Ut=Mt(r,pt),en=Ut.text.length,In,bi;function Yn(ci,Xi){return Fn(e,qe(pt,ci),"div",Ut,Xi)}function Qi(ci,Xi,Ei){var yi=Rt(e,Ut,null,ci),di=Xi=="ltr"==(Ei=="after")?"left":"right",qn=Ei=="after"?yi.begin:yi.end-(/\s/.test(Ut.text.charAt(yi.end-1))?2:1);return Yn(qn,di)[di]}var Ki=wt(Ut,r.direction);return _t(Ki,kt||0,Vt==null?en:Vt,function(ci,Xi,Ei,yi){var di=Ei=="ltr",qn=Yn(ci,di?"left":"right"),$i=Yn(Xi-1,di?"right":"left"),Bo=kt==null&&ci==0,ao=Vt==null&&Xi==en,Ai=yi==0,jr=!Ki||yi==Ki.length-1;if($i.top-qn.top<=3){var Ci=(v?Bo:ao)&&Ai,ps=(v?ao:Bo)&&jr,Vr=Ci?h:(di?qn:$i).left,go=ps?f:(di?$i:qn).right;I(Vr,qn.top,go-Vr,qn.bottom)}else{var vo,Ui,Fo,ms;di?(vo=v&&Bo&&Ai?h:qn.left,Ui=v?f:Qi(ci,Ei,"before"),Fo=v?h:Qi(Xi,Ei,"after"),ms=v&&ao&&jr?f:$i.right):(vo=v?Qi(ci,Ei,"before"):h,Ui=!v&&Bo&&Ai?f:qn.right,Fo=!v&&ao&&jr?h:$i.left,ms=v?Qi(Xi,Ei,"after"):f),I(vo,qn.top,Ui-vo,qn.bottom),qn.bottom<$i.top&&I(h,qn.bottom,null,$i.top),I(Fo,$i.top,ms-Fo,$i.bottom)}(!In||Nn(qn,In)<0)&&(In=qn),Nn($i,In)<0&&(In=$i),(!bi||Nn(qn,bi)<0)&&(bi=qn),Nn($i,bi)<0&&(bi=$i)}),{start:In,end:bi}}var xe=t.from(),pe=t.to();if(xe.line==pe.line)Y(xe.line,xe.ch,pe.ch);else{var ze=Mt(r,xe.line),Je=Mt(r,pe.line),at=Zn(ze)==Zn(Je),ft=Y(xe.line,xe.ch,at?ze.text.length+1:null).end,bt=Y(pe.line,at?0:null,pe.ch).start;at&&(ft.top<bt.top-2?(I(ft.right,ft.top,null,ft.bottom),I(h,bt.top,bt.left,bt.bottom)):I(ft.right,ft.top,bt.left-ft.right,ft.bottom)),ft.bottom<bt.top&&I(h,ft.bottom,null,bt.top)}i.appendChild(s)}function mi(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()||Zr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function wa(e){e.state.focused||(e.display.input.focus(),Lr(e))}function $o(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Zr(e))},100)}function Lr(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(We(e,"focus",e,t),e.state.focused=!0,le(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),U&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),mi(e)}function Zr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(We(e,"blur",e,t),e.state.focused=!1,Ee(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function xo(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,h=0;if(r.hidden)continue;if(S&&F<8){var f=r.node.offsetTop+r.node.offsetHeight;l=f-i,i=f}else{var v=r.node.getBoundingClientRect();l=v.bottom-v.top,!s&&r.text.firstChild&&(h=r.text.firstChild.getBoundingClientRect().right-v.left-1)}var I=r.line.height-l;if((I>.005||I<-.005)&&(ki(r.line,l),Yo(r.line),r.rest))for(var Y=0;Y<r.rest.length;Y++)Yo(r.rest[Y]);if(h>e.display.sizerWidth){var xe=Math.ceil(h/fi(e.display));xe>e.display.maxLineLength&&(e.display.maxLineLength=xe,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Yo(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 wo(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Xo(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=Yi(t,n),l=Yi(t,r);if(i&&i.ensure){var h=i.ensure.from.line,f=i.ensure.to.line;h<s?(s=h,l=Yi(t,Oi(Mt(t,h))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(s=Yi(t,Oi(Mt(t,f))-e.wrapper.clientHeight),l=f)}return{from:s,to:Math.max(l,s+1)}}function Xa(e,t){if(et(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&&!K){var s=L("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Xo(e.display))+`px;
|
|
height: `+(t.bottom-t.top+oe(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 $a(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?qe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?qe(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,h=rn(e,t),f=!i||i==t?h:rn(e,i);r={left:Math.min(h.left,f.left),top:Math.min(h.top,f.top)-n,right:Math.max(h.left,f.left),bottom:Math.max(h.bottom,f.bottom)+n};var v=Jo(e,r),I=e.doc.scrollTop,Y=e.doc.scrollLeft;if(v.scrollTop!=null&&(eo(e,v.scrollTop),Math.abs(e.doc.scrollTop-I)>1&&(l=!0)),v.scrollLeft!=null&&(nr(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-Y)>1&&(l=!0)),!l)break}return r}function Ea(e,t){var i=Jo(e,t);i.scrollTop!=null&&eo(e,i.scrollTop),i.scrollLeft!=null&&nr(e,i.scrollLeft)}function Jo(e,t){var i=e.display,n=Qn(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=m(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var h=e.doc.height+R(i),f=t.top<n,v=t.bottom>h-n;if(t.top<r)l.scrollTop=f?0:t.top;else if(t.bottom>r+s){var I=Math.min(t.top,(v?h:t.bottom)-s);I!=r&&(l.scrollTop=I)}var Y=e.options.fixedGutter?0:i.gutters.offsetWidth,xe=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-Y,pe=j(e)-i.gutters.offsetWidth,ze=t.right-t.left>pe;return ze&&(t.right=t.left+pe),t.left<10?l.scrollLeft=0:t.left<xe?l.scrollLeft=Math.max(0,t.left+Y-(ze?0:10)):t.right>pe+xe-3&&(l.scrollLeft=t.right+(ze?0:10)-pe),l}function Zo(e,t){if(t==null)return;Eo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qr(e){Eo(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function qr(e,t,i){(t!=null||i!=null)&&Eo(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Ya(e,t){Eo(e),e.curOp.scrollToPos=t}function Eo(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=Bt(e,t.from),n=Bt(e,t.to);co(e,i,n,t.margin)}}function co(e,t,i,n){var r=Jo(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});qr(e,r.scrollLeft,r.scrollTop)}function eo(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;V||po(e,{top:t}),to(e,t,!0),V&&po(e),fo(e,100)}function to(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 nr(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,cn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Ur(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+R(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+oe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Dr=function(e,t,i){this.cm=i;var n=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Ne(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ne(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,S&&F<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Dr.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}},Dr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Dr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Dr.prototype.zeroWidthHack=function(){var e=fe&&!Q?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ie,this.disableVert=new Ie},Dr.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)},Dr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ho=function(){};ho.prototype.update=function(){return{bottom:0,right:0}},ho.prototype.setScrollLeft=function(){},ho.prototype.setScrollTop=function(){},ho.prototype.clear=function(){};function Br(e,t){t||(t=Ur(e));var i=e.display.barWidth,n=e.display.barHeight;So(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&xo(e),So(e,Ur(e)),i=e.display.barWidth,n=e.display.barHeight}function So(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 Qo={native:Dr,null:ho};function ko(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Ee(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Qo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ne(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"?nr(e,t):eo(e,t)},e),e.display.scrollbars.addClass&&le(e.display.wrapper,e.display.scrollbars.addClass)}var qo=0;function Pr(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:++qo},tn(e.curOp)}function Fr(e){var t=e.curOp;t&&On(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;Sa(i)})}function Sa(e){for(var t=e.ops,i=0;i<t.length;i++)Ja(t[i]);for(var n=0;n<t.length;n++)Za(t[n]);for(var r=0;r<t.length;r++)Qa(t[r]);for(var s=0;s<t.length;s++)ea(t[s]);for(var l=0;l<t.length;l++)qa(t[l])}function Ja(e){var t=e.cm,i=t.display;ka(t),e.updateMaxLine&&cr(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 ir(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Za(e){e.updatedDisplay=e.mustUpdate&&Hr(e.cm,e.update)}function Qa(e){var t=e.cm,i=t.display;e.updatedDisplay&&xo(t),e.barMeasure=Ur(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=z(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+oe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-j(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function ea(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&nr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==G();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Br(t,e.barMeasure),e.updatedDisplay&&_n(t,e.barMeasure),e.selectionChanged&&mi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&wa(e.cm)}function qa(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&_o(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&to(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&nr(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=$a(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);Xa(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var h=0;h<s.length;++h)s[h].lines.length||We(s[h],"hide");if(l)for(var f=0;f<l.length;++f)l[f].lines.length&&We(l[f],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&We(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ni(e,t){if(e.curOp)return t();Pr(e);try{return t()}finally{Fr(e)}}function ni(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Pr(e);try{return t.apply(e,arguments)}finally{Fr(e)}}}function wi(e){return function(){if(this.curOp)return e.apply(this,arguments);Pr(this);try{return e.apply(this,arguments)}finally{Fr(this)}}}function ii(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Pr(t);try{return e.apply(this,arguments)}finally{Fr(t)}}}function fo(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,T(es,e))}function es(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=we(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,h=s.text.length>e.options.maxHighlightLength?Si(t.mode,n.state):null,f=J(e,s,n,!0);h&&(n.state=h),s.styles=f.styles;var v=s.styleClasses,I=f.classes;I?s.styleClasses=I:v&&(s.styleClasses=null);for(var Y=!l||l.length!=s.styles.length||v!=I&&(!v||!I||v.bgClass!=I.bgClass||v.textClass!=I.textClass),xe=0;!Y&&xe<l.length;++xe)Y=l[xe]!=s.styles[xe];Y&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&Ot(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return fo(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&Ni(e,function(){for(var s=0;s<r.length;s++)Kn(e,r[s],"text")})}var ir=function(e,t,i){var n=e.display;this.viewport=t,this.visible=wo(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=j(e),this.force=i,this.dims=Gn(e),this.events=[]};ir.prototype.signal=function(e,t){Z(e,t)&&this.events.push(arguments)},ir.prototype.finish=function(){for(var e=0;e<this.events.length;e++)We.apply(null,this.events[e])};function ka(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=oe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=oe(e)+"px",t.scrollbarsClipped=!0)}function _a(e){if(e.hasFocus())return null;var t=G();if(!t||!k(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&k(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function Oa(e){if(!e||!e.activeElt||e.activeElt==G())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&k(document.body,e.anchorNode)&&k(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 Hr(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Wn(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&&Ar(e)==0)return!1;gi(e)&&(Wn(e),t.dims=Gn(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)),xi&&(s=qi(e.doc,s),l=br(e.doc,l));var h=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Tr(e,s,l),i.viewOffset=Oi(Mt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var f=Ar(e);if(!h&&f==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=_a(e);return f>4&&(i.lineDiv.style.display="none"),Ma(e,i.updateLineNumbers,t.dims),f>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Oa(v),Fe(i.cursorDiv),Fe(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,h&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,fo(e,400)),i.updateLineNumbers=null,!0}function _o(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==j(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+R(e.display)-m(e),i.top)}),t.visible=wo(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=wo(e.display,e.doc,i));if(!Hr(e,t))break;xo(e);var r=Ur(e);An(e),Br(e,r),_n(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 po(e,t){var i=new ir(e,t);if(Hr(e,i)){xo(e),_o(e,i);var n=Ur(e);An(e),Br(e,n),_n(e,n),i.finish()}}function Ma(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function h(ze){var Je=ze.nextSibling;return U&&fe&&e.display.currentWheelTarget==ze?ze.style.display="none":ze.parentNode.removeChild(ze),Je}for(var f=n.view,v=n.viewFrom,I=0;I<f.length;I++){var Y=f[I];if(!Y.hidden)if(!Y.node||Y.node.parentNode!=s){var xe=Ca(e,Y,v,i);s.insertBefore(xe,l)}else{for(;l!=Y.node;)l=h(l);var pe=r&&t!=null&&t<=v&&Y.lineNumber;Y.changes&&(De(Y.changes,"gutter")>-1&&(pe=!1),lo(e,Y,v,i)),pe&&(Fe(Y.lineNumber),Y.lineNumber.appendChild(document.createTextNode(pr(e.options,v)))),l=Y.node.nextSibling}v+=Y.size}for(;l;)l=h(l)}function Oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function _n(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+oe(e)+"px"}function cn(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=Mi(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 h=i[l].alignable;if(h)for(var f=0;f<h.length;f++)h[f].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function gi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=pr(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(L("div",[L("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oo(e.display),!0}return!1}function ji(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 no(e){var t=e.gutters,i=e.gutterSpecs;Fe(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,h=t.appendChild(L("div",null,"CodeMirror-gutter "+s));l&&(h.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oo(e)}function wr(e){no(e.display),Dn(e),cn(e)}function mo(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=L("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=L("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=ke("div",null,"CodeMirror-code"),r.selectionDiv=L("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=L("div",null,"CodeMirror-cursors"),r.measure=L("div",null,"CodeMirror-measure"),r.lineMeasure=L("div",null,"CodeMirror-measure"),r.lineSpace=ke("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=ke("div",[r.lineSpace],"CodeMirror-lines");r.mover=L("div",[s],null,"position: relative"),r.sizer=L("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=L("div",null,null,"position: absolute; height: "+rt+"px; width: 1px;"),r.gutters=L("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=L("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=L("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),S&&F<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!U&&!(V&&ee)&&(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=ji(n.gutters,n.lineNumbers),no(r),i.init(r)}var Nr=0,vi=null;S?vi=-.53:V?vi=15:M?vi=-.7:te&&(vi=-1/3);function Mo(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 ta(e){var t=Mo(e);return t.x*=vi,t.y*=vi,t}function na(e,t){var i=Mo(t),n=i.x,r=i.y,s=e.display,l=s.scroller,h=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight;if(!(n&&h||r&&f))return;if(r&&fe&&U){e:for(var v=t.target,I=s.view;v!=l;v=v.parentNode)for(var Y=0;Y<I.length;Y++)if(I[Y].node==v){e.display.currentWheelTarget=v;break e}}if(n&&!V&&!O&&vi!=null){r&&f&&eo(e,Math.max(0,l.scrollTop+r*vi)),nr(e,Math.max(0,l.scrollLeft+n*vi)),(!r||r&&f)&&x(t),s.wheelStartX=null;return}if(r&&vi!=null){var xe=r*vi,pe=e.doc.scrollTop,ze=pe+s.wrapper.clientHeight;xe<0?pe=Math.max(0,pe+xe-50):ze=Math.min(e.doc.height,ze+xe+50),po(e,{top:pe,bottom:ze})}Nr<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 Je=l.scrollLeft-s.wheelStartX,at=l.scrollTop-s.wheelStartY,ft=at&&s.wheelDY&&at/s.wheelDY||Je&&s.wheelDX&&Je/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!ft)return;vi=(vi*Nr+ft)/(Nr+1),++Nr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Ii=function(e,t){this.ranges=e,this.primIndex=t};Ii.prototype.primary=function(){return this.ranges[this.primIndex]},Ii.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(!Ji(i.anchor,n.anchor)||!Ji(i.head,n.head))return!1}return!0},Ii.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wn(ar(this.ranges[t].anchor),ar(this.ranges[t].head));return new Ii(e,this.primIndex)},Ii.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ii.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ht(t,n.from())>=0&&Ht(e,n.to())<=0)return i}return-1};var wn=function(e,t){this.anchor=e,this.head=t};wn.prototype.from=function(){return gr(this.anchor,this.head)},wn.prototype.to=function(){return mr(this.anchor,this.head)},wn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function rr(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(xe,pe){return Ht(xe.from(),pe.from())}),i=De(t,r);for(var s=1;s<t.length;s++){var l=t[s],h=t[s-1],f=Ht(h.to(),l.from());if(n&&!l.empty()?f>0:f>=0){var v=gr(h.from(),l.from()),I=mr(h.to(),l.to()),Y=h.empty()?l.from()==l.head:h.from()==h.head;s<=i&&--i,t.splice(--s,2,new wn(Y?I:v,Y?v:I))}}return new Ii(t,i)}function Er(e,t){return new Ii([new wn(e,t||e)],0)}function Sr(e){return e.text?qe(e.from.line+e.text.length-1,Ze(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ia(e,t){if(Ht(e,t.from)<0)return e;if(Ht(e,t.to)<=0)return Sr(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+=Sr(t).ch-t.to.ch),qe(i,n)}function To(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new wn(ia(r.anchor,t),ia(r.head,t)))}return rr(e.cm,i,e.sel.primIndex)}function Ta(e,t,i){return e.line==t.line?qe(i.line,e.ch-t.ch+i.ch):qe(i.line+(e.line-t.line),e.ch)}function Aa(e,t,i){for(var n=[],r=qe(e.first,0),s=r,l=0;l<t.length;l++){var h=t[l],f=Ta(h.from,r,s),v=Ta(Sr(h),r,s);if(r=h.to,s=v,i=="around"){var I=e.sel.ranges[l],Y=Ht(I.head,I.anchor)<0;n[l]=new wn(Y?v:f,Y?f:v)}else n[l]=new wn(f,f)}return new Ii(n,e.sel.primIndex)}function Wr(e){e.doc.mode=hi(e.options,e.doc.modeOption),ra(e)}function ra(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,fo(e,100),e.state.modeGen++,e.curOp&&Dn(e)}function gs(e,t){return t.from.ch==0&&t.to.ch==0&&Ze(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ts(e,t,i,n){function r(bt){return i?i[bt]:null}function s(bt,pt,kt){Ho(bt,pt,kt,n),xn(bt,"change",bt,t)}function l(bt,pt){for(var kt=[],Vt=bt;Vt<pt;++Vt)kt.push(new Mr(v[Vt],r(Vt),n));return kt}var h=t.from,f=t.to,v=t.text,I=Mt(e,h.line),Y=Mt(e,f.line),xe=Ze(v),pe=r(v.length-1),ze=f.line-h.line;if(t.full)e.insert(0,l(0,v.length)),e.remove(v.length,e.size-v.length);else if(gs(e,t)){var Je=l(0,v.length-1);s(Y,Y.text,pe),ze&&e.remove(h.line,ze),Je.length&&e.insert(h.line,Je)}else if(I==Y)if(v.length==1)s(I,I.text.slice(0,h.ch)+xe+I.text.slice(f.ch),pe);else{var at=l(1,v.length-1);at.push(new Mr(xe+I.text.slice(f.ch),pe,n)),s(I,I.text.slice(0,h.ch)+v[0],r(0)),e.insert(h.line+1,at)}else if(v.length==1)s(I,I.text.slice(0,h.ch)+v[0]+Y.text.slice(f.ch),r(0)),e.remove(h.line+1,ze);else{s(I,I.text.slice(0,h.ch)+v[0],r(0)),s(Y,xe+Y.text.slice(f.ch),pe);var ft=l(1,v.length-1);ze>1&&e.remove(h.line+1,ze-1),e.insert(h.line+1,ft)}xn(e,"change",e,t)}function io(e,t,i){function n(r,s,l){if(r.linked)for(var h=0;h<r.linked.length;++h){var f=r.linked[h];if(f.doc==s)continue;var v=l&&f.sharedHist;if(i&&!v)continue;t(f.doc,v),n(f.doc,r,v)}}n(e,null,!0)}function vs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Pi(e),Wr(e),ys(e),e.options.lineWrapping||cr(e),e.options.mode=t.modeOption,Dn(e)}function ys(e){(e.doc.direction=="rtl"?le:Ee)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Ni(e,function(){ys(e),Dn(e)})}function Ra(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 ns(e,t){var i={from:ar(t.from),to:Sr(t),text:Fi(e,t.from,t.to)};return xs(e,i,t.from.line,t.to.line+1),io(e,function(n){return xs(n,i,t.from.line,t.to.line+1)},!0),i}function bs(e){for(;e.length;){var t=Ze(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return bs(e.done),Ze(e.done);if(e.done.length&&!Ze(e.done).ranges)return Ze(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ze(e.done)}function Cs(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,h;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)))h=Ze(l.changes),Ht(t.from,t.to)==0&&Ht(t.from,h.to)==0?h.to=Sr(t):l.changes.push(ns(e,t));else{var f=Ze(r.done);for((!f||!f.ranges)&&La(e.sel,r.done),l={changes:[ns(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,h||We(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,Ze(r.done),t))?r.done[r.done.length-1]=t:La(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&bs(r.undone)}function La(e,t){var i=Ze(t);i&&i.ranges&&i.equals(e)||t.push(e)}function xs(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 ws(e,t){var i=yl(e,t),n=Li(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 h=0;h<l.length;++h){for(var f=l[h],v=0;v<s.length;++v)if(s[v].marker==f.marker)continue e;s.push(f)}}else l&&(i[r]=l)}return i}function Ao(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Ii.prototype.deepCopy.call(s):s);continue}var l=s.changes,h=[];n.push({changes:h});for(var f=0;f<l.length;++f){var v=l[f],I=void 0;if(h.push({from:v.from,to:v.to,text:v.text}),t)for(var Y in v)(I=Y.match(/^spans_(\d+)$/))&&(De(t,Number(I[1]))>-1&&(Ze(h)[Y]=v[Y],delete v[Y]))}}return n}function is(e,t,i,n){if(n){var r=e.anchor;if(i){var s=Ht(t,r)<0;s!=Ht(i,r)<0?(r=t,t=i):s!=Ht(t,i)<0&&(t=i)}return new wn(r,t)}else return new wn(i||t,t)}function Da(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Ti(e,new Ii([is(e.sel.primary(),t,i,r)],0),n)}function Es(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]=is(e.sel.ranges[s],t[s],null,r);var l=rr(e.cm,n,e.sel.primIndex);Ti(e,l,i)}function rs(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Ti(e,rr(e.cm,r,e.sel.primIndex),n)}function Ss(e,t,i,n){Ti(e,Er(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 wn(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return We(e,"beforeSelectionChange",e,n),e.cm&&We(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?rr(e.cm,n.ranges,n.ranges.length-1):t}function ks(e,t,i){var n=e.history.done,r=Ze(n);r&&r.ranges?(n[n.length-1]=t,Pa(e,t,i)):Ti(e,t,i)}function Ti(e,t,i){Pa(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Pa(e,t,i){(Z(e,"beforeSelectionChange")||e.cm&&Z(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ht(t.primary().head,e.sel.primary().head)<0?-1:1);_s(e,Ms(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Qr(e.cm)}function _s(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ae(e.cm)),xn(e,"cursorActivity",e)}function Os(e){_s(e,Ms(e,e.sel,null,!1))}function Ms(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],f=Na(e,l.anchor,h&&h.anchor,i,n),v=Na(e,l.head,h&&h.head,i,n);(r||f!=l.anchor||v!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new wn(f,v))}return r?rr(e.cm,r,t.primIndex):t}function Ro(e,t,i,n,r){var s=Mt(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var h=s.markedSpans[l],f=h.marker,v="selectLeft"in f?!f.selectLeft:f.inclusiveLeft,I="selectRight"in f?!f.selectRight:f.inclusiveRight;if((h.from==null||(v?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(I?h.to>=t.ch:h.to>t.ch))){if(r&&(We(f,"beforeCursorEnter"),f.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!f.atomic)continue;if(i){var Y=f.find(n<0?1:-1),xe=void 0;if((n<0?I:v)&&(Y=Ts(e,Y,-n,Y&&Y.line==t.line?s:null)),Y&&Y.line==t.line&&(xe=Ht(Y,i))&&(n<0?xe<0:xe>0))return Ro(e,Y,t,n,r)}var pe=f.find(n<0?-1:1);return(n<0?v:I)&&(pe=Ts(e,pe,n,pe.line==t.line?s:null)),pe?Ro(e,pe,t,n,r):null}}return t}function Na(e,t,i,n,r){var s=n||1,l=Ro(e,t,i,s,r)||!r&&Ro(e,t,i,s,!0)||Ro(e,t,i,-s,r)||!r&&Ro(e,t,i,-s,!0);return l||(e.cantEdit=!0,qe(e.first,0))}function Ts(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,qe(t.line-1)):null:i>0&&t.ch==(n||Mt(e,t.line)).text.length?t.line<e.first+e.size-1?qe(t.line+1,0):null:new qe(t.line,t.ch+i)}function As(e){e.setSelection(qe(e.firstLine(),0),qe(e.lastLine()),He)}function Rs(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,h){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),h!==void 0&&(n.origin=h)}),We(e,"beforeChange",e,n),e.cm&&We(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 Lo(e,t,i){if(e.cm){if(!e.cm.curOp)return ni(e.cm,Lo)(e,t,i);if(e.cm.state.suppressEdits)return}if((Z(e,"beforeChange")||e.cm&&Z(e.cm,"beforeChange"))&&(t=Rs(e,t,!0),!t))return;var n=Gr&&!i&&_r(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Ls(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Ls(e,t)}function Ls(e,t){if(t.text.length==1&&t.text[0]==""&&Ht(t.from,t.to)==0)return;var i=To(e,t);Cs(e,t,i,e.cm?e.cm.curOp.id:NaN),oa(e,t,i,Li(e,t));var n=[];io(e,function(r,s){!s&&De(n,r.history)==-1&&(js(r.history,t),n.push(r.history)),oa(r,t,null,Li(r,t))})}function ja(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,h=t=="undo"?r.done:r.undone,f=t=="undo"?r.undone:r.done,v=0;v<h.length&&!(s=h[v],i?s.ranges&&!s.equals(e.sel):!s.ranges);v++);if(v==h.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=h.pop(),s.ranges){if(La(s,f),i&&!s.equals(e.sel)){Ti(e,s,{clearRedo:!1});return}l=s}else if(n){h.push(s);return}else break;var I=[];La(l,f),f.push({changes:I,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var Y=Z(e,"beforeChange")||e.cm&&Z(e.cm,"beforeChange"),xe=function(Je){var at=s.changes[Je];if(at.origin=t,Y&&!Rs(e,at,!1))return h.length=0,{};I.push(ns(e,at));var ft=Je?To(e,at):Ze(h);oa(e,at,ft,ws(e,at)),!Je&&e.cm&&e.cm.scrollIntoView({from:at.from,to:Sr(at)});var bt=[];io(e,function(pt,kt){!kt&&De(bt,pt.history)==-1&&(js(pt.history,at),bt.push(pt.history)),oa(pt,at,null,ws(pt,at))})},pe=s.changes.length-1;pe>=0;--pe){var ze=xe(pe);if(ze)return ze.v}}function Ds(e,t){if(t==0)return;if(e.first+=t,e.sel=new Ii(mt(e.sel.ranges,function(r){return new wn(qe(r.anchor.line+t,r.anchor.ch),qe(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Dn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Kn(e.cm,n,"gutter")}}function oa(e,t,i,n){if(e.cm&&!e.cm.curOp)return ni(e.cm,oa)(e,t,i,n);if(t.to.line<e.first){Ds(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);Ds(e,r),t={from:qe(e.first,0),to:qe(t.to.line+r,t.to.ch),text:[Ze(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:qe(s,Mt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Fi(e,t.from,t.to),i||(i=To(e,t)),e.cm?Cl(e.cm,t,n):ts(e,t,n),Pa(e,i,He),e.cantEdit&&Na(e,qe(e.firstLine(),0))&&(e.cantEdit=!1)}function Cl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,h=!1,f=s.line;e.options.lineWrapping||(f=ln(Zn(Mt(n,s.line))),n.iter(f,l.line+1,function(pe){if(pe==r.maxLine)return h=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ae(e),ts(n,t,i,er(e)),e.options.lineWrapping||(n.iter(f,s.line+t.text.length,function(pe){var ze=Yr(pe);ze>r.maxLineLength&&(r.maxLine=pe,r.maxLineLength=ze,r.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),Zi(n,s.line),fo(e,400);var v=t.text.length-(l.line-s.line)-1;t.full?Dn(e):s.line==l.line&&t.text.length==1&&!gs(e.doc,t)?Kn(e,s.line,"text"):Dn(e,s.line,l.line+1,v);var I=Z(e,"changes"),Y=Z(e,"change");if(Y||I){var xe={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};Y&&xn(e,"change",e,xe),I&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(xe)}e.display.selForContextMenu=null}function Do(e,t,i,n,r){var s;n||(n=i),Ht(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),Lo(e,{from:i,to:n,text:t,origin:r})}function Ps(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ns(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 h=0;h<s.ranges.length;h++)Ps(s.ranges[h].anchor,t,i,n),Ps(s.ranges[h].head,t,i,n);continue}for(var f=0;f<s.changes.length;++f){var v=s.changes[f];if(i<v.from.line)v.from=qe(v.from.line+n,v.from.ch),v.to=qe(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 js(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;Ns(e.done,i,n,r),Ns(e.undone,i,n,r)}function aa(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=Mt(e,d(e,t)):r=ln(t),r==null?null:(n(s,r)&&e.cm&&Kn(e.cm,r,i),s)}function sa(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}sa.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,yo(r),xn(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 la(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}la.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 sa))){var h=[];this.collapse(h),this.children=[new sa(h)],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,h=l;h<r.lines.length;){var f=new sa(r.lines.slice(h,h+=25));r.height-=f.height,this.children.splice(++n,0,f),f.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 la(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=De(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new la(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 ua=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};ua.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=ln(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=Jr(this);ki(i,Math.max(0,i.height-s)),e&&(Ni(e,function(){Is(e,i,-s),Kn(e,n,"widget")}),xn(e,"lineWidgetCleared",e,this,n))},ua.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=Jr(this)-t;if(!r)return;Di(this.doc,n)||ki(n,n.height+r),i&&Ni(i,function(){i.curOp.forceUpdate=!0,Is(i,n,r),xn(i,"lineWidgetChanged",i,e,ln(n))})},ne(ua);function Is(e,t,i){Oi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Zo(e,i)}function xl(e,t,i,n){var r=new ua(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),aa(e,t,"widget",function(l){var h=l.widgets||(l.widgets=[]);if(r.insertAt==null?h.push(r):h.splice(Math.min(h.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!Di(e,l)){var f=Oi(l)<e.scrollTop;ki(l,l.height+Jr(r)),f&&Zo(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&xn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:ln(t)),r}var Us=0,ro=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Us};ro.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Pr(e),Z(this,"clear")){var i=this.find();i&&xn(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],h=Wi(l.markedSpans,this);e&&!this.collapsed?Kn(e,ln(l),"text"):e&&(h.to!=null&&(r=ln(l)),h.from!=null&&(n=ln(l))),l.markedSpans=lr(l.markedSpans,h),h.from==null&&this.collapsed&&!Di(this.doc,l)&&e&&ki(l,Qn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var v=Zn(this.lines[f]),I=Yr(v);I>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=I,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Dn(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Os(e.doc)),e&&xn(e,"markerCleared",e,this,n,r),t&&Fr(e),this.parent&&this.parent.clear()},ro.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=Wi(s.markedSpans,this);if(l.from!=null&&(i=qe(t?s:ln(s),l.from),e==-1))return i;if(l.to!=null&&(n=qe(t?s:ln(s),l.to),e==1))return n}return i&&{from:i,to:n}},ro.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Ni(n,function(){var r=t.line,s=ln(t.line),l=se(n,s);if(l&&(Qt(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Di(i.doc,r)&&i.height!=null){var h=i.height;i.height=null;var f=Jr(i)-h;f&&ki(r,r.height+f)}xn(n,"markerChanged",n,e)})},ro.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||De(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ro.prototype.detachLine=function(e){if(this.lines.splice(De(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ne(ro);function Po(e,t,i,n,r){if(n&&n.shared)return wl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return ni(e.cm,Po)(e,t,i,n,r);var s=new ro(e,r),l=Ht(t,i);if(n&&g(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=ke("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(ti(e,t.line,t,i,s)||t.line!=i.line&&ti(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");sr()}s.addToHistory&&Cs(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var h=t.line,f=e.cm,v;if(e.iter(h,i.line+1,function(Y){f&&s.collapsed&&!f.options.lineWrapping&&Zn(Y)==f.display.maxLine&&(v=!0),s.collapsed&&h!=t.line&&ki(Y,0),zi(Y,new vr(s,h==t.line?t.ch:null,h==i.line?i.ch:null)),++h}),s.collapsed&&e.iter(t.line,i.line+1,function(Y){Di(e,Y)&&ki(Y,0)}),s.clearOnEnter&&Ne(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(_i(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Us,s.atomic=!0),f){if(v&&(f.curOp.updateMaxLine=!0),s.collapsed)Dn(f,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var I=t.line;I<=i.line;I++)Kn(f,I,"text");s.atomic&&Os(f.doc),xn(f,"markerAdded",f,s)}return s}var ca=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};ca.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();xn(this,"clear")},ca.prototype.find=function(e,t){return this.primary.find(e,t)},ne(ca);function wl(e,t,i,n,r){n=g(n),n.shared=!1;var s=[Po(e,t,i,n,r)],l=s[0],h=n.widgetNode;return io(e,function(f){h&&(n.widgetNode=h.cloneNode(!0)),s.push(Po(f,o(f,t),o(f,i),n,r));for(var v=0;v<f.linked.length;++v)if(f.linked[v].isParent)return;l=Ze(s)}),new ca(s,l)}function Bs(e){return e.findMarks(qe(e.first,0),e.clipPos(qe(e.lastLine())),function(t){return t.parent})}function El(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(Ht(s,l)){var h=Po(e,s,l,n.primary,n.primary.type);n.markers.push(h),h.parent=n}}}function Sl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];io(r.primary.doc,function(f){return s.push(f)});for(var l=0;l<r.markers.length;l++){var h=r.markers[l];De(s,h.doc)==-1&&(h.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var kl=0,Gi=function(e,t,i,n,r){if(!(this instanceof Gi))return new Gi(e,t,i,n,r);i==null&&(i=0),la.call(this,[new sa([new Mr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=qe(i,0);this.sel=Er(s),this.history=new Ra(null),this.id=++kl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ts(this,{from:s,to:s,text:e}),Ti(this,Er(s),He)};Gi.prototype=st(la.prototype,{constructor:Gi,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=hr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ii(function(e){var t=qe(this.first,0),i=this.first+this.size-1;Lo(this,{from:t,to:qe(i,Mt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&qr(this.cm,0,0),Ti(this,Er(t),He)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,Do(this,e,t,i,n)},getRange:function(e,t,i){var n=Fi(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(fr(this,e))return Mt(this,e)},getLineNumber:function(e){return ln(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Mt(this,e)),Zn(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:ii(function(e,t,i){Ss(this,o(this,typeof e=="number"?qe(e,t||0):e),null,i)}),setSelection:ii(function(e,t,i){Ss(this,o(this,e),o(this,t||e),i)}),extendSelection:ii(function(e,t,i){Da(this,o(this,e),t&&o(this,t),i)}),extendSelections:ii(function(e,t){Es(this,u(this,e),t)}),extendSelectionsBy:ii(function(e,t){var i=mt(this.sel.ranges,e);Es(this,u(this,i),t)}),setSelections:ii(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new wn(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ti(this,rr(this.cm,n,t),i)}),addSelection:ii(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new wn(o(this,e),o(this,t||e))),Ti(this,rr(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=Fi(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=Fi(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:ii(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 h=t&&t!="end"&&Aa(this,n,t),f=n.length-1;f>=0;f--)Lo(this,n[f]);h?ks(this,h):this.cm&&Qr(this.cm)}),undo:ii(function(){ja(this,"undo")}),redo:ii(function(){ja(this,"redo")}),undoSelection:ii(function(){ja(this,"undo",!0)}),redoSelection:ii(function(){ja(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 Ra(this.history.maxGeneration),io(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:Ao(this.history.done),undone:Ao(this.history.undone)}},setHistory:function(e){var t=this.history=new Ra(this.history.maxGeneration);t.done=Ao(e.done.slice(0),null,!0),t.undone=Ao(e.undone.slice(0),null,!0)},setGutterMarker:ii(function(e,t,i){return aa(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Se(r)&&(n.gutterMarkers=null),!0})}),clearGutter:ii(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&aa(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Se(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!fr(this,e))return null;if(t=e,e=Mt(this,e),!e)return null}else if(t=ln(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:ii(function(e,t,i){return aa(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(Ce(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:ii(function(e,t,i){return aa(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(Ce(i));if(!l)return!1;var h=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||h==s.length?"":" ")+s.slice(h)||null}else return!1;return!0})}),addLineWidget:ii(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Po(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),Po(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=Mt(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 h=0;h<l.length;h++){var f=l[h];!(f.to!=null&&r==e.line&&e.ch>=f.to||f.from==null&&r!=e.line||f.from!=null&&r==t.line&&f.from>=t.ch)&&(!i||i(f.marker))&&n.push(f.marker.parent||f.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,qe(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 Gi(hr(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 Gi(hr(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}],El(n,Bs(this)),n},unlinkDoc:function(e){if(e instanceof Xn&&(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),Sl(Bs(this));break}if(e.history==this.history){var n=[e.id];io(e,function(r){return n.push(r.id)},!0),e.history=new Ra(null),e.history.done=Ao(this.history.done,n),e.history.undone=Ao(this.history.undone,n)}},iterLinkedDocs:function(e){io(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):St(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:ii(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)})}),Gi.prototype.eachLine=Gi.prototype.iter;var Fs=0;function _l(e){var t=this;if(Hs(t),et(t,e)||xr(t.display,e))return;x(e),S&&(Fs=+new Date);var i=pi(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,h=function(){++l==r&&ni(t,function(){i=o(t.doc,i);var pe={from:i,to:i,text:t.doc.splitLines(s.filter(function(ze){return ze!=null}).join(t.doc.lineSeparator())),origin:"paste"};Lo(t.doc,pe),ks(t.doc,Er(o(t.doc,i),o(t.doc,Sr(pe))))})()},f=function(pe,ze){if(t.options.allowDropFileTypes&&De(t.options.allowDropFileTypes,pe.type)==-1){h();return}var Je=new FileReader;Je.onerror=function(){return h()},Je.onload=function(){var at=Je.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(at)){h();return}s[ze]=at,h()},Je.readAsText(pe)},v=0;v<n.length;v++)f(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 I=e.dataTransfer.getData("Text");if(I){var Y;if(t.state.draggingText&&!t.state.draggingText.copy&&(Y=t.listSelections()),Pa(t.doc,Er(i,i)),Y)for(var xe=0;xe<Y.length;++xe)Do(t.doc,"",Y[xe].anchor,Y[xe].head,"drag");t.replaceSelection(I,"around","paste"),t.display.input.focus()}}catch(pe){}}}function Ol(e,t){if(S&&(!e.state.draggingText||+new Date-Fs<100)){P(t);return}if(et(e,t)||xr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!te){var i=L("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",O&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),O&&i.parentNode.removeChild(i)}}function Ml(e,t){var i=pi(e,t);if(!i)return;var n=document.createDocumentFragment();Rr(e,i,n),e.display.dragCursor||(e.display.dragCursor=L("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),me(e.display.dragCursor,n)}function Hs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ws(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 zs=!1;function Tl(){if(zs)return;Al(),zs=!0}function Al(){var e;Ne(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ws(Rl)},100))}),Ne(window,"blur",function(){return Ws(Zr)})}function Rl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var oo={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"},da=0;da<10;da++)oo[da+48]=oo[da+96]=String(da);for(var Ia=65;Ia<=90;Ia++)oo[Ia]=String.fromCharCode(Ia);for(var ha=1;ha<=12;ha++)oo[ha+111]=oo[ha+63235]="F"+ha;var zr={};zr.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"},zr.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"},zr.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"},zr.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"]},zr.default=fe?zr.macDefault:zr.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var h=t[l];if(/^(cmd|meta|m)$/i.test(h))s=!0;else if(/^a(lt)?$/i.test(h))i=!0;else if(/^(c|ctrl|control)$/i.test(h))n=!0;else if(/^s(hift)?$/i.test(h))r=!0;else throw new Error("Unrecognized modifier name: "+h)}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=mt(i.split(" "),Ll),s=0;s<r.length;s++){var l=void 0,h=void 0;s==r.length-1?(h=r.join(" "),l=n):(h=r.slice(0,s+1).join(" "),l="...");var f=t[h];if(!f)t[h]=l;else if(f!=l)throw new Error("Inconsistent bindings for "+h)}delete e[i]}for(var v in t)e[v]=t[v];return e}function No(e,t,i,n){t=Ua(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 No(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=No(e,t.fallthrough[s],i,n);if(l)return l}}}function Vs(e){var t=typeof e=="string"?e:oo[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Gs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ye?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ye?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Ks(e,t){if(O&&e.keyCode==34&&e.char)return!1;var i=oo[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Gs(i,e,t))}function Ua(e){return typeof e=="string"?zr[e]:e}function jo(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&Ht(s.from,Ze(n).to)<=0;){var l=n.pop();if(Ht(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}Ni(e,function(){for(var h=n.length-1;h>=0;h--)Do(e.doc,"",n[h].from,n[h].to,"+delete");Qr(e)})}function os(e,t,i){var n=lt(e.text,t+i,i);return n<0||n>e.text.length?null:n}function as(e,t,i){var n=os(e,t.ch,i);return n==null?null:new qe(t.line,n,i<0?"after":"before")}function ss(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=wt(i,t.doc.direction);if(s){var l=r<0?Ze(s):s[0],h=r<0==(l.level==1),f=h?"after":"before",v;if(l.level>0||t.doc.direction=="rtl"){var I=ie(t,i);v=r<0?i.text.length-1:0;var Y=ge(t,I,v).top;v=Nt(function(xe){return ge(t,I,xe).top==Y},r<0==(l.level==1)?l.from:l.to-1,v),f=="before"&&(v=os(i,v,1))}else v=r<0?l.to:l.from;return new qe(n,v,f)}}return new qe(n,r<0?i.text.length:0,r<0?"before":"after")}function Pl(e,t,i,n){var r=wt(t,e.doc.direction);if(!r)return as(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=dt(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 as(t,i,n);var h=function(ft,bt){return os(t,ft instanceof qe?ft.ch:ft,bt)},f,v=function(ft){return e.options.lineWrapping?(f=f||ie(e,t),Rt(e,t,f,ft)):{begin:0,end:t.text.length}},I=v(i.sticky=="before"?h(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var Y=l.level==1==n<0,xe=h(i,Y?1:-1);if(xe!=null&&(Y?xe<=l.to&&xe<=I.end:xe>=l.from&&xe>=I.begin)){var pe=Y?"before":"after";return new qe(i.line,xe,pe)}}var ze=function(ft,bt,pt){for(var kt=function(In,bi){return bi?new qe(i.line,h(In,1),"before"):new qe(i.line,In,"after")};ft>=0&&ft<r.length;ft+=bt){var Vt=r[ft],Ut=bt>0==(Vt.level!=1),en=Ut?pt.begin:h(pt.end,-1);if(Vt.from<=en&&en<Vt.to)return kt(en,Ut);if(en=Ut?Vt.from:h(Vt.to,-1),pt.begin<=en&&en<pt.end)return kt(en,Ut)}},Je=ze(s+n,n,I);if(Je)return Je;var at=n>0?I.end:h(I.begin,-1);return at!=null&&!(n>0&&at==t.text.length)&&(Je=ze(n>0?0:r.length-1,n,v(at)),Je)?Je:null}var fa={selectAll:As,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),He)},killLine:function(e){return jo(e,function(t){if(t.empty()){var i=Mt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:qe(t.head.line+1,0)}:{from:t.head,to:qe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return jo(e,function(t){return{from:qe(t.from().line,0),to:o(e.doc,qe(t.to().line+1,0))}})},delLineLeft:function(e){return jo(e,function(t){return{from:qe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return jo(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 jo(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(qe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(qe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Xs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return $s(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")},Pe)},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")},Pe)},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/)?$s(e,t.head):n},Pe)},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=de(e.getLine(s.line),s.ch,n);t.push(D(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ni(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=Mt(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new qe(r.line,r.ch-1)),r.ch>0)r=new qe(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),qe(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=Mt(e.doc,r.line-1).text;l&&(r=new qe(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),qe(r.line-1,l.length-1),r,"+transpose"))}}i.push(new wn(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Ni(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);Qr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Xs(e,t){var i=Mt(e.doc,t),n=Zn(i);return n!=i&&(t=ln(n)),ss(!0,e,n,t,1)}function Nl(e,t){var i=Mt(e.doc,t),n=ur(i);return n!=i&&(t=ln(n)),ss(!0,e,i,t,-1)}function $s(e,t){var i=Xs(e,t.line),n=Mt(e.doc,i.line),r=wt(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 qe(i.line,l?0:s,i.sticky)}return i}function Ba(e,t,i){if(typeof t=="string"&&(t=fa[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)!=ot}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function jl(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=No(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&No(t,e.options.extraKeys,i,e)||No(t,e.options.keyMap,i,e)}var Il=new Ie;function pa(e,t,i,n){var r=e.state.keySeq;if(r){if(Vs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Il.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),Ys(e,r+" "+t,i,n))return!0}return Ys(e,t,i,n)}function Ys(e,t,i,n){var r=jl(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&xn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(x(i),mi(e)),!!r}function Js(e,t){var i=Ks(t,!0);return i?t.shiftKey&&!e.state.keySeq?pa(e,"Shift-"+i,t,function(n){return Ba(e,n,!0)})||pa(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Ba(e,n)}):pa(e,i,t,function(n){return Ba(e,n)}):!1}function Ul(e,t,i){return pa(e,"'"+i+"'",t,function(n){return Ba(e,n,!0)})}var ls=null;function Zs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=G(),et(t,e))return;S&&F<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Js(t,e);O&&(ls=n?i:null,!n&&i==88&&!on&&(fe?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),V&&!fe&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Bl(t)}function Bl(e){var t=e.display.lineDiv;le(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(Ee(t,"CodeMirror-crosshair"),yt(document,"keyup",i),yt(document,"mouseover",i))}Ne(document,"keyup",i),Ne(document,"mouseover",i)}function Qs(e){e.keyCode==16&&(this.doc.sel.shift=!1),et(this,e)}function qs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(xr(t.display,e)||et(t,e)||e.ctrlKey&&!e.altKey||fe&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(O&&i==ls){ls=null,x(e);return}if(O&&(!e.which||e.which<10)&&Js(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Ul(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,us=function(e,t,i){this.time=e,this.pos=t,this.button=i};us.prototype.compare=function(e,t,i){return this.time+Fl>e&&Ht(t,this.pos)==0&&i==this.button};var ma,ga;function Hl(e,t){var i=+new Date;return ga&&ga.compare(i,e,t)?(ma=ga=null,"triple"):ma&&ma.compare(i,e,t)?(ga=new us(i,e,t),ma=null,"double"):(ma=new us(i,e,t),ga=null,"single")}function el(e){var t=this,i=t.display;if(et(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,xr(i,e)){U||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(cs(t,e))return;var n=pi(t,e),r=Te(e),s=n?Hl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,r,n,s,e))return;r==1?n?Vl(t,n,s,e):be(e)==i.scroller&&x(e):r==2?(n&&Da(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(Ae?t.display.input.onContextMenu(e):$o(t))}function Wl(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,pa(e,Gs(s,r),r,function(l){if(typeof l=="string"&&(l=fa[l]),!l)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=l(e,i)!=ot}finally{e.state.suppressEdits=!1}return h})}function zl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=Re?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=fe?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(fe?i.altKey:i.ctrlKey)),r}function Vl(e,t,i,n){S?setTimeout(T(wa,e),0):e.curOp.focus=G();var r=zl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&Xe&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(Ht((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(Ht(l.to(),t)>0||t.xRel<0)?Gl(e,n,t,r):Kl(e,n,t,r)}function Gl(e,t,i,n){var r=e.display,s=!1,l=ni(e,function(v){U&&(r.scroller.draggable=!1),e.state.draggingText=!1,yt(r.wrapper.ownerDocument,"mouseup",l),yt(r.wrapper.ownerDocument,"mousemove",h),yt(r.scroller,"dragstart",f),yt(r.scroller,"drop",l),s||(x(v),n.addNew||Da(e.doc,i,null,null,n.extend),U&&!te||S&&F==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),h=function(v){s=s||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},f=function(){return s=!0};U&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Ne(r.wrapper.ownerDocument,"mouseup",l),Ne(r.wrapper.ownerDocument,"mousemove",h),Ne(r.scroller,"dragstart",f),Ne(r.scroller,"drop",l),$o(e),setTimeout(function(){return r.input.focus()},20)}function tl(e,t,i){if(i=="char")return new wn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new wn(qe(t.line,0),o(e.doc,qe(t.line+1,0)));var n=i(e,t);return new wn(n.from,n.to)}function Kl(e,t,i,n){var r=e.display,s=e.doc;x(t);var l,h,f=s.sel,v=f.ranges;if(n.addNew&&!n.extend?(h=s.sel.contains(i),h>-1?l=v[h]:l=new wn(i,i)):(l=s.sel.primary(),h=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new wn(i,i)),i=pi(e,t,!0,!0),h=-1;else{var I=tl(e,i,n.unit);n.extend?l=is(l,I.anchor,I.head,n.extend):l=I}n.addNew?h==-1?(h=v.length,Ti(s,rr(e,v.concat([l]),h),{scroll:!1,origin:"*mouse"})):v.length>1&&v[h].empty()&&n.unit=="char"&&!n.extend?(Ti(s,rr(e,v.slice(0,h).concat(v.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),f=s.sel):rs(s,h,l,Ue):(h=0,Ti(s,new Ii([l],0),Ue),f=s.sel);var Y=i;function xe(pt){if(Ht(Y,pt)==0)return;if(Y=pt,n.unit=="rectangle"){for(var kt=[],Vt=e.options.tabSize,Ut=de(Mt(s,i.line).text,i.ch,Vt),en=de(Mt(s,pt.line).text,pt.ch,Vt),In=Math.min(Ut,en),bi=Math.max(Ut,en),Yn=Math.min(i.line,pt.line),Qi=Math.min(e.lastLine(),Math.max(i.line,pt.line));Yn<=Qi;Yn++){var Ki=Mt(s,Yn).text,ci=Be(Ki,In,Vt);In==bi?kt.push(new wn(qe(Yn,ci),qe(Yn,ci))):Ki.length>ci&&kt.push(new wn(qe(Yn,ci),qe(Yn,Be(Ki,bi,Vt))))}kt.length||kt.push(new wn(i,i)),Ti(s,rr(e,f.ranges.slice(0,h).concat(kt),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(pt)}else{var Xi=l,Ei=tl(e,pt,n.unit),yi=Xi.anchor,di;Ht(Ei.anchor,yi)>0?(di=Ei.head,yi=gr(Xi.from(),Ei.anchor)):(di=Ei.anchor,yi=mr(Xi.to(),Ei.head));var qn=f.ranges.slice(0);qn[h]=Xl(e,new wn(o(s,yi),di)),Ti(s,rr(e,qn,h),Ue)}}var pe=r.wrapper.getBoundingClientRect(),ze=0;function Je(pt){var kt=++ze,Vt=pi(e,pt,!0,n.unit=="rectangle");if(!Vt)return;if(Ht(Vt,Y)!=0){e.curOp.focus=G(),xe(Vt);var Ut=wo(r,s);(Vt.line>=Ut.to||Vt.line<Ut.from)&&setTimeout(ni(e,function(){ze==kt&&Je(pt)}),150)}else{var en=pt.clientY<pe.top?-20:pt.clientY>pe.bottom?20:0;en&&setTimeout(ni(e,function(){if(ze!=kt)return;r.scroller.scrollTop+=en,Je(pt)}),50)}}function at(pt){e.state.selectingText=!1,ze=Infinity,pt&&(x(pt),r.input.focus()),yt(r.wrapper.ownerDocument,"mousemove",ft),yt(r.wrapper.ownerDocument,"mouseup",bt),s.history.lastSelOrigin=null}var ft=ni(e,function(pt){pt.buttons===0||!Te(pt)?at(pt):Je(pt)}),bt=ni(e,at);e.state.selectingText=bt,Ne(r.wrapper.ownerDocument,"mousemove",ft),Ne(r.wrapper.ownerDocument,"mouseup",bt)}function Xl(e,t){var i=t.anchor,n=t.head,r=Mt(e.doc,i.line);if(Ht(i,n)==0&&i.sticky==n.sticky)return t;var s=wt(r);if(!s)return t;var l=dt(s,i.ch,i.sticky),h=s[l];if(h.from!=i.ch&&h.to!=i.ch)return t;var f=l+(h.from==i.ch==(h.level!=1)?0:1);if(f==0||f==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 I=dt(s,n.ch,n.sticky),Y=I-l||(n.ch-i.ch)*(h.level==1?-1:1);I==f-1||I==f?v=Y<0:v=Y>0}var xe=s[f+(v?-1:0)],pe=v==(xe.level==1),ze=pe?xe.from:xe.to,Je=pe?"after":"before";return i.ch==ze&&i.sticky==Je?t:new wn(new qe(i.line,ze,Je),n)}function nl(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(xe){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&x(t);var l=e.display,h=l.lineDiv.getBoundingClientRect();if(s>h.bottom||!Z(e,i))return A(t);s-=h.top-l.viewOffset;for(var f=0;f<e.display.gutterSpecs.length;++f){var v=l.gutters.childNodes[f];if(v&&v.getBoundingClientRect().right>=r){var I=Yi(e.doc,s),Y=e.display.gutterSpecs[f];return We(e,i,e,I,Y.className,t),A(t)}}}function cs(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){if(xr(e.display,t)||$l(e,t))return;if(et(e,t,"contextmenu"))return;Ae||e.display.input.onContextMenu(t)}function $l(e,t){return Z(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function rl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),$t(e)}var Io={toString:function(){return"CodeMirror.Init"}},ol={},Fa={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(h,f,v){v!=Io&&s(h,f,v)}:s)}e.defineOption=i,e.Init=Io,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,Wr(n)},!0),i("indentUnit",2,Wr,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){ra(n),$t(n),Dn(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(f){for(var v=0;;){var I=f.text.indexOf(r,v);if(I==-1)break;v=I+r.length,s.push(qe(l,I))}l++});for(var h=s.length-1;h>=0;h--)Do(n.doc,r,s[h],qe(s[h].line,s[h].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!=Io&&n.refresh()}),i("specialCharPlaceholder",Tt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",ee?"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){rl(n),wr(n)},!0),i("keyMap","default",function(n,r,s){var l=Ua(r),h=s!=Io&&Ua(s);h&&h.detach&&h.detach(n,l),l.attach&&l.attach(n,h||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=ji(r,n.options.lineNumbers),wr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?Mi(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Br(n)},!0),i("scrollbarStyle","native",function(n){ko(n),Br(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=ji(n.options.gutters,r),wr(n)},!0),i("firstLineNumber",1,wr,!0),i("lineNumberFormatter",function(n){return n},wr,!0),i("showCursorWhenSelecting",!1,An,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(Zr(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,An,!0),i("singleCursorHeightPerLine",!0,An,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,ra,!0),i("addModeClass",!1,ra,!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,ra,!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!=Io;if(!t!=!n){var r=e.display.dragFunctions,s=t?Ne:yt;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?(le(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ee(e.display.wrapper,"CodeMirror-wrap"),cr(e)),Pi(e),Dn(e),$t(e),setTimeout(function(){return Br(e)},100)}function Xn(e,t){var i=this;if(!(this instanceof Xn))return new Xn(e,t);this.options=t=t?g(t):{},g(ol,t,!1);var n=t.value;typeof n=="string"?n=new Gi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new Xn.inputStyles[t.inputStyle](this),s=this.display=new mo(e,n,r,t);s.wrapper.CodeMirror=this,rl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),ko(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 Ie,keySeq:null,specialChars:null},t.autofocus&&!ee&&s.input.focus(),S&&F<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Tl(),Pr(this),this.curOp.forceUpdate=!0,vs(this,n),t.autofocus&&!ee||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Lr(i)},20):Zr(this);for(var l in Fa)Fa.hasOwnProperty(l)&&Fa[l](this,t[l],Io);gi(this),t.finishInit&&t.finishInit(this);for(var h=0;h<ds.length;++h)ds[h](this);Fr(this),U&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Xn.defaults=ol,Xn.optionHandlers=Fa;function Ql(e){var t=e.display;Ne(t.scroller,"mousedown",ni(e,el)),S&&F<11?Ne(t.scroller,"dblclick",ni(e,function(f){if(et(e,f))return;var v=pi(e,f);if(!v||cs(e,f)||xr(e.display,f))return;x(f);var I=e.findWordAt(v);Da(e.doc,I.anchor,I.head)})):Ne(t.scroller,"dblclick",function(f){return et(e,f)||x(f)}),Ne(t.scroller,"contextmenu",function(f){return il(e,f)}),Ne(t.input.getField(),"contextmenu",function(f){t.scroller.contains(f.target)||il(e,f)});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(f){if(f.touches.length!=1)return!1;var v=f.touches[0];return v.radiusX<=1&&v.radiusY<=1}function l(f,v){if(v.left==null)return!0;var I=v.left-f.left,Y=v.top-f.top;return I*I+Y*Y>20*20}Ne(t.scroller,"touchstart",function(f){if(!et(e,f)&&!s(f)&&!cs(e,f)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-n.end<=300?n:null},f.touches.length==1&&(t.activeTouch.left=f.touches[0].pageX,t.activeTouch.top=f.touches[0].pageY)}}),Ne(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ne(t.scroller,"touchend",function(f){var v=t.activeTouch;if(v&&!xr(t,f)&&v.left!=null&&!v.moved&&new Date-v.start<300){var I=e.coordsChar(t.activeTouch,"page"),Y;!v.prev||l(v,v.prev)?Y=new wn(I,I):!v.prev.prev||l(v,v.prev.prev)?Y=e.findWordAt(I):Y=new wn(qe(I.line,0),o(e.doc,qe(I.line+1,0))),e.setSelection(Y.anchor,Y.head),e.focus(),x(f)}r()}),Ne(t.scroller,"touchcancel",r),Ne(t.scroller,"scroll",function(){t.scroller.clientHeight&&(eo(e,t.scroller.scrollTop),nr(e,t.scroller.scrollLeft,!0),We(e,"scroll",e))}),Ne(t.scroller,"mousewheel",function(f){return na(e,f)}),Ne(t.scroller,"DOMMouseScroll",function(f){return na(e,f)}),Ne(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(f){et(e,f)||P(f)},over:function(f){et(e,f)||(Ml(e,f),P(f))},start:function(f){return Ol(e,f)},drop:ni(e,_l),leave:function(f){et(e,f)||Hs(e)}};var h=t.input.getField();Ne(h,"keyup",function(f){return Qs.call(e,f)}),Ne(h,"keydown",ni(e,Zs)),Ne(h,"keypress",ni(e,qs)),Ne(h,"focus",function(f){return Lr(e,f)}),Ne(h,"blur",function(f){return Zr(e,f)})}var ds=[];Xn.defineInitHook=function(e){return ds.push(e)};function va(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=we(e,t).state:i="prev");var l=e.options.tabSize,h=Mt(r,t),f=de(h.text,null,l);h.stateAfter&&(h.stateAfter=null);var v=h.text.match(/^\s*/)[0],I;if(!n&&!/\S/.test(h.text))I=0,i="not";else if(i=="smart"&&(I=r.mode.indent(s,h.text.slice(v.length),h.text),I==ot||I>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?I=de(Mt(r,t-1).text,null,l):I=0:i=="add"?I=f+e.options.indentUnit:i=="subtract"?I=f-e.options.indentUnit:typeof i=="number"&&(I=f+i),I=Math.max(0,I);var Y="",xe=0;if(e.options.indentWithTabs)for(var pe=Math.floor(I/l);pe;--pe)xe+=l,Y+=" ";if(xe<I&&(Y+=D(I-xe)),Y!=v)return Do(r,Y,qe(t,0),qe(t,v.length),"+input"),h.stateAfter=null,!0;for(var ze=0;ze<r.sel.ranges.length;ze++){var Je=r.sel.ranges[ze];if(Je.head.line==t&&Je.head.ch<v.length){var at=qe(t,v.length);rs(r,ze,new wn(at,at));break}}}var kr=null;function Ha(e){kr=e}function hs(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,h=r=="paste"||e.state.pasteIncoming>l,f=St(t),v=null;if(h&&n.ranges.length>1)if(kr&&kr.text.join(`
|
|
`)==t){if(n.ranges.length%kr.text.length==0){v=[];for(var I=0;I<kr.text.length;I++)v.push(s.splitLines(kr.text[I]))}}else f.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(v=mt(f,function(ft){return[ft]}));for(var Y=e.curOp.updateInput,xe=n.ranges.length-1;xe>=0;xe--){var pe=n.ranges[xe],ze=pe.from(),Je=pe.to();pe.empty()&&(i&&i>0?ze=qe(ze.line,ze.ch-i):e.state.overwrite&&!h?Je=qe(Je.line,Math.min(Mt(s,Je.line).text.length,Je.ch+Ze(f).length)):h&&kr&&kr.lineWise&&kr.text.join(`
|
|
`)==f.join(`
|
|
`)&&(ze=Je=qe(ze.line,0)));var at={from:ze,to:Je,text:v?v[xe%v.length]:f,origin:r||(h?"paste":e.state.cutIncoming>l?"cut":"+input")};Lo(e.doc,at),xn(e,"inputRead",e,at)}t&&!h&&sl(e,t),Qr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Y),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function al(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ni(t,function(){return hs(t,i,0,null,"paste")}),!0}function sl(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 h=0;h<s.electricChars.length;h++)if(t.indexOf(s.electricChars.charAt(h))>-1){l=va(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(Mt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=va(e,r.head.line,"smart")));l&&xn(e,"electricInput",e,r.head.line)}}function ll(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:qe(r,0),head:qe(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function ul(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function cl(){var e=L("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=L("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return U?e.style.width="1000px":e.setAttribute("wrap","off"),N&&(e.style.border="1px solid black"),ul(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)&&ni(this,t[n])(this,r,l),We(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"](Ua(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:wi(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");Ct(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Dn(this)}),removeOverlay:wi(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++,Dn(this);return}}}),indentLine:wi(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),fr(this.doc,n)&&va(this,n,r,s)}),indentSelection:wi(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var h=r[l];if(h.empty())h.head.line>s&&(va(this,h.head.line,n,!0),s=h.head.line,l==this.doc.sel.primIndex&&Qr(this));else{var f=h.from(),v=h.to(),I=Math.max(s,f.line);s=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var Y=I;Y<s;++Y)va(this,Y,n);var xe=this.doc.sel.ranges;f.ch==0&&r.length==xe.length&&xe[l].from().ch>0&&rs(this.doc,l,new wn(f,xe[l].to()),He)}}}),getTokenAt:function(n,r){return Sn(this,n,r)},getLineTokens:function(n,r){return Sn(this,qe(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Ge(this,Mt(this.doc,n.line)),s=0,l=(r.length-1)/2,h=n.ch,f;if(h==0)f=r[2];else for(;;){var v=s+l>>1;if((v?r[v*2-1]:0)>=h)l=v;else if(r[v*2+1]<h)s=v+1;else{f=r[v*2+2];break}}var I=f?f.indexOf("overlay "):-1;return I<0?f:I==0?null:f.slice(0,I-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],h=this.getModeAt(n);if(typeof h[r]=="string")l[h[r]]&&s.push(l[h[r]]);else if(h[r])for(var f=0;f<h[r].length;f++){var v=l[h[r][f]];v&&s.push(v)}else h.helperType&&l[h.helperType]?s.push(l[h.helperType]):l[h.name]&&s.push(l[h.name]);for(var I=0;I<l._global.length;I++){var Y=l._global[I];Y.pred(h,this)&&De(s,Y.val)==-1&&s.push(Y.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=d(s,n==null?s.first+s.size-1:n),we(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(),rn(this,s,r||"page")},charCoords:function(n,r){return Fn(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=nn(this,n,r||"page"),sn(this,n.left,n.top)},lineAtHeight:function(n,r){return n=nn(this,{top:n,left:0},r||"page").top,Yi(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,h;if(typeof n=="number"){var f=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>f&&(n=f,l=!0),h=Mt(this.doc,n)}else h=n;return hn(this,h,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-Oi(h):0)},defaultTextHeight:function(){return Qn(this.display)},defaultCharWidth:function(){return fi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,h){var f=this.display;n=rn(this,o(this.doc,n));var v=n.bottom,I=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),f.sizer.appendChild(r),l=="over")v=n.top;else if(l=="above"||l=="near"){var Y=Math.max(f.wrapper.clientHeight,this.doc.height),xe=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>Y)&&n.top>r.offsetHeight?v=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=Y&&(v=n.bottom),I+r.offsetWidth>xe&&(I=xe-r.offsetWidth)}r.style.top=v+"px",r.style.left=r.style.right="",h=="right"?(I=f.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(h=="left"?I=0:h=="middle"&&(I=(f.sizer.clientWidth-r.offsetWidth)/2),r.style.left=I+"px"),s&&Ea(this,{left:I,top:v,right:I+r.offsetWidth,bottom:v+r.offsetHeight})},triggerOnKeyDown:wi(Zs),triggerOnKeyPress:wi(qs),triggerOnKeyUp:Qs,triggerOnMouseDown:wi(el),execCommand:function(n){if(fa.hasOwnProperty(n))return fa[n].call(null,this)},triggerElectric:wi(function(n){sl(this,n)}),findPosH:function(n,r,s,l){var h=1;r<0&&(h=-1,r=-r);for(var f=o(this.doc,n),v=0;v<r&&!(f=fs(this.doc,f,h,s,l),f.hitSide);++v);return f},moveH:wi(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?fs(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},Pe)}),deleteH:wi(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):jo(this,function(h){var f=fs(l,h.head,n,r,!1);return n<0?{from:f,to:h.head}:{from:h.head,to:f}})}),findPosV:function(n,r,s,l){var h=1,f=l;r<0&&(h=-1,r=-r);for(var v=o(this.doc,n),I=0;I<r;++I){var Y=rn(this,v,"div");if(f==null?f=Y.left:Y.left=f,v=dl(this,Y,h,s),v.hitSide)break}return v},moveV:wi(function(n,r){var s=this,l=this.doc,h=[],f=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(I){if(f)return n<0?I.from():I.to();var Y=rn(s,I.head,"div");I.goalColumn!=null&&(Y.left=I.goalColumn),h.push(Y.left);var xe=dl(s,Y,n,r);return r=="page"&&I==l.sel.primary()&&Zo(s,Fn(s,xe,"div").top-Y.top),xe},Pe),h.length)for(var v=0;v<l.sel.ranges.length;v++)l.sel.ranges[v].goalColumn=h[v]}),findWordAt:function(n){var r=this.doc,s=Mt(r,n.line).text,l=n.ch,h=n.ch;if(s){var f=this.getHelper(n,"wordChars");(n.sticky=="before"||h==s.length)&&l?--l:++h;for(var v=s.charAt(l),I=Oe(v,f)?function(Y){return Oe(Y,f)}:/\s/.test(v)?function(Y){return/\s/.test(Y)}:function(Y){return!/\s/.test(Y)&&!Oe(Y)};l>0&&I(s.charAt(l-1));)--l;for(;h<s.length&&I(s.charAt(h));)++h}return new wn(qe(n.line,l),qe(n.line,h))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?le(this.display.cursorDiv,"CodeMirror-overwrite"):Ee(this.display.cursorDiv,"CodeMirror-overwrite"),We(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==G()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:wi(function(n,r){qr(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-oe(this)-this.display.barHeight,width:n.scrollWidth-oe(this)-this.display.barWidth,clientHeight:m(this),clientWidth:j(this)}},scrollIntoView:wi(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:qe(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?Ya(this,n):co(this,n.from,n.to,n.margin)}),setSize:wi(function(n,r){var s=this,l=function(f){return typeof f=="number"||/^\d+$/.test(String(f))?f+"px":f};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&Xt(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(f){if(f.widgets){for(var v=0;v<f.widgets.length;v++)if(f.widgets[v].noHScroll){Kn(s,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,We(this,"refresh",this)}),operation:function(n){return Ni(this,n)},startOperation:function(){return Pr(this)},endOperation:function(){return Fr(this)},refresh:wi(function(){var n=this.display.cachedTextHeight;Dn(this),this.curOp.forceUpdate=!0,$t(this),qr(this,this.doc.scrollLeft,this.doc.scrollTop),Oo(this.display),(n==null||Math.abs(n-Qn(this.display))>.5||this.options.lineWrapping)&&Pi(this),We(this,"refresh",this)}),swapDoc:wi(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),vs(this,n),$t(this),this.display.input.reset(),qr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,xn(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}},ne(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 fs(e,t,i,n,r){var s=t,l=i,h=Mt(e,t.line),f=r&&e.direction=="rtl"?-i:i;function v(){var bt=t.line+f;return bt<e.first||bt>=e.first+e.size?!1:(t=new qe(bt,t.ch,t.sticky),h=Mt(e,bt))}function I(bt){var pt;if(n=="codepoint"){var kt=h.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(kt)?pt=null:pt=new qe(t.line,Math.max(0,Math.min(h.text.length,t.ch+i*(kt>=55296&&kt<56320?2:1))),-i)}else r?pt=Pl(e.cm,h,t,i):pt=as(h,t,i);if(pt==null)if(!bt&&v())t=ss(r,e.cm,h,t.line,f);else return!1;else t=pt;return!0}if(n=="char"||n=="codepoint")I();else if(n=="column")I(!0);else if(n=="word"||n=="group")for(var Y=null,xe=n=="group",pe=e.cm&&e.cm.getHelper(t,"wordChars"),ze=!0;!(i<0&&!I(!ze));ze=!1){var Je=h.text.charAt(t.ch)||`
|
|
`,at=Oe(Je,pe)?"w":xe&&Je==`
|
|
`?"n":!xe||/\s/.test(Je)?null:"p";if(xe&&!ze&&!at&&(at="s"),Y&&Y!=at){i<0&&(i=1,I(),t.sticky="after");break}if(at&&(Y=at),i>0&&!I(!ze))break}var ft=Na(e,t,s,l,!0);return Ji(s,ft)&&(ft.hitSide=!0),ft}function dl(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var h=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),f=Math.max(h-.5*Qn(e.display),3);l=(i>0?t.bottom:t.top)+i*f}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var v;!(v=sn(e,s,l),!v.outside);){if(i<0?l<=0:l>=r.height){v.hitSide=!0;break}l+=i*5}return v}var Pn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ie,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Pn.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;ul(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(h){for(var f=h.target;f;f=f.parentNode){if(f==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}Ne(r,"paste",function(h){if(!s(h)||et(n,h)||al(h,n))return;F<=11&&setTimeout(ni(n,function(){return t.updateFromDOM()}),20)}),Ne(r,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),Ne(r,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),Ne(r,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ne(r,"touchstart",function(){return i.forceCompositionEnd()}),Ne(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(h){if(!s(h)||et(n,h))return;if(n.somethingSelected())Ha({lineWise:!1,text:n.getSelections()}),h.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var f=ll(n);Ha({lineWise:!0,text:f.text}),h.type=="cut"&&n.operation(function(){n.setSelections(f.ranges,0,He),n.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var v=kr.text.join(`
|
|
`);if(h.clipboardData.setData("Text",v),h.clipboardData.getData("Text")==v){h.preventDefault();return}}var I=cl(),Y=I.firstChild;n.display.lineSpace.insertBefore(I,n.display.lineSpace.firstChild),Y.value=kr.text.join(`
|
|
`);var xe=document.activeElement;Le(Y),setTimeout(function(){n.display.lineSpace.removeChild(I),xe.focus(),xe==r&&i.showPrimarySelection()},50)}Ne(r,"copy",l),Ne(r,"cut",l)},Pn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Pn.prototype.prepareSelection=function(){var e=dr(this.cm,!1);return e.focus=document.activeElement==this.div,e},Pn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Pn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Pn.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=Wa(t,e.anchorNode,e.anchorOffset),l=Wa(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&Ht(gr(s,l),n)==0&&Ht(mr(s,l),r)==0)return;var h=t.display.view,f=n.line>=t.display.viewFrom&&hl(t,n)||{node:h[0].measure.map[2],offset:0},v=r.line<t.display.viewTo&&hl(t,r);if(!v){var I=h[h.length-1].measure,Y=I.maps?I.maps[I.maps.length-1]:I.map;v={node:Y[Y.length-1],offset:Y[Y.length-2]-Y[Y.length-3]}}if(!f||!v){e.removeAllRanges();return}var xe=e.rangeCount&&e.getRangeAt(0),pe;try{pe=ve(f.node,f.offset,v.offset,v.node)}catch(ze){}pe&&(!V&&t.state.focused?(e.collapse(f.node,f.offset),pe.collapsed||(e.removeAllRanges(),e.addRange(pe))):(e.removeAllRanges(),e.addRange(pe)),xe&&e.anchorNode==null?e.addRange(xe):V&&this.startGracePeriod()),this.rememberSelection()},Pn.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)},Pn.prototype.showMultipleSelections=function(e){me(this.cm.display.cursorDiv,e.cursors),me(this.cm.display.selectionDiv,e.selection)},Pn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Pn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return k(this.div,t)},Pn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Pn.prototype.blur=function(){this.div.blur()},Pn.prototype.getField=function(){return this.div},Pn.prototype.supportsTouch=function(){return!0},Pn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ni(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)},Pn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Pn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(W&&M&&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=Wa(t,e.anchorNode,e.anchorOffset),n=Wa(t,e.focusNode,e.focusOffset);i&&n&&Ni(t,function(){Ti(t.doc,Er(i,n),He),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Pn.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=qe(n.line-1,Mt(e.doc,n.line-1).length)),r.ch==Mt(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=qe(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,h;n.line==t.viewFrom||(s=jn(e,n.line))==0?(l=ln(t.view[0].line),h=t.view[0].node):(l=ln(t.view[s].line),h=t.view[s-1].node.nextSibling);var f=jn(e,r.line),v,I;if(f==t.view.length-1?(v=t.viewTo-1,I=t.lineDiv.lastChild):(v=ln(t.view[f+1].line)-1,I=t.view[f+1].node.previousSibling),!h)return!1;for(var Y=e.doc.splitLines(tu(e,h,I,l,v)),xe=Fi(e.doc,qe(l,0),qe(v,Mt(e.doc,v).text.length));Y.length>1&&xe.length>1;)if(Ze(Y)==Ze(xe))Y.pop(),xe.pop(),v--;else if(Y[0]==xe[0])Y.shift(),xe.shift(),l++;else break;for(var pe=0,ze=0,Je=Y[0],at=xe[0],ft=Math.min(Je.length,at.length);pe<ft&&Je.charCodeAt(pe)==at.charCodeAt(pe);)++pe;for(var bt=Ze(Y),pt=Ze(xe),kt=Math.min(bt.length-(Y.length==1?pe:0),pt.length-(xe.length==1?pe:0));ze<kt&&bt.charCodeAt(bt.length-ze-1)==pt.charCodeAt(pt.length-ze-1);)++ze;if(Y.length==1&&xe.length==1&&l==n.line)for(;pe&&pe>n.ch&&bt.charCodeAt(bt.length-ze-1)==pt.charCodeAt(pt.length-ze-1);)pe--,ze++;Y[Y.length-1]=bt.slice(0,bt.length-ze).replace(/^\u200b+/,""),Y[0]=Y[0].slice(pe).replace(/\u200b+$/,"");var Vt=qe(l,pe),Ut=qe(v,xe.length?Ze(xe).length-ze:0);if(Y.length>1||Y[0]||Ht(Vt,Ut))return Do(e.doc,Y,Vt,Ut,"+input"),!0},Pn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Pn.prototype.reset=function(){this.forceCompositionEnd()},Pn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Pn.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)},Pn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ni(this.cm,function(){return Dn(e.cm)})},Pn.prototype.setUneditable=function(e){e.contentEditable="false"},Pn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||ni(this.cm,hs)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Pn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Pn.prototype.onContextMenu=function(){},Pn.prototype.resetPosition=function(){},Pn.prototype.needsContentAttribute=!0;function hl(e,t){var i=se(e,t.line);if(!i||i.hidden)return null;var n=Mt(e.doc,t.line),r=b(i,n,t.line),s=wt(n,e.doc.direction),l="left";if(s){var h=dt(s,t.ch);l=h%2?"right":"left"}var f=it(r.map,t.ch,l);return f.offset=f.collapse=="right"?f.end:f.start,f}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Uo(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,h=e.doc.lineSeparator(),f=!1;function v(pe){return function(ze){return ze.id==pe}}function I(){l&&(s+=h,f&&(s+=h),l=f=!1)}function Y(pe){pe&&(I(),s+=pe)}function xe(pe){if(pe.nodeType==1){var ze=pe.getAttribute("cm-text");if(ze){Y(ze);return}var Je=pe.getAttribute("cm-marker"),at;if(Je){var ft=e.findMarks(qe(n,0),qe(r+1,0),v(+Je));ft.length&&(at=ft[0].find(0))&&Y(Fi(e.doc,at.from,at.to).join(h));return}if(pe.getAttribute("contenteditable")=="false")return;var bt=/^(pre|div|p|li|table|br)$/i.test(pe.nodeName);if(!/^br$/i.test(pe.nodeName)&&pe.textContent.length==0)return;bt&&I();for(var pt=0;pt<pe.childNodes.length;pt++)xe(pe.childNodes[pt]);/^(pre|p)$/i.test(pe.nodeName)&&(f=!0),bt&&(l=!0)}else pe.nodeType==3&&Y(pe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(xe(t),t==i);)t=t.nextSibling,f=!1;return s}function Wa(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return Uo(e.clipPos(qe(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||!k(n,t))return Uo(qe(ln(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?Ze(e.rest):e.line;return Uo(qe(ln(s),s.text.length),r)}var l=t.nodeType==3?t:null,h=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));h.parentNode!=n;)h=h.parentNode;var f=e.measure,v=f.maps;function I(at,ft,bt){for(var pt=-1;pt<(v?v.length:0);pt++)for(var kt=pt<0?f.map:v[pt],Vt=0;Vt<kt.length;Vt+=3){var Ut=kt[Vt+2];if(Ut==at||Ut==ft){var en=ln(pt<0?e.line:e.rest[pt]),In=kt[Vt]+bt;return(bt<0||Ut!=at)&&(In=kt[Vt+(bt?1:0)]),qe(en,In)}}}var Y=I(l,h,i);if(Y)return Uo(Y,r);for(var xe=h.nextSibling,pe=l?l.nodeValue.length-i:0;xe;xe=xe.nextSibling){if(Y=I(xe,xe.firstChild,0),Y)return Uo(qe(Y.line,Y.ch-pe),r);pe+=xe.textContent.length}for(var ze=h.previousSibling,Je=i;ze;ze=ze.previousSibling){if(Y=I(ze,ze.firstChild,-1),Y)return Uo(qe(Y.line,Y.ch+Je),r);Je+=ze.textContent.length}}var ri=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ie,this.hasSelection=!1,this.composing=null};ri.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),N&&(r.style.width="0px"),Ne(r,"input",function(){S&&F>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ne(r,"paste",function(l){if(et(n,l)||al(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(et(n,l))return;if(n.somethingSelected())Ha({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var h=ll(n);Ha({lineWise:!0,text:h.text}),l.type=="cut"?n.setSelections(h.ranges,null,He):(i.prevInput="",r.value=h.text.join(`
|
|
`),Le(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}Ne(r,"cut",s),Ne(r,"copy",s),Ne(e.scroller,"paste",function(l){if(xr(e,l)||et(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var h=new Event("paste");h.clipboardData=l.clipboardData,r.dispatchEvent(h)}),Ne(e.lineSpace,"selectstart",function(l){xr(e,l)||x(l)}),Ne(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"})}}),Ne(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ri.prototype.createField=function(e){this.wrapper=cl(),this.textarea=this.wrapper.firstChild},ri.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ri.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=dr(e);if(e.options.moveInputWithCursor){var r=rn(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},ri.prototype.showSelection=function(e){var t=this.cm,i=t.display;me(i.cursorDiv,e.cursors),me(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ri.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&&Le(this.textarea),S&&F>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",S&&F>=9&&(this.hasSelection=null))},ri.prototype.getField=function(){return this.textarea},ri.prototype.supportsTouch=function(){return!1},ri.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ee||G()!=this.textarea))try{this.textarea.focus()}catch(e){}},ri.prototype.blur=function(){this.textarea.blur()},ri.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ri.prototype.receivedFocus=function(){this.slowPoll()},ri.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()})},ri.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)},ri.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ht(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(S&&F>=9&&this.hasSelection===r||fe&&/[\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,h=Math.min(n.length,r.length);l<h&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return Ni(t,function(){hs(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},ri.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ri.prototype.onKeyPress=function(){S&&F>=9&&(this.hasSelection=null),this.fastPoll()},ri.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=pi(i,e),l=n.scroller.scrollTop;if(!s||O)return;var h=i.options.resetSelectionOnContextMenu;h&&i.doc.sel.contains(s)==-1&&ni(i,Ti)(i.doc,Er(s),He);var f=r.style.cssText,v=t.wrapper.style.cssText,I=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-I.top-5)+"px; left: "+(e.clientX-I.left-5)+`px;
|
|
z-index: 1000; background: `+(S?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Y;U&&(Y=window.scrollY),n.input.focus(),U&&window.scrollTo(null,Y),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=pe,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function xe(){if(r.selectionStart!=null){var Je=i.somethingSelected(),at="\u200B"+(Je?r.value:"");r.value="\u21DA",r.value=at,t.prevInput=Je?"":"\u200B",r.selectionStart=1,r.selectionEnd=at.length,n.selForContextMenu=i.doc.sel}}function pe(){if(t.contextMenuPending!=pe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=v,r.style.cssText=f,S&&F<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!S||S&&F<9)&&xe();var Je=0,at=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?ni(i,As)(i):Je++<10?n.detectingSelectAll=setTimeout(at,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(at,200)}}if(S&&F>=9&&xe(),Ae){P(e);var ze=function(){yt(window,"mouseup",ze),setTimeout(pe,20)};Ne(window,"mouseup",ze)}else setTimeout(pe,50)},ri.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ri.prototype.setUneditable=function(){},ri.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?g(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=G();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=h.getValue()}var r;if(e.form&&(Ne(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(f){}}t.finishInit=function(f){f.save=n,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,n(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(yt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var h=Xn(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return h}function ru(e){e.off=yt,e.on=Ne,e.wheelEventPixels=ta,e.Doc=Gi,e.splitLines=St,e.countColumn=de,e.findColumn=Be,e.isWordChar=Me,e.Pass=ot,e.signal=We,e.Line=Mr,e.changeEnd=Sr,e.scrollbarModel=Qo,e.Pos=qe,e.cmpPos=Ht,e.modes=vn,e.mimeModes=Ft,e.resolveMode=At,e.getMode=hi,e.modeExtensions=oi,e.extendMode=ai,e.copyState=Si,e.startState=Bi,e.innerMode=or,e.commands=fa,e.keyMap=zr,e.keyName=Ks,e.isModifierKey=Vs,e.lookupKey=No,e.normalizeKeyMap=Dl,e.StringStream=pn,e.SharedTextMarker=ca,e.TextMarker=ro,e.LineWidget=ua,e.e_preventDefault=x,e.e_stopPropagation=w,e.e_stop=P,e.addClass=le,e.contains=k,e.rmClass=Ee,e.keyNames=oo}Yl(Xn),ql(Xn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var za in Gi.prototype)Gi.prototype.hasOwnProperty(za)&&De(ou,za)<0&&(Xn.prototype[za]=function(e){return function(){return e.apply(this.doc,arguments)}}(Gi.prototype[za]));return ne(Gi),Xn.inputStyles={textarea:ri,contenteditable:Pn},Xn.defineMode=function(e){!Xn.defaults.mode&&e!="null"&&(Xn.defaults.mode=e),zn.apply(this,arguments)},Xn.defineMIME=Bn,Xn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Xn.defineMIME("text/plain","null"),Xn.defineExtension=function(e,t){Xn.prototype[e]=t},Xn.defineDocExtension=function(e,t){Gi.prototype[e]=t},Xn.fromTextArea=iu,ru(Xn),Xn.version="5.58.2",Xn})},Y1PL:function(vt,Qe,y){"use strict";y.r(Qe),y.d(Qe,"ResizableTextArea",function(){return De});var E=y("wx14"),ce=y("1OyB"),V=y("vuIU"),H=y("Ji7U"),C=y("LK+K"),re=y("q1tI"),S=y("VTBJ"),F=y("rePB"),U=y("Zm9Q"),$=y("Kwbf"),M=y("c+Xe"),O=y("m+aA"),te=y("bdgK"),Q=new Map;function K(He){He.forEach(function(Ue){var Pe,Be=Ue.target;(Pe=Q.get(Be))===null||Pe===void 0||Pe.forEach(function(ue){return ue(Be)})})}var N=new te.default(K),W=null,ee=null;function fe(He,Ue){Q.has(He)||(Q.set(He,new Set),N.observe(He)),Q.get(He).add(Ue)}function Re(He,Ue){Q.has(He)&&(Q.get(He).delete(Ue),Q.get(He).size||(N.unobserve(He),Q.delete(He)))}var Ke=function(He){Object(H.a)(Pe,He);var Ue=Object(C.a)(Pe);function Pe(){return Object(ce.a)(this,Pe),Ue.apply(this,arguments)}return Object(V.a)(Pe,[{key:"render",value:function(){return this.props.children}}]),Pe}(re.Component),_e=re.createContext(null);function ye(He){var Ue=He.children,Pe=He.onBatchResize,Be=re.useRef(0),ue=re.useRef([]),D=re.useContext(_e),Ze=re.useCallback(function(mt,Ct,ut){Be.current+=1;var st=Be.current;ue.current.push({size:mt,element:Ct,data:ut}),Promise.resolve().then(function(){st===Be.current&&(Pe==null||Pe(ue.current),ue.current=[])}),D==null||D(mt,Ct,ut)},[Pe,D]);return re.createElement(_e.Provider,{value:Ze},Ue)}function Ae(He){var Ue=He.children,Pe=He.disabled,Be=re.useRef(null),ue=re.useRef(null),D=re.useContext(_e),Ze=re.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),mt=re.isValidElement(Ue)&&Object(M.c)(Ue),Ct=mt?Ue.ref:null,ut=re.useMemo(function(){return Object(M.a)(Ct,Be)},[Ct,Be]),st=re.useRef(He);st.current=He;var he=re.useCallback(function(Me){var Oe=st.current,Se=Oe.onResize,tt=Oe.data,Ye=Me.getBoundingClientRect(),lt=Ye.width,Nt=Ye.height,_t=Me.offsetWidth,xt=Me.offsetHeight,dt=Math.floor(lt),Lt=Math.floor(Nt);if(Ze.current.width!==dt||Ze.current.height!==Lt||Ze.current.offsetWidth!==_t||Ze.current.offsetHeight!==xt){var wt={width:dt,height:Lt,offsetWidth:_t,offsetHeight:xt};Ze.current=wt;var gt=_t===Math.round(lt)?lt:_t,Ne=xt===Math.round(Nt)?Nt:xt,Dt=Object(S.a)(Object(S.a)({},wt),{},{offsetWidth:gt,offsetHeight:Ne});D==null||D(Dt,Me,tt),Se&&Promise.resolve().then(function(){Se(Dt,Me)})}},[]);return re.useEffect(function(){var Me=Object(O.a)(Be.current)||Object(O.a)(ue.current);return Me&&!Pe&&fe(Me,he),function(){return Re(Me,he)}},[Be.current,Pe]),re.createElement(Ke,{ref:ue},mt?re.cloneElement(Ue,{ref:ut}):Ue)}var Ce="rc-observer-key";function Ee(He){var Ue=He.children,Pe=Object(U.a)(Ue);return Pe.map(function(Be,ue){var D=(Be==null?void 0:Be.key)||"".concat(Ce,"-").concat(ue);return re.createElement(Ae,Object(E.a)({},He,{key:D}),Be)})}Ee.Collection=ye;var Fe=Ee,me=y("bT9E"),L=y("TSYQ"),ke=y.n(L),ve=`
|
|
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
|
|
`,k=["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"],G={},le;function X(He){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pe=He.getAttribute("id")||He.getAttribute("data-reactid")||He.getAttribute("name");if(Ue&&G[Pe])return G[Pe];var Be=window.getComputedStyle(He),ue=Be.getPropertyValue("box-sizing")||Be.getPropertyValue("-moz-box-sizing")||Be.getPropertyValue("-webkit-box-sizing"),D=parseFloat(Be.getPropertyValue("padding-bottom"))+parseFloat(Be.getPropertyValue("padding-top")),Ze=parseFloat(Be.getPropertyValue("border-bottom-width"))+parseFloat(Be.getPropertyValue("border-top-width")),mt=k.map(function(ut){return"".concat(ut,":").concat(Be.getPropertyValue(ut))}).join(";"),Ct={sizingStyle:mt,paddingSize:D,borderSize:Ze,boxSizing:ue};return Ue&&Pe&&(G[Pe]=Ct),Ct}function Le(He){var Ue=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Pe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Be=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;le||(le=document.createElement("textarea"),le.setAttribute("tab-index","-1"),le.setAttribute("aria-hidden","true"),document.body.appendChild(le)),He.getAttribute("wrap")?le.setAttribute("wrap",He.getAttribute("wrap")):le.removeAttribute("wrap");var ue=X(He,Ue),D=ue.paddingSize,Ze=ue.borderSize,mt=ue.boxSizing,Ct=ue.sizingStyle;le.setAttribute("style","".concat(Ct,";").concat(ve)),le.value=He.value||He.placeholder||"";var ut=Number.MIN_SAFE_INTEGER,st=Number.MAX_SAFE_INTEGER,he=le.scrollHeight,Me;if(mt==="border-box"?he+=Ze:mt==="content-box"&&(he-=D),Pe!==null||Be!==null){le.value=" ";var Oe=le.scrollHeight-D;Pe!==null&&(ut=Oe*Pe,mt==="border-box"&&(ut=ut+D+Ze),he=Math.max(ut,he)),Be!==null&&(st=Oe*Be,mt==="border-box"&&(st=st+D+Ze),Me=he>st?"":"hidden",he=Math.min(st,he))}return{height:he,minHeight:ut,maxHeight:st,overflowY:Me,resize:"none"}}var T=y("Gytx"),g=y.n(T),de;(function(He){He[He.NONE=0]="NONE",He[He.RESIZING=1]="RESIZING",He[He.RESIZED=2]="RESIZED"})(de||(de={}));var Ie=function(He){Object(H.a)(Pe,He);var Ue=Object(C.a)(Pe);function Pe(Be){var ue;return Object(ce.a)(this,Pe),ue=Ue.call(this,Be),ue.nextFrameActionId=void 0,ue.resizeFrameId=void 0,ue.textArea=void 0,ue.saveTextArea=function(D){ue.textArea=D},ue.handleResize=function(D){var Ze=ue.state.resizeStatus,mt=ue.props,Ct=mt.autoSize,ut=mt.onResize;if(Ze!==de.NONE)return;typeof ut=="function"&&ut(D),Ct&&ue.resizeOnNextFrame()},ue.resizeOnNextFrame=function(){cancelAnimationFrame(ue.nextFrameActionId),ue.nextFrameActionId=requestAnimationFrame(ue.resizeTextarea)},ue.resizeTextarea=function(){var D=ue.props.autoSize;if(!D||!ue.textArea)return;var Ze=D.minRows,mt=D.maxRows,Ct=Le(ue.textArea,!1,Ze,mt);ue.setState({textareaStyles:Ct,resizeStatus:de.RESIZING},function(){cancelAnimationFrame(ue.resizeFrameId),ue.resizeFrameId=requestAnimationFrame(function(){ue.setState({resizeStatus:de.RESIZED},function(){ue.resizeFrameId=requestAnimationFrame(function(){ue.setState({resizeStatus:de.NONE}),ue.fixFirefoxAutoScroll()})})})})},ue.renderTextArea=function(){var D=ue.props,Ze=D.prefixCls,mt=Ze===void 0?"rc-textarea":Ze,Ct=D.autoSize,ut=D.onResize,st=D.className,he=D.disabled,Me=ue.state,Oe=Me.textareaStyles,Se=Me.resizeStatus,tt=Object(me.a)(ue.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Ye=ke()(mt,st,Object(F.a)({},"".concat(mt,"-disabled"),he));"value"in tt&&(tt.value=tt.value||"");var lt=Object(S.a)(Object(S.a)(Object(S.a)({},ue.props.style),Oe),Se===de.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return re.createElement(Fe,{onResize:ue.handleResize,disabled:!(Ct||ut)},re.createElement("textarea",Object(E.a)({},tt,{className:Ye,style:lt,ref:ue.saveTextArea})))},ue.state={textareaStyles:{},resizeStatus:de.NONE},ue}return Object(V.a)(Pe,[{key:"componentDidUpdate",value:function(ue){(ue.value!==this.props.value||!g()(ue.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 ue=this.textArea.selectionStart,D=this.textArea.selectionEnd;this.textArea.setSelectionRange(ue,D)}}catch(Ze){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Pe}(re.Component),De=Ie,rt=function(He){Object(H.a)(Pe,He);var Ue=Object(C.a)(Pe);function Pe(Be){var ue;Object(ce.a)(this,Pe),ue=Ue.call(this,Be),ue.resizableTextArea=void 0,ue.focus=function(){ue.resizableTextArea.textArea.focus()},ue.saveTextArea=function(Ze){ue.resizableTextArea=Ze},ue.handleChange=function(Ze){var mt=ue.props.onChange;ue.setValue(Ze.target.value,function(){ue.resizableTextArea.resizeTextarea()}),mt&&mt(Ze)},ue.handleKeyDown=function(Ze){var mt=ue.props,Ct=mt.onPressEnter,ut=mt.onKeyDown;Ze.keyCode===13&&Ct&&Ct(Ze),ut&&ut(Ze)};var D=typeof Be.value=="undefined"||Be.value===null?Be.defaultValue:Be.value;return ue.state={value:D},ue}return Object(V.a)(Pe,[{key:"setValue",value:function(ue,D){"value"in this.props||this.setState({value:ue},D)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return re.createElement(De,Object(E.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ue){return"value"in ue?{value:ue.value}:null}}]),Pe}(re.Component),ot=Qe.default=rt},ZW9T:function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return Ke});var E=y("k1fw"),ce=y("miYZ"),V=y("tsqr"),H=y("rAM+"),C=y("tJVT"),re=y("PpiC"),S=y("q1tI"),F=y.n(S),U=y("bdgK");function $(_e,ye,Ae,Ce,Ee){var Fe=ye.getWordUntilPosition(Ae),me={startLineNumber:Ae.lineNumber,endLineNumber:Ae.lineNumber,startColumn:Fe.startColumn,endColumn:Fe.endColumn},L=Ce.map(function(ke){return{label:ke,kind:_e.languages.CompletionItemKind.Keyword,insertText:ke,insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:me}});return Ee.map(function(ke){L.push(Object(E.a)(Object(E.a)({},ke),{},{range:me}))}),L}var M=function(_e){var ye={label:"ifelse",kind:_e.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet},Ae=["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(me,L){var ke=$(_e,me,L,Ae,[ye]);return{suggestions:ke}}});var Ce=["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(me,L){var ke=[{label:"print",kind:_e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
`),insertTextRules:_e.languages.CompletionItemInsertTextRule.InsertAsSnippet}],ve=$(_e,me,L,Ce,ke);return{suggestions:ve}}});var Ee=["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(me,L){var ke=[ye,{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}],ve=$(_e,me,L,Ee,ke);return{suggestions:ve}}})},O="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",te=y("LvDl");function Q(_e){return/^\d+$/.test(_e)?"".concat(_e,"px"):_e}function K(){}var N=!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 ee(){var _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=_e;if(Array.isArray(_e)){for(var Ae=0;Ae<_e.length;Ae++){var Ce=W[_e[Ae]];if(Ce)return Ce}return ye[0]}return W[ye]||ye}var fe=null,Re=Qe.b=function(_e){var ye=_e.width,Ae=ye===void 0?"100%":ye,Ce=_e.height,Ee=Ce===void 0?"100%":Ce,Fe=_e.value,me=_e.language,L=me===void 0?"javascript":me,ke=_e.style,ve=ke===void 0?{}:ke,k=_e.options,G=k===void 0?{}:k,le=_e.overrideServices,X=le===void 0?{}:le,Le=_e.theme,T=Le===void 0?"vs-dark":Le,g=_e.onEditBlur,de=_e.onSave,Ie=_e.autoHeight,De=Ie===void 0?!1:Ie,rt=_e.forbidCopy,ot=rt===void 0?!1:rt,He=_e.onChange,Ue=He===void 0?K:He,Pe=_e.editorDidMount,Be=Pe===void 0?K:Pe,ue=_e.onFocus,D=ue===void 0?K:ue,Ze=_e.filename,mt=Ze===void 0?"educoder.txt":Ze,Ct=Object(re.a)(_e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),ut=Object(S.useRef)(),st=Object(S.useRef)({}),he=Object(S.useRef)(),Me=Object(S.useRef)(!1),Oe=Object(S.useRef)(),Se=Object(S.useState)(!1),tt=Object(C.a)(Se,2),Ye=tt[0],lt=tt[1];function Nt(){var A;return ut.current&&(A=new U.default(function(P){var be=Object(H.a)(P),Te;try{for(be.s();!(Te=be.n()).done;){var Xe=Te.value;(Xe.target.offsetHeight>0||Xe.target.offsetWidth>0)&&st.current.instance.layout()}}catch(Et){be.e(Et)}finally{be.f()}}),A.observe(ut.current)),A}function _t(){V.b.warn(decodeURIComponent(O))}var xt=function(){var P=st.current.instance;if(Fe!=null&&P&&Ye){var be=P.getModel();be&&Fe!==be.getValue()&&(N=!0,be.setValue(Fe),P.layout(),N=!1)}};Object(S.useEffect)(function(){he.current&&clearTimeout(he.current),he.current=setTimeout(function(){xt()},500)},[Fe,Ye,st.current]);function dt(){var A=st.current.instance;if(A){var P=A.getSelection(),be=st.current.pastePos||{},Te=new fe.Range(be.startLineNumber||P.endLineNumber,be.startColumn||P.endColumn,be.endLineNumber||P.endLineNumber,be.endColumn||P.endColumn);setTimeout(function(){A.executeEdits("",[{range:Te,text:""}])},300)}}function Lt(A){(window.navigator.platform.match("Mac")?A.metaKey:A.ctrlKey)&&A.keyCode==83&&(A.preventDefault(),de())}var wt=function(){if(De&&st.current.instance){var P=st.current.instance.getContentHeight();x(P<Ee?Ee:P)}else x(Ee)};function gt(A){var P=document.createEvent("MouseEvents");P.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),A.dispatchEvent(P)}function Ne(A,P){var be=window.URL||window.webkitURL||window,Te=new Blob([P]),Xe=document.createElementNS("http://www.w3.org/1999/xhtml","a");Xe.href=be.createObjectURL(Te),Xe.download=A,gt(Xe)}Object(S.useEffect)(function(){wt()},[wt]),Object(S.useEffect)(function(){ut.current&&!Ye&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(A){try{fe=A,st.current.instance=fe.editor.create(ut.current,{value:Fe,language:ee(L),theme:T,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},X);var P=st.current.instance;if(Be(P,fe),setTimeout(function(){wt(),st.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ne(mt||"educoder.txt",P.getValue())}})},500),st.current.subscription=P.onDidChangeModelContent(function(Te){Me.current?clearTimeout(Oe.current):(wt(),Ue(P.getValue(),Te)),Oe.current=setTimeout(function(){Me.current=!1},500)}),window.Monaco||M(fe),ot&&(P.addCommand(fe.KeyMod.CtrlCmd|fe.KeyMod.Shift|fe.KeyCode.KEY_V,function(){return _t(),null}),P.addCommand(fe.KeyMod.CtrlCmd|fe.KeyCode.KEY_C,function(){return _t(),null})),window.Monaco=fe,g&&P.onDidBlurEditorWidget(function(){g(P.getValue())}),D&&P.onDidFocusEditorText(function(){D(P.getValue())}),ot){P.addCommand(fe.KeyMod.CtrlCmd|fe.KeyCode.KEY_V,function(){return _t(),null}),P.onDidPaste(function(Te){st.current.pastePos=Te});try{window.addEventListener("paste",dt)}catch(Te){}}var be=Nt();return lt(!0),function(){var Te=st.current.instance;Te.dispose();var Xe=Te.getModel();Xe&&Xe.dispose(),st.current.subscription&&st.current.subscription.dispose(),ot&&window.removeEventListener("paste",dt),be.unobserve(ut.current)}}catch(Te){}})},[]),Object(S.useEffect)(function(){var A=st.current.instance;if(A&&Ye)return document.addEventListener("keydown",Lt,!1),function(){document.removeEventListener("keydown",Lt)}},[de,Ye]),Object(S.useEffect)(function(){var A=st.current.instance;if(A&&Ye){var P=ee(L);fe.editor.setModelLanguage(A.getModel(),P),console.log("language:",L,A.getModel(),P)}},[L,Ye]),Object(S.useEffect)(function(){var A=st.current.instance;A&&Ye&&fe.editor.setTheme(T)},[T,Ye]),Object(S.useEffect)(function(){var A=st.current.instance;A&&Ye&&(A.updateOptions(Object(E.a)({},G)),setTimeout(function(){A.getModel().updateOptions(Object(E.a)({},G))},200))},[JSON.stringify(G),Ye]),Object(S.useEffect)(function(){var A=st.current.instance;A&&Ye&&A.layout()},[Ae,Ee,Ye]);var Dt=Object(S.useState)(Q(Ae)),yt=Object(C.a)(Dt,2),We=yt[0],et=yt[1],ae=Object(S.useState)(Q(Ee)),Z=Object(C.a)(ae,2),ne=Z[0],x=Z[1],w=Object(E.a)(Object(E.a)({},ve),{},{width:We,height:ne});return F.a.createElement("div",{className:"my-monaco-editor",ref:ut,style:w})};function Ke(_e){var ye=_e.width,Ae=ye===void 0?"100%":ye,Ce=_e.height,Ee=Ce===void 0?"100%":Ce,Fe=_e.original,me=_e.modified,L=_e.language,ke=_e.options,ve=ke===void 0?{}:ke,k=Object(S.useRef)(),G=Object(S.useState)(null),le=Object(C.a)(G,2),X=le[0],Le=le[1];function T(De){var rt;return k.current&&(rt=new U.default(function(ot){var He=Object(H.a)(ot),Ue;try{for(He.s();!(Ue=He.n()).done;){var Pe=Ue.value;(Pe.target.offsetHeight>0||Pe.target.offsetWidth>0)&&De.layout()}}catch(Be){He.e(Be)}finally{He.f()}}),rt.observe(k.current)),rt}Object(S.useEffect)(function(){k.current&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(De){fe=De;var rt=fe.editor.createDiffEditor(k.current,Object(E.a)(Object(E.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},ve),{},{wordWrap:!0}));Le(rt);var ot=T(rt);return function(){rt.dispose();var He=rt.getModel();He&&He.dispose(),ot.unobserve(k.current)}})},[]),Object(S.useEffect)(function(){X&&X.setModel({original:fe.editor.createModel(Fe,L),modified:fe.editor.createModel(me,L)})},[Fe,me,L,X]);var g=Q(Ae),de=Q(Ee),Ie={width:g,height:de};return F.a.createElement("div",{className:"my-diff-editor",ref:k,style:Ie})}},ZpRC:function(vt,Qe,y){"use strict";function E(M){return typeof M=="object"&&M!=null&&M.nodeType===1}function ce(M,O){return(!O||M!=="hidden")&&M!=="visible"&&M!=="clip"}function V(M,O){if(M.clientHeight<M.scrollHeight||M.clientWidth<M.scrollWidth){var te=getComputedStyle(M,null);return ce(te.overflowY,O)||ce(te.overflowX,O)||function(Q){var K=function(N){if(!N.ownerDocument||!N.ownerDocument.defaultView)return null;try{return N.ownerDocument.defaultView.frameElement}catch(W){return null}}(Q);return!!K&&(K.clientHeight<Q.scrollHeight||K.clientWidth<Q.scrollWidth)}(M)}return!1}function H(M,O,te,Q,K,N,W,ee){return N<M&&W>O||N>M&&W<O?0:N<=M&&ee<=te||W>=O&&ee>=te?N-M-Q:W>O&&ee<te||N<M&&ee>te?W-O+K:0}var C=function(M,O){var te=window,Q=O.scrollMode,K=O.block,N=O.inline,W=O.boundary,ee=O.skipOverflowHiddenElements,fe=typeof W=="function"?W:function(Oe){return Oe!==W};if(!E(M))throw new TypeError("Invalid target");for(var Re=document.scrollingElement||document.documentElement,Ke=[],_e=M;E(_e)&&fe(_e);){if((_e=_e.parentElement)===Re){Ke.push(_e);break}_e!=null&&_e===document.body&&V(_e)&&!V(document.documentElement)||_e!=null&&V(_e,ee)&&Ke.push(_e)}for(var ye=te.visualViewport?te.visualViewport.width:innerWidth,Ae=te.visualViewport?te.visualViewport.height:innerHeight,Ce=window.scrollX||pageXOffset,Ee=window.scrollY||pageYOffset,Fe=M.getBoundingClientRect(),me=Fe.height,L=Fe.width,ke=Fe.top,ve=Fe.right,k=Fe.bottom,G=Fe.left,le=K==="start"||K==="nearest"?ke:K==="end"?k:ke+me/2,X=N==="center"?G+L/2:N==="end"?ve:G,Le=[],T=0;T<Ke.length;T++){var g=Ke[T],de=g.getBoundingClientRect(),Ie=de.height,De=de.width,rt=de.top,ot=de.right,He=de.bottom,Ue=de.left;if(Q==="if-needed"&&ke>=0&&G>=0&&k<=Ae&&ve<=ye&&ke>=rt&&k<=He&&G>=Ue&&ve<=ot)return Le;var Pe=getComputedStyle(g),Be=parseInt(Pe.borderLeftWidth,10),ue=parseInt(Pe.borderTopWidth,10),D=parseInt(Pe.borderRightWidth,10),Ze=parseInt(Pe.borderBottomWidth,10),mt=0,Ct=0,ut="offsetWidth"in g?g.offsetWidth-g.clientWidth-Be-D:0,st="offsetHeight"in g?g.offsetHeight-g.clientHeight-ue-Ze:0;if(Re===g)mt=K==="start"?le:K==="end"?le-Ae:K==="nearest"?H(Ee,Ee+Ae,Ae,ue,Ze,Ee+le,Ee+le+me,me):le-Ae/2,Ct=N==="start"?X:N==="center"?X-ye/2:N==="end"?X-ye:H(Ce,Ce+ye,ye,Be,D,Ce+X,Ce+X+L,L),mt=Math.max(0,mt+Ee),Ct=Math.max(0,Ct+Ce);else{mt=K==="start"?le-rt-ue:K==="end"?le-He+Ze+st:K==="nearest"?H(rt,He,Ie,ue,Ze+st,le,le+me,me):le-(rt+Ie/2)+st/2,Ct=N==="start"?X-Ue-Be:N==="center"?X-(Ue+De/2)+ut/2:N==="end"?X-ot+D+ut:H(Ue,ot,De,Be,D+ut,X,X+L,L);var he=g.scrollLeft,Me=g.scrollTop;le+=Me-(mt=Math.max(0,Math.min(Me+mt,g.scrollHeight-Ie+st))),X+=he-(Ct=Math.max(0,Math.min(he+Ct,g.scrollWidth-De+ut)))}Le.push({el:g,top:mt,left:Ct})}return Le};function re(M){return M===Object(M)&&Object.keys(M).length!==0}function S(M,O){O===void 0&&(O="auto");var te="scrollBehavior"in document.body.style;M.forEach(function(Q){var K=Q.el,N=Q.top,W=Q.left;K.scroll&&te?K.scroll({top:N,left:W,behavior:O}):(K.scrollTop=N,K.scrollLeft=W)})}function F(M){return M===!1?{block:"end",inline:"nearest"}:re(M)?M:{block:"start",inline:"nearest"}}function U(M,O){var te=!M.ownerDocument.documentElement.contains(M);if(re(O)&&typeof O.behavior=="function")return O.behavior(te?[]:C(M,O));if(te)return;var Q=F(O);return S(C(M,Q),Q.behavior)}var $=Qe.a=U},aRTE:function(vt,Qe){vt.exports={L:1,M:0,Q:3,H:2}},bT9E:function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return ce});var E=y("VTBJ");function ce(V,H){var C=Object(E.a)({},V);return Array.isArray(H)&&H.forEach(function(re){delete C[re]}),C}},c5Ni:function(vt,Qe,y){},dQei:function(vt,Qe){for(var y={glog:function(ce){if(ce<1)throw new Error("glog("+ce+")");return y.LOG_TABLE[ce]},gexp:function(ce){for(;ce<0;)ce+=255;for(;ce>=256;)ce-=255;return y.EXP_TABLE[ce]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},E=0;E<8;E++)y.EXP_TABLE[E]=1<<E;for(var E=8;E<256;E++)y.EXP_TABLE[E]=y.EXP_TABLE[E-4]^y.EXP_TABLE[E-5]^y.EXP_TABLE[E-6]^y.EXP_TABLE[E-8];for(var E=0;E<255;E++)y.LOG_TABLE[y.EXP_TABLE[E]]=E;vt.exports=y},dWSS:function(vt,Qe,y){var E=y("dQei");function ce(V,H){if(V.length==null)throw new Error(V.length+"/"+H);for(var C=0;C<V.length&&V[C]==0;)C++;this.num=new Array(V.length-C+H);for(var re=0;re<V.length-C;re++)this.num[re]=V[re+C]}ce.prototype={get:function(V){return this.num[V]},getLength:function(){return this.num.length},multiply:function(V){for(var H=new Array(this.getLength()+V.getLength()-1),C=0;C<this.getLength();C++)for(var re=0;re<V.getLength();re++)H[C+re]^=E.gexp(E.glog(this.get(C))+E.glog(V.get(re)));return new ce(H,0)},mod:function(V){if(this.getLength()-V.getLength()<0)return this;for(var H=E.glog(this.get(0))-E.glog(V.get(0)),C=new Array(this.getLength()),re=0;re<this.getLength();re++)C[re]=this.get(re);for(var re=0;re<V.getLength();re++)C[re]^=E.gexp(E.glog(V.get(re))+H);return new ce(C,0).mod(V)}},vt.exports=ce},dejd:function(vt,Qe,y){},dmUQ:function(vt,Qe,y){"use strict";var E=y("Ff2n"),ce=y("rePB"),V=y("1OyB"),H=y("vuIU"),C=y("Ji7U"),re=y("md7G"),S=y("foSv"),F=y("q1tI"),U=y.n(F),$=y("TSYQ"),M=y.n($),O=y("4IlW");function te(me,L){var ke=Object.keys(me);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(me);L&&(ve=ve.filter(function(k){return Object.getOwnPropertyDescriptor(me,k).enumerable})),ke.push.apply(ke,ve)}return ke}function Q(me){for(var L=1;L<arguments.length;L++){var ke=arguments[L]!=null?arguments[L]:{};L%2?te(Object(ke),!0).forEach(function(ve){Object(ce.a)(me,ve,ke[ve])}):Object.getOwnPropertyDescriptors?Object.defineProperties(me,Object.getOwnPropertyDescriptors(ke)):te(Object(ke)).forEach(function(ve){Object.defineProperty(me,ve,Object.getOwnPropertyDescriptor(ke,ve))})}return me}function K(me){var L=N();return function(){var ve=Object(S.a)(me),k;if(L){var G=Object(S.a)(this).constructor;k=Reflect.construct(ve,arguments,G)}else k=ve.apply(this,arguments);return Object(re.a)(this,k)}}function N(){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(me){return!1}}function W(){}function ee(me){me.preventDefault()}var fe=function(L){return L.replace(/[^\w.-]+/g,"")},Re=200,Ke=600,_e=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ye=function(L){return L!=null},Ae=function(L,ke){return ke===L||typeof ke=="number"&&typeof L=="number"&&isNaN(ke)&&isNaN(L)},Ce=function(me){Object(C.a)(ke,me);var L=K(ke);function ke(ve){var k;Object(V.a)(this,ke),k=L.call(this,ve),k.onKeyDown=function(X){var Le=k.props,T=Le.onKeyDown,g=Le.onPressEnter;if(X.keyCode===O.a.UP){var de=k.getRatio(X);k.up(X,de,null),k.stop()}else if(X.keyCode===O.a.DOWN){var Ie=k.getRatio(X);k.down(X,Ie,null),k.stop()}else X.keyCode===O.a.ENTER&&g&&g(X);if(k.recordCursorPosition(),k.lastKeyCode=X.keyCode,T){for(var De=arguments.length,rt=new Array(De>1?De-1:0),ot=1;ot<De;ot++)rt[ot-1]=arguments[ot];T.apply(void 0,[X].concat(rt))}},k.onKeyUp=function(X){var Le=k.props.onKeyUp;if(k.stop(),k.recordCursorPosition(),Le){for(var T=arguments.length,g=new Array(T>1?T-1:0),de=1;de<T;de++)g[de-1]=arguments[de];Le.apply(void 0,[X].concat(g))}},k.onChange=function(X){var Le=k.props.onChange;k.state.focused&&(k.inputting=!0),k.rawInput=k.props.parser(k.getValueFromEvent(X)),k.setState({inputValue:k.rawInput}),Le(k.toNumber(k.rawInput))},k.onMouseUp=function(){var X=k.props.onMouseUp;k.recordCursorPosition(),X&&X.apply(void 0,arguments)},k.onFocus=function(){var X;k.setState({focused:!0}),(X=k.props).onFocus.apply(X,arguments)},k.onBlur=function(){var X=k.props.onBlur;k.inputting=!1,k.setState({focused:!1});var Le=k.getCurrentValidValue(k.state.inputValue),T=k.setValue(Le,W);if(X){var g=k.input.value,de=k.getInputDisplayValue({focus:!1,value:T});k.input.value=de&&Number(de),X.apply(void 0,arguments),k.input.value=g}},k.getRatio=function(X){var Le=1;return X.metaKey||X.ctrlKey?Le=.1:X.shiftKey&&(Le=10),Le},k.getFullNum=function(X){return isNaN(X)?X:/e/i.test(String(X))?Number(X).toFixed(18).replace(/\.?0+$/,""):X},k.getPrecision=function(X){if(ye(k.props.precision))return k.props.precision;var Le=String(X);if(Le.indexOf("e-")>=0)return parseInt(Le.slice(Le.indexOf("e-")+2),10);var T=0;return Le.indexOf(".")>=0&&(T=Le.length-Le.indexOf(".")-1),T},k.getInputDisplayValue=function(X){var Le=X||k.state,T=Le.focused,g=Le.inputValue,de=Le.value,Ie;T?Ie=g:Ie=k.toPrecisionAsStep(de),Ie==null&&(Ie="");var De=k.formatWrapper(Ie);return ye(k.props.decimalSeparator)&&(De=De.toString().replace(".",k.props.decimalSeparator)),De},k.recordCursorPosition=function(){try{k.cursorStart=k.input.selectionStart,k.cursorEnd=k.input.selectionEnd,k.currentValue=k.input.value,k.cursorBefore=k.input.value.substring(0,k.cursorStart),k.cursorAfter=k.input.value.substring(k.cursorEnd)}catch(X){}},k.restoreByAfter=function(X){if(X===void 0)return!1;var Le=k.input.value,T=Le.lastIndexOf(X);if(T===-1)return!1;var g=k.cursorBefore.length;return k.lastKeyCode===O.a.DELETE&&k.cursorBefore.charAt(g-1)===X[0]?(k.fixCaret(g,g),!0):T+X.length===Le.length?(k.fixCaret(T,T),!0):!1},k.partRestoreByAfter=function(X){return X===void 0?!1:Array.prototype.some.call(X,function(Le,T){var g=X.substring(T);return k.restoreByAfter(g)})},k.isNotCompleteNumber=function(X){return isNaN(X)||X===""||X===null||X&&X.toString().indexOf(".")===X.toString().length-1},k.stop=function(){k.autoStepTimer&&clearTimeout(k.autoStepTimer)},k.down=function(X,Le,T){k.pressingUpOrDown=!0,k.step("down",X,Le,T)},k.up=function(X,Le,T){k.pressingUpOrDown=!0,k.step("up",X,Le,T)},k.saveInput=function(X){k.input=X};var G=ve.value;G===void 0&&(G=ve.defaultValue),k.state={focused:ve.autoFocus};var le=k.getValidValue(k.toNumber(G));return k.state=Q(Q({},k.state),{},{inputValue:k.toPrecisionAsStep(le),value:le}),k}return Object(H.a)(ke,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(k){var G=this.props,le=G.value,X=G.onChange,Le=G.max,T=G.min,g=this.state.focused;if(k){if(!Ae(k.value,le)||!Ae(k.max,Le)||!Ae(k.min,T)){var de=g?le:this.getValidValue(le),Ie;this.pressingUpOrDown?Ie=de:this.inputting?Ie=this.rawInput:Ie=this.toPrecisionAsStep(de),this.setState({value:de,inputValue:Ie})}var De="value"in this.props?le:this.state.value;"max"in this.props&&k.max!==Le&&typeof De=="number"&&De>Le&&X&&X(Le),"min"in this.props&&k.min!==T&&typeof De=="number"&&De<T&&X&&X(T)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var rt=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===O.a.BACKSPACE?rt=this.cursorStart-1:this.lastKeyCode===O.a.DELETE&&(rt=this.cursorStart):rt=this.input.value.length,this.fixCaret(rt,rt)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case O.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case O.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(ot){}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(k){var G=k;return G===""?G="":this.isNotCompleteNumber(parseFloat(G))?G=this.state.value:G=this.getValidValue(G),this.toNumber(G)}},{key:"getValueFromEvent",value:function(k){var G=k.target.value.trim().replace(/。/g,".");return ye(this.props.decimalSeparator)&&(G=G.replace(this.props.decimalSeparator,".")),G}},{key:"getValidValue",value:function(k){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,X=parseFloat(k);return isNaN(X)?k:(X<G&&(X=G),X>le&&(X=le),X)}},{key:"setValue",value:function(k,G){var le=this.props.precision,X=this.isNotCompleteNumber(parseFloat(k))?null:parseFloat(k),Le=this.state.value,T=Le===void 0?null:Le,g=this.state.inputValue,de=g===void 0?null:g,Ie=typeof X=="number"?X.toFixed(le):"".concat(X),De=X!==T||Ie!=="".concat(de);return"value"in this.props?(de=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:de},G)):this.setState({value:X,inputValue:this.toPrecisionAsStep(k)},G),De&&this.props.onChange(X),X}},{key:"getMaxPrecision",value:function(k){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,le=this.props,X=le.precision,Le=le.step;if(ye(X))return X;var T=this.getPrecision(G),g=this.getPrecision(Le),de=this.getPrecision(k);return k?Math.max(de,T+g):T+g}},{key:"getPrecisionFactor",value:function(k){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,le=this.getMaxPrecision(k,G);return Math.pow(10,le)}},{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(k){return this.props.formatter?this.props.formatter(k):k}},{key:"toPrecisionAsStep",value:function(k){if(this.isNotCompleteNumber(k)||k==="")return k;var G=Math.abs(this.getMaxPrecision(k));return isNaN(G)?k.toString():Number(k).toFixed(G)}},{key:"toNumber",value:function(k){var G=this.props.precision,le=this.state.focused,X=k&&k.length>16&≤return this.isNotCompleteNumber(k)||X?k:ye(G)?Math.round(k*Math.pow(10,G))/Math.pow(10,G):Number(k)}},{key:"upStep",value:function(k,G){var le=this.props.step,X=this.getPrecisionFactor(k,G),Le=Math.abs(this.getMaxPrecision(k,G)),T=((X*k+X*le*G)/X).toFixed(Le);return this.toNumber(T)}},{key:"downStep",value:function(k,G){var le=this.props.step,X=this.getPrecisionFactor(k,G),Le=Math.abs(this.getMaxPrecision(k,G)),T=((X*k-X*le*G)/X).toFixed(Le);return this.toNumber(T)}},{key:"step",value:function(k,G){var le=this,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Le=arguments.length>3?arguments[3]:void 0;this.stop(),G&&(G.persist(),G.preventDefault());var T=this.props;if(T.disabled)return;var g=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(g))return;var de=this["".concat(k,"Step")](g,X),Ie=de>T.max||de<T.min;if(de>T.max?de=T.max:de<T.min&&(de=T.min),this.setValue(de,null),this.setState({focused:!0},function(){le.pressingUpOrDown=!1}),Ie)return;this.autoStepTimer=setTimeout(function(){le[k](G,X,!0)},Le?Re:Ke)}},{key:"fixCaret",value:function(k,G){if(k===void 0||G===void 0||!this.input||!this.input.value)return;try{var le=this.input.selectionStart,X=this.input.selectionEnd;(k!==le||G!==X)&&this.input.setSelectionRange(k,G)}catch(Le){}}},{key:"render",value:function(){var k,G=this.props,le=G.prefixCls,X=G.disabled,Le=G.readOnly,T=G.useTouch,g=G.autoComplete,de=G.upHandler,Ie=G.downHandler,De=G.className,rt=G.max,ot=G.min,He=G.style,Ue=G.title,Pe=G.onMouseEnter,Be=G.onMouseLeave,ue=G.onMouseOver,D=G.onMouseOut,Ze=G.required,mt=G.onClick,Ct=G.tabIndex,ut=G.type,st=G.placeholder,he=G.id,Me=G.inputMode,Oe=G.pattern,Se=G.step,tt=G.maxLength,Ye=G.autoFocus,lt=G.name,Nt=G.onPaste,_t=G.onInput,xt=Object(E.a)(G,["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"]),dt=this.state,Lt=dt.value,wt=dt.focused,gt=M()(le,(k={},Object(ce.a)(k,De,!!De),Object(ce.a)(k,"".concat(le,"-disabled"),X),Object(ce.a)(k,"".concat(le,"-focused"),wt),k)),Ne={};Object.keys(xt).forEach(function(P){(P.substr(0,5)==="data-"||P.substr(0,5)==="aria-"||P==="role")&&(Ne[P]=xt[P])});var Dt=!Le&&!X,yt=this.getInputDisplayValue(null),We=(Lt||Lt===0)&&(isNaN(Lt)||Number(Lt)>=rt),et=(Lt||Lt===0)&&(isNaN(Lt)||Number(Lt)<=ot),ae=We||X||Le,Z=et||X||Le,ne=M()("".concat(le,"-handler"),"".concat(le,"-handler-up"),Object(ce.a)({},"".concat(le,"-handler-up-disabled"),ae)),x=M()("".concat(le,"-handler"),"".concat(le,"-handler-down"),Object(ce.a)({},"".concat(le,"-handler-down-disabled"),Z)),w=T?{onTouchStart:ae?W:this.up,onTouchEnd:this.stop}:{onMouseDown:ae?W:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},A=T?{onTouchStart:Z?W:this.down,onTouchEnd:this.stop}:{onMouseDown:Z?W:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return U.a.createElement("div",{className:gt,style:He,title:Ue,onMouseEnter:Pe,onMouseLeave:Be,onMouseOver:ue,onMouseOut:D,onFocus:function(){return null},onBlur:function(){return null}},U.a.createElement("div",{className:"".concat(le,"-handler-wrap")},U.a.createElement("span",Object.assign({unselectable:"on"},w,{role:"button","aria-label":"Increase Value","aria-disabled":ae,className:ne}),de||U.a.createElement("span",{unselectable:"on",className:"".concat(le,"-handler-up-inner"),onClick:ee})),U.a.createElement("span",Object.assign({unselectable:"on"},A,{role:"button","aria-label":"Decrease Value","aria-disabled":Z,className:x}),Ie||U.a.createElement("span",{unselectable:"on",className:"".concat(le,"-handler-down-inner"),onClick:ee}))),U.a.createElement("div",{className:"".concat(le,"-input-wrap")},U.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":ot,"aria-valuemax":rt,"aria-valuenow":Lt,required:Ze,type:ut,placeholder:st,onPaste:Nt,onClick:mt,onMouseUp:this.onMouseUp,className:"".concat(le,"-input"),tabIndex:Ct,autoComplete:g,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Dt?this.onKeyDown:W,onKeyUp:Dt?this.onKeyUp:W,autoFocus:Ye,maxLength:tt,readOnly:Le,disabled:X,max:rt,min:ot,step:Se,name:lt,title:Ue,id:he,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(yt),pattern:Oe,inputMode:Me,onInput:_t},Ne))))}}]),ke}(U.a.Component);Ce.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:fe,required:!1,autoComplete:"off"};var Ee=Ce,Fe=Qe.a=Ee},f4xo:function(vt,Qe,y){var E=y("nVVt");function ce(V){this.mode=E.MODE_8BIT_BYTE,this.data=V}ce.prototype={getLength:function(V){return this.data.length},write:function(V){for(var H=0;H<this.data.length;H++)V.put(this.data.charCodeAt(H),8)}},vt.exports=ce},fr4D:function(vt,Qe,y){"use strict";y.d(Qe,"d",function(){return C}),y.d(Qe,"i",function(){return S}),y.d(Qe,"o",function(){return U}),y.d(Qe,"r",function(){return M}),y.d(Qe,"g",function(){return te}),y.d(Qe,"q",function(){return K}),y.d(Qe,"m",function(){return W}),y.d(Qe,"u",function(){return Ke}),y.d(Qe,"j",function(){return ye}),y.d(Qe,"p",function(){return Ce}),y.d(Qe,"t",function(){return Fe}),y.d(Qe,"l",function(){return L}),y.d(Qe,"w",function(){return ve}),y.d(Qe,"n",function(){return G}),y.d(Qe,"a",function(){return X}),y.d(Qe,"h",function(){return T}),y.d(Qe,"e",function(){return De}),y.d(Qe,"s",function(){return ot}),y.d(Qe,"f",function(){return Ue}),y.d(Qe,"v",function(){return Be}),y.d(Qe,"c",function(){return D}),y.d(Qe,"b",function(){return mt}),y.d(Qe,"k",function(){return ut});var E=y("9og8"),ce=y("WmNS"),V=y.n(ce),H=y("ErOA");function C(he){return re.apply(this,arguments)}function re(){return re=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects.json",{method:"post",body:Me}));case 1:case"end":return Se.stop()}},he)})),re.apply(this,arguments)}function S(he,Me){return F.apply(this,arguments)}function F(){return F=Object(E.a)(V.a.mark(function he(Me,Oe){return V.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Oe,".json"),{method:"put",body:Me}));case 1:case"end":return tt.stop()}},he)})),F.apply(this,arguments)}function U(he){return $.apply(this,arguments)}function $(){return $=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/sci_mirror_repositories.json",{method:"get",params:Me}));case 1:case"end":return Se.stop()}},he)})),$.apply(this,arguments)}function M(he){return O.apply(this,arguments)}function O(){return O=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects.json",{method:"get",params:Me}));case 1:case"end":return Se.stop()}},he)})),O.apply(this,arguments)}function te(he,Me){return Q.apply(this,arguments)}function Q(){return Q=Object(E.a)(V.a.mark(function he(Me,Oe){return V.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Me,".json"),{method:"delete",body:Oe}));case 1:case"end":return tt.stop()}},he)})),Q.apply(this,arguments)}function K(he){return N.apply(this,arguments)}function N(){return N=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Me,".json"),{method:"get"}));case 1:case"end":return Se.stop()}},he)})),N.apply(this,arguments)}function W(he){return ee.apply(this,arguments)}function ee(){return ee=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/data_sets.json",{method:"get",params:Me}));case 1:case"end":return Se.stop()}},he)})),ee.apply(this,arguments)}function fe(he){return Re.apply(this,arguments)}function Re(){return Re=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Me,"/remove_data_sets.json"),{method:"get"}));case 1:case"end":return Se.stop()}},he)})),Re.apply(this,arguments)}function Ke(he){return _e.apply(this,arguments)}function _e(){return _e=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Me,"/start_environment.json"),{method:"post"}));case 1:case"end":return Se.stop()}},he)})),_e.apply(this,arguments)}function ye(he,Me){return Ae.apply(this,arguments)}function Ae(){return Ae=Object(E.a)(V.a.mark(function he(Me,Oe){return V.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Me,"/fork_sci_project.json"),{method:"post",body:Oe}));case 1:case"end":return tt.stop()}},he)})),Ae.apply(this,arguments)}function Ce(he,Me){return Ee.apply(this,arguments)}function Ee(){return Ee=Object(E.a)(V.a.mark(function he(Me,Oe){return V.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Me,"/get_data_sets.json"),{method:"get",params:Oe}));case 1:case"end":return tt.stop()}},he)})),Ee.apply(this,arguments)}function Fe(he){return me.apply(this,arguments)}function me(){return me=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Me,"/running_logs.json"),{method:"get"}));case 1:case"end":return Se.stop()}},he)})),me.apply(this,arguments)}function L(he){return ke.apply(this,arguments)}function ke(){return ke=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/attachment_detail.json",{method:"get",params:Me}));case 1:case"end":return Se.stop()}},he)})),ke.apply(this,arguments)}function ve(he){return k.apply(this,arguments)}function k(){return k=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/update_attachment_introduce.json",{method:"PUT",body:Me}));case 1:case"end":return Se.stop()}},he)})),k.apply(this,arguments)}function G(he){return le.apply(this,arguments)}function le(){return le=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/jupyter_host_list.json",{method:"get",params:Me}));case 1:case"end":return Se.stop()}},he)})),le.apply(this,arguments)}function X(he){return Le.apply(this,arguments)}function Le(){return Le=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/add_jupyter_host.json",{method:"post",body:Me}));case 1:case"end":return Se.stop()}},he)})),Le.apply(this,arguments)}function T(he){return g.apply(this,arguments)}function g(){return g=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/edit_jupyter_host.json",{method:"put",body:Me}));case 1:case"end":return Se.stop()}},he)})),g.apply(this,arguments)}function de(he){return Ie.apply(this,arguments)}function Ie(){return Ie=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/jupyter_host_detail.json",{method:"get",params:Me}));case 1:case"end":return Se.stop()}},he)})),Ie.apply(this,arguments)}function De(he){return rt.apply(this,arguments)}function rt(){return rt=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/delete_jupyter_host.json",{method:"delete",body:Me}));case 1:case"end":return Se.stop()}},he)})),rt.apply(this,arguments)}function ot(){return He.apply(this,arguments)}function He(){return He=Object(E.a)(V.a.mark(function he(){return V.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.abrupt("return",Object(H.a)("/api/sci/projects/get_running_list.json",{method:"get"}));case 1:case"end":return Oe.stop()}},he)})),He.apply(this,arguments)}function Ue(he){return Pe.apply(this,arguments)}function Pe(){return Pe=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/".concat(Me,"/delete_pod.json"),{method:"post"}));case 1:case"end":return Se.stop()}},he)})),Pe.apply(this,arguments)}function Be(he){return ue.apply(this,arguments)}function ue(){return ue=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/sci/projects/update_data_set.json",{method:"PUT",body:Me}));case 1:case"end":return Se.stop()}},he)})),ue.apply(this,arguments)}function D(he){return Ze.apply(this,arguments)}function Ze(){return Ze=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/collections.json",{method:"POST",body:Me}));case 1:case"end":return Se.stop()}},he)})),Ze.apply(this,arguments)}function mt(he){return Ct.apply(this,arguments)}function Ct(){return Ct=Object(E.a)(V.a.mark(function he(Me){return V.a.wrap(function(Se){for(;;)switch(Se.prev=Se.next){case 0:return Se.abrupt("return",Object(H.a)("/api/collections/cancel.json",{method:"DELETE",body:Me}));case 1:case"end":return Se.stop()}},he)})),Ct.apply(this,arguments)}function ut(){return st.apply(this,arguments)}function st(){return st=Object(E.a)(V.a.mark(function he(){return V.a.wrap(function(Oe){for(;;)switch(Oe.prev=Oe.next){case 0:return Oe.abrupt("return",Object(H.a)("/api/sci/projects/data_set_tags.json",{method:"GET"}));case 1:case"end":return Oe.stop()}},he)})),st.apply(this,arguments)}},k3GJ:function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return Ca});var E=y("rePB"),ce=y("ODXe"),V=y("Ff2n"),H=y("VTBJ"),C=y("q1tI"),re=y("TSYQ"),S=y.n(re),F=y("Zm9Q"),U=y("6cGi"),$=y("KQm4"),M=y("xEkU"),O=y.n(M),te=y("t23M");function Q(R){var q=Object(C.useRef)(),oe=Object(C.useRef)(!1);function j(){for(var m=arguments.length,_=new Array(m),b=0;b<m;b++)_[b]=arguments[b];oe.current||(O.a.cancel(q.current),q.current=O()(function(){R.apply(void 0,_)}))}return Object(C.useEffect)(function(){return function(){oe.current=!0,O.a.cancel(q.current)}},[]),j}function K(R){var q=Object(C.useRef)([]),oe=Object(C.useState)({}),j=Object(ce.a)(oe,2),m=j[1],_=Object(C.useRef)(typeof R=="function"?R():R),b=Q(function(){var z=_.current;q.current.forEach(function(se){z=se(z)}),q.current=[],_.current=z,m({})});function B(z){q.current.push(z),b()}return[_.current,B]}var N=y("4IlW");function W(R,q){var oe,j=R.prefixCls,m=R.id,_=R.active,b=R.rtl,B=R.tab,z=B.key,se=B.tab,ie=B.disabled,ge=B.closeIcon,je=R.tabBarGutter,it=R.tabPosition,nt=R.closable,ct=R.renderWrapper,zt=R.removeAriaLabel,Qt=R.editable,Xt=R.onClick,$t=R.onRemove,qt=R.onFocus,Jt="".concat(j,"-tab");C.useEffect(function(){return $t},[]);var Yt={};it==="top"||it==="bottom"?Yt[b?"marginLeft":"marginRight"]=je:Yt.marginBottom=je;var hn=Qt&&nt!==!1&&!ie;function nn(Bt){if(ie)return;Xt(Bt)}function Fn(Bt){Bt.preventDefault(),Bt.stopPropagation(),Qt.onEdit("remove",{key:z,event:Bt})}var rn=C.createElement("div",{key:z,ref:q,className:S()(Jt,(oe={},Object(E.a)(oe,"".concat(Jt,"-with-remove"),hn),Object(E.a)(oe,"".concat(Jt,"-active"),_),Object(E.a)(oe,"".concat(Jt,"-disabled"),ie),oe)),style:Yt,onClick:nn},C.createElement("div",{role:"tab","aria-selected":_,id:m&&"".concat(m,"-tab-").concat(z),className:"".concat(Jt,"-btn"),"aria-controls":m&&"".concat(m,"-panel-").concat(z),"aria-disabled":ie,tabIndex:ie?null:0,onClick:function(It){It.stopPropagation(),nn(It)},onKeyDown:function(It){[N.a.SPACE,N.a.ENTER].includes(It.which)&&(It.preventDefault(),nn(It))},onFocus:qt},se),hn&&C.createElement("button",{type:"button","aria-label":zt||"remove",tabIndex:0,className:"".concat(Jt,"-remove"),onClick:function(It){It.stopPropagation(),Fn(It)}},ge||Qt.removeIcon||"\xD7"));return ct&&(rn=ct(rn)),rn}var ee=C.forwardRef(W),fe={width:0,height:0,left:0,top:0};function Re(R,q,oe){return Object(C.useMemo)(function(){for(var j,m=new Map,_=q.get((j=R[0])===null||j===void 0?void 0:j.key)||fe,b=_.left+_.width,B=0;B<R.length;B+=1){var z=R[B].key,se=q.get(z);if(!se){var ie;se=q.get((ie=R[B-1])===null||ie===void 0?void 0:ie.key)||fe}var ge=m.get(z)||Object(H.a)({},se);ge.right=b-ge.left-ge.width,m.set(z,ge)}return m},[R.map(function(j){return j.key}).join("_"),q,oe])}var Ke={width:0,height:0,left:0,top:0,right:0};function _e(R,q,oe,j,m){var _=m.tabs,b=m.tabPosition,B=m.rtl,z,se,ie;["top","bottom"].includes(b)?(z="width",se=B?"right":"left",ie=Math.abs(q.left)):(z="height",se="top",ie=-q.top);var ge=q[z],je=oe[z],it=j[z],nt=ge;return je+it>ge&&(nt=ge-it),Object(C.useMemo)(function(){if(!_.length)return[0,0];for(var ct=_.length,zt=ct,Qt=0;Qt<ct;Qt+=1){var Xt=R.get(_[Qt].key)||Ke;if(Xt[se]+Xt[z]>ie+nt){zt=Qt-1;break}}for(var $t=0,qt=ct-1;qt>=0;qt-=1){var Jt=R.get(_[qt].key)||Ke;if(Jt[se]<ie){$t=qt+1;break}}return[$t,zt]},[R,ie,nt,b,_.map(function(ct){return ct.key}).join("_"),B])}var ye=y("wx14"),Ae=y("1OyB"),Ce=y("vuIU"),Ee=y("JX7q"),Fe=y("Ji7U"),me=y("LK+K"),L=y("I8Z2"),ke=y("bT9E"),ve=y("2GS6"),k=y("Gytx"),G=y.n(k),le=y("U8pU"),X=/iPhone/i,Le=/iPod/i,T=/iPad/i,g=/\bAndroid(?:.+)Mobile\b/i,de=/Android/i,Ie=/\bAndroid(?:.+)SD4930UR\b/i,De=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,rt=/Windows Phone/i,ot=/\bWindows(?:.+)ARM\b/i,He=/BlackBerry/i,Ue=/BB10/i,Pe=/Opera Mini/i,Be=/\b(CriOS|Chrome)(?:.+)Mobile/i,ue=/Mobile(?:.+)Firefox\b/i;function D(R,q){return R.test(q)}function Ze(R){var q=R||(typeof navigator!="undefined"?navigator.userAgent:""),oe=(q||"").split("[FBAN");if(typeof oe[1]!="undefined"){var j=oe,m=Object(ce.a)(j,1);q=m[0]}if(oe=q.split("Twitter"),typeof oe[1]!="undefined"){var _=oe,b=Object(ce.a)(_,1);q=b[0]}var B={apple:{phone:D(X,q)&&!D(rt,q),ipod:D(Le,q),tablet:!D(X,q)&&D(T,q)&&!D(rt,q),device:(D(X,q)||D(Le,q)||D(T,q))&&!D(rt,q)},amazon:{phone:D(Ie,q),tablet:!D(Ie,q)&&D(De,q),device:D(Ie,q)||D(De,q)},android:{phone:!D(rt,q)&&D(Ie,q)||!D(rt,q)&&D(g,q),tablet:!D(rt,q)&&!D(Ie,q)&&!D(g,q)&&(D(De,q)||D(de,q)),device:!D(rt,q)&&(D(Ie,q)||D(De,q)||D(g,q)||D(de,q))||D(/\bokhttp\b/i,q)},windows:{phone:D(rt,q),tablet:D(ot,q),device:D(rt,q)||D(ot,q)},other:{blackberry:D(He,q),blackberry10:D(Ue,q),opera:D(Pe,q),firefox:D(ue,q),chrome:D(Be,q),device:D(He,q)||D(Ue,q)||D(Pe,q)||D(ue,q)||D(Be,q)},any:null,phone:null,tablet:null};return B.any=B.apple.device||B.android.device||B.windows.device||B.other.device,B.phone=B.apple.phone||B.android.phone||B.windows.phone,B.tablet=B.apple.tablet||B.android.tablet||B.windows.tablet,B}var mt=Object(H.a)(Object(H.a)({},Ze()),{},{isMobile:Ze}),Ct=mt;function ut(){}function st(R,q,oe){var j=q||"";return R.key||"".concat(j,"item_").concat(oe)}function he(R){return"".concat(R,"-menu-")}function Me(R,q){var oe=-1;C.Children.forEach(R,function(j){oe+=1,j&&j.type&&j.type.isMenuItemGroup?C.Children.forEach(j.props.children,function(m){oe+=1,q(m,oe)}):q(j,oe)})}function Oe(R,q,oe){if(!R||oe.find)return;C.Children.forEach(R,function(j){if(j){var m=j.type;if(!m||!(m.isSubMenu||m.isMenuItem||m.isMenuItemGroup))return;q.indexOf(j.key)!==-1?oe.find=!0:j.props.children&&Oe(j.props.children,q,oe)}})}var Se=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],tt=function(q){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,j=q&&typeof q.getBoundingClientRect=="function"&&q.getBoundingClientRect().width;if(j){if(oe){var m=getComputedStyle(q),_=m.marginLeft,b=m.marginRight;j+=+_.replace("px","")+ +b.replace("px","")}j=+j.toFixed(6)}return j||0},Ye=function(q,oe,j){q&&Object(le.a)(q.style)==="object"&&(q.style[oe]=j)},lt=function(){return Ct.any},Nt=y("bdgK"),_t=y("i8i4"),xt=y.n(_t),dt=y("wgJM"),Lt=y("l4aY"),wt=y("m+aA"),gt=y("c+Xe"),Ne=y("zT1h"),Dt=y("QC+M");function yt(R,q,oe){return oe?R[0]===q[0]:R[0]===q[0]&&R[1]===q[1]}function We(R,q,oe){var j=R[q]||{};return Object(H.a)(Object(H.a)({},j),oe)}function et(R,q,oe,j){for(var m=oe.points,_=Object.keys(R),b=0;b<_.length;b+=1){var B=_[b];if(yt(R[B].points,m,j))return"".concat(q,"-placement-").concat(B)}return""}var ae=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var R=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(R)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(R==null?void 0:R.substr(0,4)))},Z=y("MNnm");function ne(R,q){var oe={};return oe[R.toLowerCase()]=q.toLowerCase(),oe["Webkit".concat(R)]="webkit".concat(q),oe["Moz".concat(R)]="moz".concat(q),oe["ms".concat(R)]="MS".concat(q),oe["O".concat(R)]="o".concat(q.toLowerCase()),oe}function x(R,q){var oe={animationend:ne("Animation","AnimationEnd"),transitionend:ne("Transition","TransitionEnd")};return R&&("AnimationEvent"in q||delete oe.animationend.animation,"TransitionEvent"in q||delete oe.transitionend.transition),oe}var w=x(Object(Z.a)(),typeof window!="undefined"?window:{}),A={};if(Object(Z.a)()){var P=document.createElement("div");A=P.style}var be={};function Te(R){if(be[R])return be[R];var q=w[R];if(q)for(var oe=Object.keys(q),j=oe.length,m=0;m<j;m+=1){var _=oe[m];if(Object.prototype.hasOwnProperty.call(q,_)&&_ in A)return be[R]=q[_],be[R]}return""}var Xe=Te("animationend"),Et=Te("transitionend"),Gt=!!(Xe&&Et),Ve=Xe||"animationend",Pt=Et||"transitionend";function St(R,q){if(!R)return null;if(Object(le.a)(R)==="object"){var oe=q.replace(/-\w/g,function(j){return j[1].toUpperCase()});return R[oe]}return"".concat(R,"-").concat(q)}var ht="none",on="appear",Zt="enter",En="leave",vn="none",Ft="prepare",zn="start",Bn="active",At="end";function hi(R){var q=Object(C.useRef)(!1),oe=Object(C.useState)(R),j=Object(ce.a)(oe,2),m=j[0],_=j[1];function b(B){q.current||_(B)}return Object(C.useEffect)(function(){return function(){q.current=!0}},[]),[m,b]}var oi=Object(Z.a)()?C.useLayoutEffect:C.useEffect,ai=oi,Si=function(){var R=C.useRef(null);function q(){dt.a.cancel(R.current)}function oe(j){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;q();var _=Object(dt.a)(function(){m<=1?j({isCanceled:function(){return _!==R.current}}):oe(j,m-1)});R.current=_}return C.useEffect(function(){return function(){q()}},[]),[oe,q]},or=[Ft,zn,Bn,At],Bi=!1,pn=!0;function Mt(R){return R===Bn||R===At}var Fi=function(R,q){var oe=C.useState(vn),j=Object(ce.a)(oe,2),m=j[0],_=j[1],b=Si(),B=Object(ce.a)(b,2),z=B[0],se=B[1];function ie(){_(Ft)}return ai(function(){if(m!==vn&&m!==At){var ge=or.indexOf(m),je=or[ge+1],it=q(m);it===Bi?_(je):z(function(nt){function ct(){if(nt.isCanceled())return;_(je)}it===!0?ct():Promise.resolve(it).then(ct)})}},[R,m]),C.useEffect(function(){return function(){se()}},[]),[ie,m]},hr=function(R){var q=Object(C.useRef)(),oe=Object(C.useRef)(R);oe.current=R;var j=C.useCallback(function(b){oe.current(b)},[]);function m(b){b&&(b.removeEventListener(Pt,j),b.removeEventListener(Ve,j))}function _(b){q.current&&q.current!==b&&m(q.current),b&&b!==q.current&&(b.addEventListener(Pt,j),b.addEventListener(Ve,j),q.current=b)}return C.useEffect(function(){return function(){m(q.current)}},[]),[_,m]};function ki(R,q,oe,j){var m=j.motionEnter,_=m===void 0?!0:m,b=j.motionAppear,B=b===void 0?!0:b,z=j.motionLeave,se=z===void 0?!0:z,ie=j.motionDeadline,ge=j.motionLeaveImmediately,je=j.onAppearPrepare,it=j.onEnterPrepare,nt=j.onLeavePrepare,ct=j.onAppearStart,zt=j.onEnterStart,Qt=j.onLeaveStart,Xt=j.onAppearActive,$t=j.onEnterActive,qt=j.onLeaveActive,Jt=j.onAppearEnd,Yt=j.onEnterEnd,hn=j.onLeaveEnd,nn=j.onVisibleChanged,Fn=hi(),rn=Object(ce.a)(Fn,2),Bt=rn[0],It=rn[1],sn=hi(ht),fn=Object(ce.a)(sn,2),Rt=fn[0],gn=fn[1],Hn=hi(null),Cn=Object(ce.a)(Hn,2),Ln=Cn[0],Tn=Cn[1],Qn=Object(C.useRef)(!1),fi=Object(C.useRef)(null),Gn=Object(C.useRef)(!1),Mi=Object(C.useRef)(null);function er(){var Nn=oe();return Nn||Mi.current}var Pi=Object(C.useRef)(!1);function pi(Nn){var Mn=er();if(Nn&&!Nn.deadline&&Nn.target!==Mn)return;var mi;Rt===on&&Pi.current?mi=Jt==null?void 0:Jt(Mn,Nn):Rt===Zt&&Pi.current?mi=Yt==null?void 0:Yt(Mn,Nn):Rt===En&&Pi.current&&(mi=hn==null?void 0:hn(Mn,Nn)),mi!==!1&&!Gn.current&&(gn(ht),Tn(null))}var jn=hr(pi),Dn=Object(ce.a)(jn,1),Kn=Dn[0],Wn=C.useMemo(function(){var Nn,Mn,mi;switch(Rt){case"appear":return Nn={},Object(E.a)(Nn,Ft,je),Object(E.a)(Nn,zn,ct),Object(E.a)(Nn,Bn,Xt),Nn;case"enter":return Mn={},Object(E.a)(Mn,Ft,it),Object(E.a)(Mn,zn,zt),Object(E.a)(Mn,Bn,$t),Mn;case"leave":return mi={},Object(E.a)(mi,Ft,nt),Object(E.a)(mi,zn,Qt),Object(E.a)(mi,Bn,qt),mi;default:return{}}},[Rt]),tr=Fi(Rt,function(Nn){if(Nn===Ft){var Mn=Wn[Ft];return Mn?Mn(er()):Bi}if(An in Wn){var mi;Tn(((mi=Wn[An])===null||mi===void 0?void 0:mi.call(Wn,er(),null))||null)}return An===Bn&&(Kn(er()),ie>0&&(clearTimeout(fi.current),fi.current=setTimeout(function(){pi({deadline:!0})},ie))),pn}),Tr=Object(ce.a)(tr,2),Ar=Tr[0],An=Tr[1],dr=Mt(An);Pi.current=dr,ai(function(){It(q);var Nn=Qn.current;if(Qn.current=!0,!R)return;var Mn;!Nn&&q&&B&&(Mn=on),Nn&&q&&_&&(Mn=Zt),(Nn&&!q&&se||!Nn&&ge&&!q&&se)&&(Mn=En),Mn&&(gn(Mn),Ar())},[q]),Object(C.useEffect)(function(){(Rt===on&&!B||Rt===Zt&&!_||Rt===En&&!se)&&gn(ht)},[B,_,se]),Object(C.useEffect)(function(){return function(){clearTimeout(fi.current),Gn.current=!0}},[]),Object(C.useEffect)(function(){Bt!==void 0&&Rt===ht&&(nn==null||nn(Bt))},[Bt,Rt]);var Rr=Ln;return Wn[Ft]&&An===zn&&(Rr=Object(H.a)({transition:"none"},Rr)),[Rt,An,Rr,Bt!=null?Bt:q]}var ln=function(R){Object(Fe.a)(oe,R);var q=Object(me.a)(oe);function oe(){return Object(Ae.a)(this,oe),q.apply(this,arguments)}return Object(Ce.a)(oe,[{key:"render",value:function(){return this.props.children}}]),oe}(C.Component),Yi=ln;function fr(R){var q=R;Object(le.a)(R)==="object"&&(q=R.transitionSupport);function oe(m){return!!(m.motionName&&q)}var j=C.forwardRef(function(m,_){var b=m.visible,B=b===void 0?!0:b,z=m.removeOnLeave,se=z===void 0?!0:z,ie=m.forceRender,ge=m.children,je=m.motionName,it=m.leavedClassName,nt=m.eventProps,ct=oe(m),zt=Object(C.useRef)(),Qt=Object(C.useRef)();function Xt(){try{return Object(wt.a)(zt.current||Qt.current)}catch(gn){return null}}var $t=ki(ct,B,Xt,m),qt=Object(ce.a)($t,4),Jt=qt[0],Yt=qt[1],hn=qt[2],nn=qt[3],Fn=C.useRef(nn);nn&&(Fn.current=!0);var rn=Object(C.useRef)(_);rn.current=_;var Bt=C.useCallback(function(gn){zt.current=gn,Object(gt.b)(rn.current,gn)},[]),It,sn=Object(H.a)(Object(H.a)({},nt),{},{visible:B});if(!ge)It=null;else if(Jt===ht||!oe(m))nn?It=ge(Object(H.a)({},sn),Bt):!se&&Fn.current?It=ge(Object(H.a)(Object(H.a)({},sn),{},{className:it}),Bt):ie?It=ge(Object(H.a)(Object(H.a)({},sn),{},{style:{display:"none"}}),Bt):It=null;else{var fn,Rt;Yt===Ft?Rt="prepare":Mt(Yt)?Rt="active":Yt===zn&&(Rt="start"),It=ge(Object(H.a)(Object(H.a)({},sn),{},{className:S()(St(je,Jt),(fn={},Object(E.a)(fn,St(je,"".concat(Jt,"-").concat(Rt)),Rt),Object(E.a)(fn,je,typeof je=="string"),fn)),style:hn}),Bt)}return C.createElement(Yi,{ref:Qt},It)});return j.displayName="CSSMotion",j}var pr=fr(Gt),qe="add",Ht="keep",Ji="remove",ar="removed";function mr(R){var q;return R&&Object(le.a)(R)==="object"&&"key"in R?q=R:q={key:R},Object(H.a)(Object(H.a)({},q),{},{key:String(q.key)})}function gr(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return R.map(mr)}function d(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],oe=[],j=0,m=q.length,_=gr(R),b=gr(q);_.forEach(function(se){for(var ie=!1,ge=j;ge<m;ge+=1){var je=b[ge];if(je.key===se.key){j<ge&&(oe=oe.concat(b.slice(j,ge).map(function(it){return Object(H.a)(Object(H.a)({},it),{},{status:qe})})),j=ge),oe.push(Object(H.a)(Object(H.a)({},je),{},{status:Ht})),j+=1,ie=!0;break}}ie||oe.push(Object(H.a)(Object(H.a)({},se),{},{status:Ji}))}),j<m&&(oe=oe.concat(b.slice(j).map(function(se){return Object(H.a)(Object(H.a)({},se),{},{status:qe})})));var B={};oe.forEach(function(se){var ie=se.key;B[ie]=(B[ie]||0)+1});var z=Object.keys(B).filter(function(se){return B[se]>1});return z.forEach(function(se){oe=oe.filter(function(ie){var ge=ie.key,je=ie.status;return ge!==se||je!==Ji}),oe.forEach(function(ie){ie.key===se&&(ie.status=Ht)})}),oe}var o=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function a(R){var q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pr,oe=function(j){Object(Fe.a)(_,j);var m=Object(me.a)(_);function _(){var b;return Object(Ae.a)(this,_),b=m.apply(this,arguments),b.state={keyEntities:[]},b.removeKey=function(B){b.setState(function(z){var se=z.keyEntities;return{keyEntities:se.map(function(ie){return ie.key!==B?ie:Object(H.a)(Object(H.a)({},ie),{},{status:ar})})}})},b}return Object(Ce.a)(_,[{key:"render",value:function(){var B=this,z=this.state.keyEntities,se=this.props,ie=se.component,ge=se.children,je=se.onVisibleChanged,it=Object(V.a)(se,["component","children","onVisibleChanged"]),nt=ie||C.Fragment,ct={};return o.forEach(function(zt){ct[zt]=it[zt],delete it[zt]}),delete it.keys,C.createElement(nt,it,z.map(function(zt){var Qt=zt.status,Xt=Object(V.a)(zt,["status"]),$t=Qt===qe||Qt===Ht;return C.createElement(q,Object(ye.a)({},ct,{key:Xt.key,visible:$t,eventProps:Xt,onVisibleChanged:function(Jt){je==null||je(Jt,{key:Xt.key}),Jt||B.removeKey(Xt.key)}}),ge)}))}}],[{key:"getDerivedStateFromProps",value:function(B,z){var se=B.keys,ie=z.keyEntities,ge=gr(se),je=d(ie,ge);return{keyEntities:je.filter(function(it){var nt=ie.find(function(ct){var zt=ct.key;return it.key===zt});return!(nt&&nt.status===ar&&it.status===Ji)})}}}]),_}(C.Component);return oe.defaultProps={component:"div"},oe}var u=a(Gt),p=pr;function c(R){var q=R.prefixCls,oe=R.motion,j=R.animation,m=R.transitionName;return oe||(j?{motionName:"".concat(q,"-").concat(j)}:m?{motionName:m}:null)}function J(R){var q=R.prefixCls,oe=R.visible,j=R.zIndex,m=R.mask,_=R.maskMotion,b=R.maskAnimation,B=R.maskTransitionName;if(!m)return null;var z={};return(_||B||b)&&(z=Object(H.a)({motionAppear:!0},c({motion:_,prefixCls:q,transitionName:B,animation:b}))),C.createElement(p,Object(ye.a)({},z,{visible:oe,removeOnLeave:!0}),function(se){var ie=se.className;return C.createElement("div",{style:{zIndex:j},className:S()("".concat(q,"-mask"),ie)})})}var Ge=y("9mu1"),we=y("o0o1"),Ot=y.n(we),$e=y("HaE+"),Wt=["measure","align",null,"motion"],dn=function(R,q){var oe=Object(C.useState)(null),j=Object(ce.a)(oe,2),m=j[0],_=j[1],b=Object(C.useRef)(),B=Object(C.useRef)(!1);function z(ge){B.current||_(ge)}function se(){dt.a.cancel(b.current)}function ie(ge){se(),b.current=Object(dt.a)(function(){z(function(je){switch(m){case"align":return"motion";case"motion":return"stable";default:}return je}),ge==null||ge()})}return Object(C.useEffect)(function(){z("measure")},[R]),Object(C.useEffect)(function(){switch(m){case"measure":q();break;default:}m&&(b.current=Object(dt.a)(Object($e.a)(Ot.a.mark(function ge(){var je,it;return Ot.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:je=Wt.indexOf(m),it=Wt[je+1],it&&je!==-1&&z(it);case 3:case"end":return ct.stop()}},ge)}))))},[m]),Object(C.useEffect)(function(){return function(){B.current=!0,se()}},[]),[m,ie]},Sn=function(R){var q=C.useState({width:0,height:0}),oe=Object(ce.a)(q,2),j=oe[0],m=oe[1];function _(B){m({width:B.offsetWidth,height:B.offsetHeight})}var b=C.useMemo(function(){var B={};if(R){var z=j.width,se=j.height;R.indexOf("height")!==-1&&se?B.height=se:R.indexOf("minHeight")!==-1&&se&&(B.minHeight=se),R.indexOf("width")!==-1&&z?B.width=z:R.indexOf("minWidth")!==-1&&z&&(B.minWidth=z)}return B},[R,j]);return[b,_]},Ri=C.forwardRef(function(R,q){var oe=R.visible,j=R.prefixCls,m=R.className,_=R.style,b=R.children,B=R.zIndex,z=R.stretch,se=R.destroyPopupOnHide,ie=R.forceRender,ge=R.align,je=R.point,it=R.getRootDomNode,nt=R.getClassNameFromAlign,ct=R.onAlign,zt=R.onMouseEnter,Qt=R.onMouseLeave,Xt=R.onMouseDown,$t=R.onTouchStart,qt=Object(C.useRef)(),Jt=Object(C.useRef)(),Yt=Object(C.useState)(),hn=Object(ce.a)(Yt,2),nn=hn[0],Fn=hn[1],rn=Sn(z),Bt=Object(ce.a)(rn,2),It=Bt[0],sn=Bt[1];function fn(){z&&sn(it())}var Rt=dn(oe,fn),gn=Object(ce.a)(Rt,2),Hn=gn[0],Cn=gn[1],Ln=Object(C.useRef)();function Tn(){return je||it}function Qn(){var jn;(jn=qt.current)===null||jn===void 0||jn.forceAlign()}function fi(jn,Dn){var Kn=nt(Dn);nn!==Kn&&Fn(Kn),Hn==="align"&&(nn!==Kn?Promise.resolve().then(function(){Qn()}):Cn(function(){var Wn;(Wn=Ln.current)===null||Wn===void 0||Wn.call(Ln)}),ct==null||ct(jn,Dn))}var Gn=Object(H.a)({},c(R));["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(jn){var Dn=Gn[jn];Gn[jn]=function(Kn,Wn){return Cn(),Dn==null?void 0:Dn(Kn,Wn)}});function Mi(){return new Promise(function(jn){Ln.current=jn})}C.useEffect(function(){!Gn.motionName&&Hn==="motion"&&Cn()},[Gn.motionName,Hn]),C.useImperativeHandle(q,function(){return{forceAlign:Qn,getElement:function(){return Jt.current}}});var er=Object(H.a)(Object(H.a)({},It),{},{zIndex:B,opacity:Hn==="motion"||Hn==="stable"||!oe?void 0:0,pointerEvents:Hn==="stable"?void 0:"none"},_),Pi=!0;(ge==null?void 0:ge.points)&&(Hn==="align"||Hn==="stable")&&(Pi=!1);var pi=b;return C.Children.count(b)>1&&(pi=C.createElement("div",{className:"".concat(j,"-content")},b)),C.createElement(p,Object(ye.a)({visible:oe,ref:Jt,leavedClassName:"".concat(j,"-hidden")},Gn,{onAppearPrepare:Mi,onEnterPrepare:Mi,removeOnLeave:se,forceRender:ie}),function(jn,Dn){var Kn=jn.className,Wn=jn.style,tr=S()(j,m,nn,Kn);return C.createElement(Ge.a,{target:Tn(),key:"popup",ref:qt,monitorWindowResize:!0,disabled:Pi,align:ge,onAlign:fi},C.createElement("div",{ref:Dn,className:tr,onMouseEnter:zt,onMouseLeave:Qt,onMouseDownCapture:Xt,onTouchStartCapture:$t,style:Object(H.a)(Object(H.a)({},Wn),er)},pi))})});Ri.displayName="PopupInner";var Hi=Ri,ei=C.forwardRef(function(R,q){var oe=R.prefixCls,j=R.visible,m=R.zIndex,_=R.children,b=R.mobile;b=b===void 0?{}:b;var B=b.popupClassName,z=b.popupStyle,se=b.popupMotion,ie=se===void 0?{}:se,ge=b.popupRender,je=C.useRef();C.useImperativeHandle(q,function(){return{forceAlign:function(){},getElement:function(){return je.current}}});var it=Object(H.a)({zIndex:m},z),nt=_;return C.Children.count(_)>1&&(nt=C.createElement("div",{className:"".concat(oe,"-content")},_)),ge&&(nt=ge(nt)),C.createElement(p,Object(ye.a)({visible:j,ref:je,removeOnLeave:!0},ie),function(ct,zt){var Qt=ct.className,Xt=ct.style,$t=S()(oe,B,Qt);return C.createElement("div",{ref:zt,className:$t,style:Object(H.a)(Object(H.a)({},Xt),it)},nt)})});ei.displayName="MobilePopupInner";var Zi=ei,Gr=["visible","mobile"],xi=C.forwardRef(function(R,q){var oe=R.visible,j=R.mobile,m=Object(V.a)(R,Gr),_=Object(C.useState)(oe),b=Object(ce.a)(_,2),B=b[0],z=b[1],se=Object(C.useState)(!1),ie=Object(ce.a)(se,2),ge=ie[0],je=ie[1],it=Object(H.a)(Object(H.a)({},m),{},{visible:B});Object(C.useEffect)(function(){z(oe),oe&&j&&je(ae())},[oe,j]);var nt=ge?C.createElement(Zi,Object(ye.a)({},it,{mobile:j,ref:q})):C.createElement(Hi,Object(ye.a)({},it,{ref:q}));return C.createElement("div",null,C.createElement(J,it),nt)});xi.displayName="Popup";var _i=xi,sr=C.createContext(null),vr=sr;function Wi(){}function lr(){return""}function zi(R){return R?R.ownerDocument:window.document}var so=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function Kr(R){var q=function(oe){Object(Fe.a)(m,oe);var j=Object(me.a)(m);function m(_){var b;Object(Ae.a)(this,m),b=j.call(this,_),b.popupRef=C.createRef(),b.triggerRef=C.createRef(),b.attachId=void 0,b.clickOutsideHandler=void 0,b.touchOutsideHandler=void 0,b.contextMenuOutsideHandler1=void 0,b.contextMenuOutsideHandler2=void 0,b.mouseDownTimeout=void 0,b.focusTime=void 0,b.preClickTime=void 0,b.preTouchTime=void 0,b.delayTimer=void 0,b.hasPopupMouseDown=void 0,b.onMouseEnter=function(z){var se=b.props.mouseEnterDelay;b.fireEvents("onMouseEnter",z),b.delaySetPopupVisible(!0,se,se?null:z)},b.onMouseMove=function(z){b.fireEvents("onMouseMove",z),b.setPoint(z)},b.onMouseLeave=function(z){b.fireEvents("onMouseLeave",z),b.delaySetPopupVisible(!1,b.props.mouseLeaveDelay)},b.onPopupMouseEnter=function(){b.clearDelayTimer()},b.onPopupMouseLeave=function(z){var se;if(z.relatedTarget&&!z.relatedTarget.setTimeout&&Object(Lt.a)((se=b.popupRef.current)===null||se===void 0?void 0:se.getElement(),z.relatedTarget))return;b.delaySetPopupVisible(!1,b.props.mouseLeaveDelay)},b.onFocus=function(z){b.fireEvents("onFocus",z),b.clearDelayTimer(),b.isFocusToShow()&&(b.focusTime=Date.now(),b.delaySetPopupVisible(!0,b.props.focusDelay))},b.onMouseDown=function(z){b.fireEvents("onMouseDown",z),b.preClickTime=Date.now()},b.onTouchStart=function(z){b.fireEvents("onTouchStart",z),b.preTouchTime=Date.now()},b.onBlur=function(z){b.fireEvents("onBlur",z),b.clearDelayTimer(),b.isBlurToHide()&&b.delaySetPopupVisible(!1,b.props.blurDelay)},b.onContextMenu=function(z){z.preventDefault(),b.fireEvents("onContextMenu",z),b.setPopupVisible(!0,z)},b.onContextMenuClose=function(){b.isContextMenuToShow()&&b.close()},b.onClick=function(z){if(b.fireEvents("onClick",z),b.focusTime){var se;if(b.preClickTime&&b.preTouchTime?se=Math.min(b.preClickTime,b.preTouchTime):b.preClickTime?se=b.preClickTime:b.preTouchTime&&(se=b.preTouchTime),Math.abs(se-b.focusTime)<20)return;b.focusTime=0}b.preClickTime=0,b.preTouchTime=0,b.isClickToShow()&&(b.isClickToHide()||b.isBlurToHide())&&z&&z.preventDefault&&z.preventDefault();var ie=!b.state.popupVisible;(b.isClickToHide()&&!ie||ie&&b.isClickToShow())&&b.setPopupVisible(!b.state.popupVisible,z)},b.onPopupMouseDown=function(){if(b.hasPopupMouseDown=!0,clearTimeout(b.mouseDownTimeout),b.mouseDownTimeout=window.setTimeout(function(){b.hasPopupMouseDown=!1},0),b.context){var z;(z=b.context).onPopupMouseDown.apply(z,arguments)}},b.onDocumentClick=function(z){if(b.props.mask&&!b.props.maskClosable)return;var se=z.target,ie=b.getRootDomNode(),ge=b.getPopupDomNode();(!Object(Lt.a)(ie,se)||b.isContextMenuOnly())&&!Object(Lt.a)(ge,se)&&!b.hasPopupMouseDown&&b.close()},b.getRootDomNode=function(){var z=b.props.getTriggerDOMNode;if(z)return z(b.triggerRef.current);try{var se=Object(wt.a)(b.triggerRef.current);if(se)return se}catch(ie){}return xt.a.findDOMNode(Object(Ee.a)(b))},b.getPopupClassNameFromAlign=function(z){var se=[],ie=b.props,ge=ie.popupPlacement,je=ie.builtinPlacements,it=ie.prefixCls,nt=ie.alignPoint,ct=ie.getPopupClassNameFromAlign;return ge&&je&&se.push(et(je,it,z,nt)),ct&&se.push(ct(z)),se.join(" ")},b.getComponent=function(){var z=b.props,se=z.prefixCls,ie=z.destroyPopupOnHide,ge=z.popupClassName,je=z.onPopupAlign,it=z.popupMotion,nt=z.popupAnimation,ct=z.popupTransitionName,zt=z.popupStyle,Qt=z.mask,Xt=z.maskAnimation,$t=z.maskTransitionName,qt=z.maskMotion,Jt=z.zIndex,Yt=z.popup,hn=z.stretch,nn=z.alignPoint,Fn=z.mobile,rn=z.forceRender,Bt=b.state,It=Bt.popupVisible,sn=Bt.point,fn=b.getPopupAlign(),Rt={};return b.isMouseEnterToShow()&&(Rt.onMouseEnter=b.onPopupMouseEnter),b.isMouseLeaveToHide()&&(Rt.onMouseLeave=b.onPopupMouseLeave),Rt.onMouseDown=b.onPopupMouseDown,Rt.onTouchStart=b.onPopupMouseDown,C.createElement(_i,Object(ye.a)({prefixCls:se,destroyPopupOnHide:ie,visible:It,point:nn&&sn,className:ge,align:fn,onAlign:je,animation:nt,getClassNameFromAlign:b.getPopupClassNameFromAlign},Rt,{stretch:hn,getRootDomNode:b.getRootDomNode,style:zt,mask:Qt,zIndex:Jt,transitionName:ct,maskAnimation:Xt,maskTransitionName:$t,maskMotion:qt,ref:b.popupRef,motion:it,mobile:Fn,forceRender:rn}),typeof Yt=="function"?Yt():Yt)},b.attachParent=function(z){dt.a.cancel(b.attachId);var se=b.props,ie=se.getPopupContainer,ge=se.getDocument,je=b.getRootDomNode(),it;ie?(je||ie.length===0)&&(it=ie(je)):it=ge(b.getRootDomNode()).body,it?it.appendChild(z):b.attachId=Object(dt.a)(function(){b.attachParent(z)})},b.getContainer=function(){var z=b.props.getDocument,se=z(b.getRootDomNode()).createElement("div");return se.style.position="absolute",se.style.top="0",se.style.left="0",se.style.width="100%",b.attachParent(se),se},b.setPoint=function(z){var se=b.props.alignPoint;if(!se||!z)return;b.setState({point:{pageX:z.pageX,pageY:z.pageY}})},b.handlePortalUpdate=function(){b.state.prevPopupVisible!==b.state.popupVisible&&b.props.afterPopupVisibleChange(b.state.popupVisible)},b.triggerContextValue={onPopupMouseDown:b.onPopupMouseDown};var B;return"popupVisible"in _?B=!!_.popupVisible:B=!!_.defaultPopupVisible,b.state={prevPopupVisible:B,popupVisible:B},so.forEach(function(z){b["fire".concat(z)]=function(se){b.fireEvents(z,se)}}),b}return Object(Ce.a)(m,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var b=this.props,B=this.state;if(B.popupVisible){var z;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(z=b.getDocument(this.getRootDomNode()),this.clickOutsideHandler=Object(Ne.a)(z,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(z=z||b.getDocument(this.getRootDomNode()),this.touchOutsideHandler=Object(Ne.a)(z,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(z=z||b.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=Object(Ne.a)(z,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=Object(Ne.a)(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),dt.a.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var b;return((b=this.popupRef.current)===null||b===void 0?void 0:b.getElement())||null}},{key:"getPopupAlign",value:function(){var b=this.props,B=b.popupPlacement,z=b.popupAlign,se=b.builtinPlacements;return B&&se?We(se,B,z):z}},{key:"setPopupVisible",value:function(b,B){var z=this.props.alignPoint,se=this.state.popupVisible;this.clearDelayTimer(),se!==b&&("popupVisible"in this.props||this.setState({popupVisible:b,prevPopupVisible:se}),this.props.onPopupVisibleChange(b)),z&&B&&b&&this.setPoint(B)}},{key:"delaySetPopupVisible",value:function(b,B,z){var se=this,ie=B*1e3;if(this.clearDelayTimer(),ie){var ge=z?{pageX:z.pageX,pageY:z.pageY}:null;this.delayTimer=window.setTimeout(function(){se.setPopupVisible(b,ge),se.clearDelayTimer()},ie)}else this.setPopupVisible(b,z)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(b){var B=this.props.children.props,z=this.props;return B[b]&&z[b]?this["fire".concat(b)]:B[b]||z[b]}},{key:"isClickToShow",value:function(){var b=this.props,B=b.action,z=b.showAction;return B.indexOf("click")!==-1||z.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var b=this.props.action;return b==="contextMenu"||b.length===1&&b[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var b=this.props,B=b.action,z=b.showAction;return B.indexOf("contextMenu")!==-1||z.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var b=this.props,B=b.action,z=b.hideAction;return B.indexOf("click")!==-1||z.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var b=this.props,B=b.action,z=b.showAction;return B.indexOf("hover")!==-1||z.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var b=this.props,B=b.action,z=b.hideAction;return B.indexOf("hover")!==-1||z.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var b=this.props,B=b.action,z=b.showAction;return B.indexOf("focus")!==-1||z.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var b=this.props,B=b.action,z=b.hideAction;return B.indexOf("focus")!==-1||z.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var b;(b=this.popupRef.current)===null||b===void 0||b.forceAlign()}}},{key:"fireEvents",value:function(b,B){var z=this.props.children.props[b];z&&z(B);var se=this.props[b];se&&se(B)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var b=this.state.popupVisible,B=this.props,z=B.children,se=B.forceRender,ie=B.alignPoint,ge=B.className,je=B.autoDestroy,it=C.Children.only(z),nt={key:"trigger"};this.isContextMenuToShow()?nt.onContextMenu=this.onContextMenu:nt.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(nt.onClick=this.onClick,nt.onMouseDown=this.onMouseDown,nt.onTouchStart=this.onTouchStart):(nt.onClick=this.createTwoChains("onClick"),nt.onMouseDown=this.createTwoChains("onMouseDown"),nt.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(nt.onMouseEnter=this.onMouseEnter,ie&&(nt.onMouseMove=this.onMouseMove)):nt.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?nt.onMouseLeave=this.onMouseLeave:nt.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(nt.onFocus=this.onFocus,nt.onBlur=this.onBlur):(nt.onFocus=this.createTwoChains("onFocus"),nt.onBlur=this.createTwoChains("onBlur"));var ct=S()(it&&it.props&&it.props.className,ge);ct&&(nt.className=ct);var zt=Object(H.a)({},nt);Object(gt.c)(it)&&(zt.ref=Object(gt.a)(this.triggerRef,it.ref));var Qt=C.cloneElement(it,zt),Xt;return(b||this.popupRef.current||se)&&(Xt=C.createElement(R,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!b&&je&&(Xt=null),C.createElement(vr.Provider,{value:this.triggerContextValue},Qt,Xt)}}],[{key:"getDerivedStateFromProps",value:function(b,B){var z=b.popupVisible,se={};return z!==void 0&&B.popupVisible!==z&&(se.popupVisible=z,se.prevPopupVisible=B.popupVisible),se}}]),m}(C.Component);return q.contextType=vr,q.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:lr,getDocument:zi,onPopupVisibleChange:Wi,afterPopupVisibleChange:Wi,onPopupAlign:Wi,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},q}var Li=Kr(Dt.a),Jn={adjustX:1,adjustY:1},_r={topLeft:{points:["bl","tl"],overflow:Jn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Jn,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:Jn,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:Jn,offset:[4,0]}},Ir={topLeft:{points:["bl","tl"],overflow:Jn,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:Jn,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:Jn,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:Jn,offset:[4,0]}},Xr=_r,Vn=0,bn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},$n=function(q,oe,j){var m=he(oe),_=q.getState();q.setState({defaultActiveFirst:Object(H.a)(Object(H.a)({},_.defaultActiveFirst),{},Object(E.a)({},m,j))})},yn=function(R){Object(Fe.a)(oe,R);var q=Object(me.a)(oe);function oe(j){var m;Object(Ae.a)(this,oe),m=q.call(this,j),m.onDestroy=function(ie){m.props.onDestroy(ie)},m.onKeyDown=function(ie){var ge=ie.keyCode,je=m.menuInstance,it=m.props.store,nt=m.getVisible();if(ge===N.a.ENTER)return m.onTitleClick(ie),$n(it,m.props.eventKey,!0),!0;if(ge===N.a.RIGHT)return nt?je.onKeyDown(ie):(m.triggerOpenChange(!0),$n(it,m.props.eventKey,!0)),!0;if(ge===N.a.LEFT){var ct;if(nt)ct=je.onKeyDown(ie);else return;return ct||(m.triggerOpenChange(!1),ct=!0),ct}return nt&&(ge===N.a.UP||ge===N.a.DOWN)?je.onKeyDown(ie):void 0},m.onOpenChange=function(ie){m.props.onOpenChange(ie)},m.onPopupVisibleChange=function(ie){m.triggerOpenChange(ie,ie?"mouseenter":"mouseleave")},m.onMouseEnter=function(ie){var ge=m.props,je=ge.eventKey,it=ge.onMouseEnter,nt=ge.store;$n(nt,m.props.eventKey,!1),it({key:je,domEvent:ie})},m.onMouseLeave=function(ie){var ge=m.props,je=ge.parentMenu,it=ge.eventKey,nt=ge.onMouseLeave;je.subMenuInstance=Object(Ee.a)(m),nt({key:it,domEvent:ie})},m.onTitleMouseEnter=function(ie){var ge=m.props,je=ge.eventKey,it=ge.onItemHover,nt=ge.onTitleMouseEnter;it({key:je,hover:!0}),nt({key:je,domEvent:ie})},m.onTitleMouseLeave=function(ie){var ge=m.props,je=ge.parentMenu,it=ge.eventKey,nt=ge.onItemHover,ct=ge.onTitleMouseLeave;je.subMenuInstance=Object(Ee.a)(m),nt({key:it,hover:!1}),ct({key:it,domEvent:ie})},m.onTitleClick=function(ie){var ge=Object(Ee.a)(m),je=ge.props;if(je.onTitleClick({key:je.eventKey,domEvent:ie}),je.triggerSubMenuAction==="hover")return;m.triggerOpenChange(!m.getVisible(),"click"),$n(je.store,m.props.eventKey,!1)},m.onSubMenuClick=function(ie){typeof m.props.onClick=="function"&&m.props.onClick(m.addKeyPath(ie))},m.onSelect=function(ie){m.props.onSelect(ie)},m.onDeselect=function(ie){m.props.onDeselect(ie)},m.getPrefixCls=function(){return"".concat(m.props.rootPrefixCls,"-submenu")},m.getActiveClassName=function(){return"".concat(m.getPrefixCls(),"-active")},m.getDisabledClassName=function(){return"".concat(m.getPrefixCls(),"-disabled")},m.getSelectedClassName=function(){return"".concat(m.getPrefixCls(),"-selected")},m.getOpenClassName=function(){return"".concat(m.props.rootPrefixCls,"-submenu-open")},m.getVisible=function(){return m.state.isOpen},m.getMode=function(){return m.state.mode},m.saveMenuInstance=function(ie){m.menuInstance=ie},m.addKeyPath=function(ie){return Object(H.a)(Object(H.a)({},ie),{},{keyPath:(ie.keyPath||[]).concat(m.props.eventKey)})},m.triggerOpenChange=function(ie,ge){var je=m.props.eventKey,it=function(){m.onOpenChange({key:je,item:Object(Ee.a)(m),trigger:ge,open:ie})};ge==="mouseenter"?m.mouseenterTimeout=setTimeout(function(){it()},0):it()},m.isChildrenSelected=function(){var ie={find:!1};return Oe(m.props.children,m.props.selectedKeys,ie),ie.find},m.isInlineMode=function(){return m.getMode()==="inline"},m.adjustWidth=function(){if(!m.subMenuTitle||!m.menuInstance)return;var ie=_t.findDOMNode(m.menuInstance);if(ie.offsetWidth>=m.subMenuTitle.offsetWidth)return;ie.style.minWidth="".concat(m.subMenuTitle.offsetWidth,"px")},m.saveSubMenuTitle=function(ie){m.subMenuTitle=ie},m.getBaseProps=function(){var ie=Object(Ee.a)(m),ge=ie.props,je=m.getMode();return{mode:je==="horizontal"?"vertical":je,visible:m.getVisible(),level:ge.level+1,inlineIndent:ge.inlineIndent,focusable:!1,onClick:m.onSubMenuClick,onSelect:m.onSelect,onDeselect:m.onDeselect,onDestroy:m.onDestroy,selectedKeys:ge.selectedKeys,eventKey:"".concat(ge.eventKey,"-menu-"),openKeys:ge.openKeys,motion:ge.motion,onOpenChange:m.onOpenChange,subMenuOpenDelay:ge.subMenuOpenDelay,parentMenu:Object(Ee.a)(m),subMenuCloseDelay:ge.subMenuCloseDelay,forceSubMenuRender:ge.forceSubMenuRender,triggerSubMenuAction:ge.triggerSubMenuAction,builtinPlacements:ge.builtinPlacements,defaultActiveFirst:ge.store.getState().defaultActiveFirst[he(ge.eventKey)],multiple:ge.multiple,prefixCls:ge.rootPrefixCls,id:m.internalMenuId,manualRef:m.saveMenuInstance,itemIcon:ge.itemIcon,expandIcon:ge.expandIcon,direction:ge.direction}},m.getMotion=function(ie,ge){var je=Object(Ee.a)(m),it=je.haveRendered,nt=m.props,ct=nt.motion,zt=nt.rootPrefixCls,Qt=Object(H.a)(Object(H.a)({},ct),{},{leavedClassName:"".concat(zt,"-hidden"),removeOnLeave:!1,motionAppear:it||!ge||ie!=="inline"});return Qt};var _=j.store,b=j.eventKey,B=_.getState(),z=B.defaultActiveFirst;m.isRootMenu=!1;var se=!1;return z&&(se=z[b]),$n(_,b,se),m.state={mode:j.mode,isOpen:j.isOpen},m}return Object(Ce.a)(oe,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var m=this,_=this.props,b=_.mode,B=_.parentMenu,z=_.manualRef,se=_.isOpen,ie=function(){m.setState({mode:b,isOpen:se})},ge=se!==this.state.isOpen,je=b!==this.state.mode;if((je||ge)&&(dt.a.cancel(this.updateStateRaf),je?this.updateStateRaf=Object(dt.a)(ie):ie()),z&&z(this),b!=="horizontal"||!(B==null?void 0:B.isRootMenu)||!se)return;this.minWidthTimeout=setTimeout(function(){return m.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var m=this.props,_=m.onDestroy,b=m.eventKey;_&&_(b),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout),dt.a.cancel(this.updateStateRaf)}},{key:"renderPopupMenu",value:function(m,_){var b=this.getBaseProps();return C.createElement(cr,Object(ye.a)({},b,{id:this.internalMenuId,className:m,style:_}),this.props.children)}},{key:"renderChildren",value:function(){var m=this,_=this.getBaseProps(),b=_.mode,B=_.visible,z=_.forceSubMenuRender,se=_.direction,ie=this.getMotion(b,B);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||B||z,!this.haveOpened)return C.createElement("div",null);var ge=S()("".concat(_.prefixCls,"-sub"),Object(E.a)({},"".concat(_.prefixCls,"-rtl"),se==="rtl"));return this.isInlineMode()?C.createElement(p,Object(ye.a)({visible:_.visible,forceRender:z},ie),function(je){var it=je.className,nt=je.style,ct=S()(ge,it);return m.renderPopupMenu(ct,nt)}):this.renderPopupMenu(ge)}},{key:"render",value:function(){var m,_,b,B=Object(H.a)({},this.props),z=this.getVisible(),se=this.getPrefixCls(),ie=this.isInlineMode(),ge=this.getMode(),je=S()(se,"".concat(se,"-").concat(ge),(m={},Object(E.a)(m,B.className,!!B.className),Object(E.a)(m,this.getOpenClassName(),z),Object(E.a)(m,this.getActiveClassName(),B.active||z&&!ie),Object(E.a)(m,this.getDisabledClassName(),B.disabled),Object(E.a)(m,this.getSelectedClassName(),this.isChildrenSelected()),m));this.internalMenuId||(B.eventKey?this.internalMenuId="".concat(B.eventKey,"$Menu"):(Vn+=1,this.internalMenuId="$__$".concat(Vn,"$Menu")));var it={},nt={},ct={};B.disabled||(it={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},nt={onClick:this.onTitleClick},ct={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var zt={},Qt=B.direction,Xt=Qt==="rtl";ie&&(Xt?zt.paddingRight=B.inlineIndent*B.level:zt.paddingLeft=B.inlineIndent*B.level);var $t={};this.getVisible()&&($t={"aria-owns":this.internalMenuId});var qt=null;ge!=="horizontal"&&(qt=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(qt=C.createElement(this.props.expandIcon,Object(H.a)({},this.props))));var Jt=C.createElement("div",Object(ye.a)({ref:this.saveSubMenuTitle,style:zt,className:"".concat(se,"-title"),role:"button"},ct,nt,{"aria-expanded":z},$t,{"aria-haspopup":"true",title:typeof B.title=="string"?B.title:void 0}),B.title,qt||C.createElement("i",{className:"".concat(se,"-arrow")})),Yt=this.renderChildren(),hn=((_=B.parentMenu)===null||_===void 0?void 0:_.isRootMenu)?B.parentMenu.props.getPopupContainer:function(Tn){return Tn.parentNode},nn=bn[ge],Fn=B.popupOffset?{offset:B.popupOffset}:{},rn=S()((b={},Object(E.a)(b,B.popupClassName,B.popupClassName&&!ie),Object(E.a)(b,"".concat(se,"-rtl"),Xt),b)),Bt=B.disabled,It=B.triggerSubMenuAction,sn=B.subMenuOpenDelay,fn=B.forceSubMenuRender,Rt=B.subMenuCloseDelay,gn=B.builtinPlacements;Se.forEach(function(Tn){return delete B[Tn]}),delete B.onClick;var Hn=Xt?Object(H.a)(Object(H.a)({},Ir),gn):Object(H.a)(Object(H.a)({},_r),gn);delete B.direction;var Cn=this.getBaseProps(),Ln=ie?null:this.getMotion(Cn.mode,Cn.visible);return C.createElement("li",Object(ye.a)({},B,it,{className:je,role:"menuitem"}),C.createElement(Li,{prefixCls:se,popupClassName:S()("".concat(se,"-popup"),rn),getPopupContainer:hn,builtinPlacements:Hn,popupPlacement:nn,popupVisible:ie?!1:z,popupAlign:Fn,popup:ie?null:Yt,action:Bt||ie?[]:[It],mouseEnterDelay:sn,mouseLeaveDelay:Rt,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:fn,popupMotion:Ln},Jt),ie?Yt:null)}}]),oe}(C.Component);yn.defaultProps={onMouseEnter:ut,onMouseLeave:ut,onTitleMouseEnter:ut,onTitleMouseLeave:ut,onTitleClick:ut,manualRef:ut,mode:"vertical",title:""};var si=Object(L.b)(function(R,q){var oe=R.openKeys,j=R.activeKey,m=R.selectedKeys,_=q.eventKey,b=q.subMenuKey;return{isOpen:oe.indexOf(_)>-1,active:j[b]===_,selectedKeys:m}})(yn);si.isSubMenu=!0;var Rn=si,yr="menuitem-overflowed",ti=.5,Zn=function(R){Object(Fe.a)(oe,R);var q=Object(me.a)(oe);function oe(){var j;return Object(Ae.a)(this,oe),j=q.apply(this,arguments),j.resizeObserver=null,j.mutationObserver=null,j.originalTotalWidth=0,j.overflowedItems=[],j.menuItemSizes=[],j.cancelFrameId=null,j.state={lastVisibleIndex:void 0},j.childRef=C.createRef(),j.getMenuItemNodes=function(){var m=j.props.prefixCls,_=j.childRef.current;return _?[].slice.call(_.children).filter(function(b){return b.className.split(" ").indexOf("".concat(m,"-overflowed-submenu"))<0}):[]},j.getOverflowedSubMenuItem=function(m,_,b){var B=j.props,z=B.overflowedIndicator,se=B.level,ie=B.mode,ge=B.prefixCls,je=B.theme;if(se!==1||ie!=="horizontal")return null;var it=j.props.children[0],nt=it.props,ct=nt.children,zt=nt.title,Qt=nt.style,Xt=Object(V.a)(nt,["children","title","style"]),$t=Object(H.a)({},Qt),qt="".concat(m,"-overflowed-indicator"),Jt="".concat(m,"-overflowed-indicator");_.length===0&&b!==!0?$t=Object(H.a)(Object(H.a)({},$t),{},{display:"none"}):b&&($t=Object(H.a)(Object(H.a)({},$t),{},{visibility:"hidden",position:"absolute"}),qt="".concat(qt,"-placeholder"),Jt="".concat(Jt,"-placeholder"));var Yt=je?"".concat(ge,"-").concat(je):"",hn={};return Se.forEach(function(nn){Xt[nn]!==void 0&&(hn[nn]=Xt[nn])}),C.createElement(Rn,Object(ye.a)({title:z,className:"".concat(ge,"-overflowed-submenu"),popupClassName:Yt},hn,{key:qt,eventKey:Jt,disabled:!1,style:$t}),_)},j.setChildrenWidthAndResize=function(){if(j.props.mode!=="horizontal")return;var m=j.childRef.current;if(!m)return;var _=m.children;if(!_||_.length===0)return;var b=m.children[_.length-1];Ye(b,"display","inline-block");var B=j.getMenuItemNodes(),z=B.filter(function(se){return se.className.split(" ").indexOf(yr)>=0});z.forEach(function(se){Ye(se,"display","inline-block")}),j.menuItemSizes=B.map(function(se){return tt(se,!0)}),z.forEach(function(se){Ye(se,"display","none")}),j.overflowedIndicatorWidth=tt(m.children[m.children.length-1],!0),j.originalTotalWidth=j.menuItemSizes.reduce(function(se,ie){return se+ie},0),j.handleResize(),Ye(b,"display","none")},j.handleResize=function(){if(j.props.mode!=="horizontal")return;var m=j.childRef.current;if(!m)return;var _=tt(m);j.overflowedItems=[];var b=0,B;j.originalTotalWidth>_+ti&&(B=-1,j.menuItemSizes.forEach(function(z){b+=z,b+j.overflowedIndicatorWidth<=_&&(B+=1)})),j.setState({lastVisibleIndex:B})},j}return Object(Ce.a)(oe,[{key:"componentDidMount",value:function(){var m=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var _=this.childRef.current;if(!_)return;this.resizeObserver=new Nt.default(function(b){b.forEach(function(){var B=m.cancelFrameId;cancelAnimationFrame(B),m.cancelFrameId=requestAnimationFrame(m.setChildrenWidthAndResize)})}),[].slice.call(_.children).concat(_).forEach(function(b){m.resizeObserver.observe(b)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){m.resizeObserver.disconnect(),[].slice.call(_.children).concat(_).forEach(function(b){m.resizeObserver.observe(b)}),m.setChildrenWidthAndResize()}),this.mutationObserver.observe(_,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(m){var _=this,b=this.state.lastVisibleIndex;return(m||[]).reduce(function(B,z,se){var ie=z;if(_.props.mode==="horizontal"){var ge=_.getOverflowedSubMenuItem(z.props.eventKey,[]);b!==void 0&&_.props.className.indexOf("".concat(_.props.prefixCls,"-root"))!==-1&&(se>b&&(ie=C.cloneElement(z,{style:{display:"none"},eventKey:"".concat(z.props.eventKey,"-hidden"),className:"".concat(yr)})),se===b+1&&(_.overflowedItems=m.slice(b+1).map(function(it){return C.cloneElement(it,{key:it.props.eventKey,mode:"vertical-left"})}),ge=_.getOverflowedSubMenuItem(z.props.eventKey,_.overflowedItems)));var je=[].concat(Object($.a)(B),[ge,ie]);return se===m.length-1&&je.push(_.getOverflowedSubMenuItem(z.props.eventKey,[],!0)),je}return[].concat(Object($.a)(B),[ie])},[])}},{key:"render",value:function(){var m=this.props,_=m.visible,b=m.prefixCls,B=m.overflowedIndicator,z=m.mode,se=m.level,ie=m.tag,ge=m.children,je=m.theme,it=Object(V.a)(m,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),nt=ie;return C.createElement(nt,Object(ye.a)({ref:this.childRef},it),this.renderChildren(ge))}}]),oe}(C.Component);Zn.defaultProps={tag:"div",className:""};var ur=Zn;function Or(R){return R.length?R.every(function(q){return!!q.props.disabled}):!0}function qi(R,q,oe){var j=R.getState();R.setState({activeKey:Object(H.a)(Object(H.a)({},j.activeKey),{},Object(E.a)({},q,oe))})}function br(R){return R.eventKey||"0-menu-"}function Di(R,q){var oe=q,j=R.children,m=R.eventKey;if(oe){var _;if(Me(j,function(b,B){b&&b.props&&!b.props.disabled&&oe===st(b,m,B)&&(_=!0)}),_)return oe}return oe=null,R.defaultActiveFirst&&Me(j,function(b,B){!oe&&b&&!b.props.disabled&&(oe=st(b,m,B))}),oe}function $r(R){if(!R)return;var q=this.instanceArray.indexOf(R);q!==-1?this.instanceArray[q]=R:this.instanceArray.push(R)}var Oi=function(R){Object(Fe.a)(oe,R);var q=Object(me.a)(oe);function oe(j){var m;return Object(Ae.a)(this,oe),m=q.call(this,j),m.onKeyDown=function(_,b){var B=_.keyCode,z;if(m.getFlatInstanceArray().forEach(function(ie){ie&&ie.props.active&&ie.onKeyDown&&(z=ie.onKeyDown(_))}),z)return 1;var se=null;return(B===N.a.UP||B===N.a.DOWN)&&(se=m.step(B===N.a.UP?-1:1)),se?(_.preventDefault(),qi(m.props.store,br(m.props),se.props.eventKey),typeof b=="function"&&b(se),1):void 0},m.onItemHover=function(_){var b=_.key,B=_.hover;qi(m.props.store,br(m.props),B?b:null)},m.onDeselect=function(_){m.props.onDeselect(_)},m.onSelect=function(_){m.props.onSelect(_)},m.onClick=function(_){m.props.onClick(_)},m.onOpenChange=function(_){m.props.onOpenChange(_)},m.onDestroy=function(_){m.props.onDestroy(_)},m.getFlatInstanceArray=function(){return m.instanceArray},m.step=function(_){var b=m.getFlatInstanceArray(),B=m.props.store.getState().activeKey[br(m.props)],z=b.length;if(!z)return null;_<0&&(b=b.concat().reverse());var se=-1;if(b.every(function(it,nt){return it&&it.props.eventKey===B?(se=nt,!1):!0}),!m.props.defaultActiveFirst&&se!==-1&&Or(b.slice(se,z-1)))return;var ie=(se+1)%z,ge=ie;do{var je=b[ge];if(!je||je.props.disabled)ge=(ge+1)%z;else return je}while(ge!==ie);return null},m.renderCommonMenuItem=function(_,b,B){var z=m.props.store.getState(),se=Object(Ee.a)(m),ie=se.props,ge=st(_,ie.eventKey,b),je=_.props;if(!je||typeof _.type=="string")return _;var it=ge===z.activeKey,nt=Object(H.a)(Object(H.a)({mode:je.mode||ie.mode,level:ie.level,inlineIndent:ie.inlineIndent,renderMenuItem:m.renderMenuItem,rootPrefixCls:ie.prefixCls,index:b,parentMenu:ie.parentMenu,manualRef:je.disabled?void 0:Object(ve.a)(_.ref,$r.bind(Object(Ee.a)(m))),eventKey:ge,active:!je.disabled&&it,multiple:ie.multiple,onClick:function(zt){(je.onClick||ut)(zt),m.onClick(zt)},onItemHover:m.onItemHover,motion:ie.motion,subMenuOpenDelay:ie.subMenuOpenDelay,subMenuCloseDelay:ie.subMenuCloseDelay,forceSubMenuRender:ie.forceSubMenuRender,onOpenChange:m.onOpenChange,onDeselect:m.onDeselect,onSelect:m.onSelect,builtinPlacements:ie.builtinPlacements,itemIcon:je.itemIcon||m.props.itemIcon,expandIcon:je.expandIcon||m.props.expandIcon},B),{},{direction:ie.direction});return(ie.mode==="inline"||lt())&&(nt.triggerSubMenuAction="click"),C.cloneElement(_,Object(H.a)(Object(H.a)({},nt),{},{key:ge||b}))},m.renderMenuItem=function(_,b,B){if(!_)return null;var z=m.props.store.getState(),se={openKeys:z.openKeys,selectedKeys:z.selectedKeys,triggerSubMenuAction:m.props.triggerSubMenuAction,subMenuKey:B};return m.renderCommonMenuItem(_,b,se)},j.store.setState({activeKey:Object(H.a)(Object(H.a)({},j.store.getState().activeKey),{},Object(E.a)({},j.eventKey,Di(j,j.activeKey)))}),m.instanceArray=[],m}return Object(Ce.a)(oe,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(m){return this.props.visible||m.visible||this.props.className!==m.className||!G()(this.props.style,m.style)}},{key:"componentDidUpdate",value:function(m){var _=this.props,b="activeKey"in _?_.activeKey:_.store.getState().activeKey[br(_)],B=Di(_,b);if(B!==b)qi(_.store,br(_),B);else if("activeKey"in m){var z=Di(m,m.activeKey);B!==z&&qi(_.store,br(_),B)}}},{key:"render",value:function(){var m=this,_=Object(ye.a)({},this.props);this.instanceArray=[];var b=S()(_.prefixCls,_.className,"".concat(_.prefixCls,"-").concat(_.mode)),B={className:b,role:_.role||"menu"};_.id&&(B.id=_.id),_.focusable&&(B.tabIndex=0,B.onKeyDown=this.onKeyDown);var z=_.prefixCls,se=_.eventKey,ie=_.visible,ge=_.level,je=_.mode,it=_.overflowedIndicator,nt=_.theme;return Se.forEach(function(ct){return delete _[ct]}),delete _.onClick,C.createElement(ur,Object(ye.a)({},_,{prefixCls:z,mode:je,tag:"ul",level:ge,theme:nt,visible:ie,overflowedIndicator:it},B),Object(F.a)(_.children).map(function(ct,zt){return m.renderMenuItem(ct,zt,se||"0-menu-")}))}}]),oe}(C.Component);Oi.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:ut};var Yr=Object(L.b)()(Oi),cr=Yr,Mr=y("Kwbf");function Ho(R,q,oe){var j=R.prefixCls,m=R.motion,_=R.defaultMotions,b=_===void 0?{}:_,B=R.openAnimation,z=R.openTransitionName,se=q.switchingModeFromInline;if(m)return m;if(Object(le.a)(B)==="object"&&B)Object(Mr.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof B=="string")return{motionName:"".concat(j,"-open-").concat(B)};if(z)return{motionName:z};var ie=b[oe];return ie||(se?null:b.other)}var yo=function(R){Object(Fe.a)(oe,R);var q=Object(me.a)(oe);function oe(j){var m;Object(Ae.a)(this,oe),m=q.call(this,j),m.onSelect=function(B){var z=Object(Ee.a)(m),se=z.props;if(se.selectable){var ie=m.store.getState(),ge=ie.selectedKeys,je=B.key;se.multiple?ge=ge.concat([je]):ge=[je],"selectedKeys"in se||m.store.setState({selectedKeys:ge}),se.onSelect(Object(H.a)(Object(H.a)({},B),{},{selectedKeys:ge}))}},m.onClick=function(B){var z=m.getRealMenuMode(),se=Object(Ee.a)(m),ie=se.store,ge=se.props.onOpenChange;z!=="inline"&&!("openKeys"in m.props)&&(ie.setState({openKeys:[]}),ge([])),m.props.onClick(B)},m.onKeyDown=function(B,z){m.innerMenu.getWrappedInstance().onKeyDown(B,z)},m.onOpenChange=function(B){var z=Object(Ee.a)(m),se=z.props,ie=m.store.getState().openKeys.concat(),ge=!1,je=function(nt){var ct=!1;if(nt.open)ct=ie.indexOf(nt.key)===-1,ct&&ie.push(nt.key);else{var zt=ie.indexOf(nt.key);ct=zt!==-1,ct&&ie.splice(zt,1)}ge=ge||ct};Array.isArray(B)?B.forEach(je):je(B),ge&&("openKeys"in m.props||m.store.setState({openKeys:ie}),se.onOpenChange(ie))},m.onDeselect=function(B){var z=Object(Ee.a)(m),se=z.props;if(se.selectable){var ie=m.store.getState().selectedKeys.concat(),ge=B.key,je=ie.indexOf(ge);je!==-1&&ie.splice(je,1),"selectedKeys"in se||m.store.setState({selectedKeys:ie}),se.onDeselect(Object(H.a)(Object(H.a)({},B),{},{selectedKeys:ie}))}},m.onMouseEnter=function(B){m.restoreModeVerticalFromInline();var z=m.props.onMouseEnter;z&&z(B)},m.onTransitionEnd=function(B){var z=B.propertyName==="width"&&B.target===B.currentTarget,se=B.target.className,ie=Object.prototype.toString.call(se)==="[object SVGAnimatedString]"?se.animVal:se,ge=B.propertyName==="font-size"&&ie.indexOf("anticon")>=0;(z||ge)&&m.restoreModeVerticalFromInline()},m.setInnerMenu=function(B){m.innerMenu=B},m.isRootMenu=!0;var _=j.defaultSelectedKeys,b=j.defaultOpenKeys;return"selectedKeys"in j&&(_=j.selectedKeys||[]),"openKeys"in j&&(b=j.openKeys||[]),m.store=Object(L.c)({selectedKeys:_,openKeys:b,activeKey:{"0-menu-":Di(j,j.activeKey)}}),m.state={switchingModeFromInline:!1,prevProps:j,inlineOpenKeys:[],store:m.store},m}return Object(Ce.a)(oe,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(m){var _=this.props,b=_.siderCollapsed,B=_.inlineCollapsed,z=_.onOpenChange;(!m.inlineCollapsed&&B||!m.siderCollapsed&&b)&&z([]),this.updateMiniStore(),this.updateMenuDisplay()}},{key:"updateMenuDisplay",value:function(){var m=this.props.collapsedWidth,_=this.store,b=this.prevOpenKeys,B=this.getInlineCollapsed()&&(m===0||m==="0"||m==="0px");B?(this.prevOpenKeys=_.getState().openKeys.concat(),this.store.setState({openKeys:[]})):b&&(this.store.setState({openKeys:b}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var m=this.props.mode,_=this.state.switchingModeFromInline,b=this.getInlineCollapsed();return _&&b?"inline":b?"vertical":m}},{key:"getInlineCollapsed",value:function(){var m=this.props,_=m.inlineCollapsed,b=m.siderCollapsed;return b!==void 0?b:_}},{key:"restoreModeVerticalFromInline",value:function(){var m=this.state.switchingModeFromInline;m&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var m=Object(H.a)({},Object(ke.a)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),_=this.getRealMenuMode();return m.className+=" ".concat(m.prefixCls,"-root"),m.direction==="rtl"&&(m.className+=" ".concat(m.prefixCls,"-rtl")),m=Object(H.a)(Object(H.a)({},m),{},{mode:_,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:Ho(this.props,this.state,_)}),delete m.openAnimation,delete m.openTransitionName,C.createElement(L.a,{store:this.store},C.createElement(cr,Object(ye.a)({},m,{ref:this.setInnerMenu}),this.props.children))}}],[{key:"getDerivedStateFromProps",value:function(m,_){var b=_.prevProps,B=_.store,z=B.getState(),se={},ie={prevProps:m};return b.mode==="inline"&&m.mode!=="inline"&&(ie.switchingModeFromInline=!0),"openKeys"in m?se.openKeys=m.openKeys||[]:((m.inlineCollapsed&&!b.inlineCollapsed||m.siderCollapsed&&!b.siderCollapsed)&&(ie.switchingModeFromInline=!0,ie.inlineOpenKeys=z.openKeys,se.openKeys=[]),(!m.inlineCollapsed&&b.inlineCollapsed||!m.siderCollapsed&&b.siderCollapsed)&&(se.openKeys=_.inlineOpenKeys,ie.inlineOpenKeys=[])),Object.keys(se).length&&B.setState(se),ie}}]),oe}(C.Component);yo.defaultProps={selectable:!0,onClick:ut,onSelect:ut,onOpenChange:ut,onDeselect:ut,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:C.createElement("span",null,"\xB7\xB7\xB7")};var ya=yo,bo=function(R){Object(Fe.a)(oe,R);var q=Object(me.a)(oe);function oe(){var j;return Object(Ae.a)(this,oe),j=q.apply(this,arguments),j.onKeyDown=function(m){var _=m.keyCode;return _===N.a.ENTER?(j.onClick(m),!0):void 0},j.onMouseLeave=function(m){var _=j.props,b=_.eventKey,B=_.onItemHover,z=_.onMouseLeave;B({key:b,hover:!1}),z({key:b,domEvent:m})},j.onMouseEnter=function(m){var _=j.props,b=_.eventKey,B=_.onItemHover,z=_.onMouseEnter;B({key:b,hover:!0}),z({key:b,domEvent:m})},j.onClick=function(m){var _=j.props,b=_.eventKey,B=_.multiple,z=_.onClick,se=_.onSelect,ie=_.onDeselect,ge=_.isSelected,je={key:b,keyPath:[b],item:Object(Ee.a)(j),domEvent:m};z(je),B?ge?ie(je):se(je):ge||se(je)},j.saveNode=function(m){j.node=m},j}return Object(Ce.a)(oe,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var m=this.props;m.onDestroy&&m.onDestroy(m.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var m,_=Object(H.a)({},this.props),b=S()(this.getPrefixCls(),_.className,(m={},Object(E.a)(m,this.getActiveClassName(),!_.disabled&&_.active),Object(E.a)(m,this.getSelectedClassName(),_.isSelected),Object(E.a)(m,this.getDisabledClassName(),_.disabled),m)),B=Object(H.a)(Object(H.a)({},_.attribute),{},{title:typeof _.title=="string"?_.title:void 0,className:b,role:_.role||"menuitem","aria-disabled":_.disabled});_.role==="option"?B=Object(H.a)(Object(H.a)({},B),{},{role:"option","aria-selected":_.isSelected}):(_.role===null||_.role==="none")&&(B.role="none");var z={onClick:_.disabled?null:this.onClick,onMouseLeave:_.disabled?null:this.onMouseLeave,onMouseEnter:_.disabled?null:this.onMouseEnter},se=Object(H.a)({},_.style);_.mode==="inline"&&(_.direction==="rtl"?se.paddingRight=_.inlineIndent*_.level:se.paddingLeft=_.inlineIndent*_.level),Se.forEach(function(ge){return delete _[ge]}),delete _.direction;var ie=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(ie=C.createElement(this.props.itemIcon,this.props)),C.createElement("li",Object(ye.a)({},Object(ke.a)(_,["onClick","onMouseEnter","onMouseLeave","onSelect"]),B,z,{style:se,ref:this.saveNode}),_.children,ie)}}]),oe}(C.Component);bo.isMenuItem=!0,bo.defaultProps={onSelect:ut,onMouseEnter:ut,onMouseLeave:ut,manualRef:ut};var Wo=Object(L.b)(function(R,q){var oe=R.activeKey,j=R.selectedKeys,m=q.eventKey,_=q.subMenuKey;return{active:oe[_]===m,isSelected:Array.isArray(j)?j.indexOf(m)!==-1:j===m}})(bo),Co=Wo,Tt=function(R){Object(Fe.a)(oe,R);var q=Object(me.a)(oe);function oe(){var j;return Object(Ae.a)(this,oe),j=q.apply(this,arguments),j.renderInnerMenuItem=function(m){var _=j.props,b=_.renderMenuItem,B=_.index;return b(m,B,j.props.subMenuKey)},j}return Object(Ce.a)(oe,[{key:"render",value:function(){var m=Object(ye.a)({},this.props),_=m.className,b=_===void 0?"":_,B=m.rootPrefixCls,z="".concat(B,"-item-group-title"),se="".concat(B,"-item-group-list"),ie=m.title,ge=m.children;return Se.forEach(function(je){return delete m[je]}),delete m.direction,C.createElement("li",Object(ye.a)({},m,{onClick:function(it){return it.stopPropagation()},className:"".concat(b," ").concat(B,"-item-group")}),C.createElement("div",{className:z,title:typeof ie=="string"?ie:void 0},ie),C.createElement("ul",{className:se},C.Children.map(ge,this.renderInnerMenuItem)))}}]),oe}(C.Component);Tt.isMenuItemGroup=!0,Tt.defaultProps={disabled:!0};var Kt=Tt,jt=function(q){var oe=q.className,j=q.rootPrefixCls,m=q.style;return C.createElement("li",{className:"".concat(oe," ").concat(j,"-item-divider"),style:m})};jt.defaultProps={disabled:!0,className:"",style:{}};var an=jt,mn=ya,kn=y("eDIo");function un(R,q){var oe=R.prefixCls,j=R.editable,m=R.locale,_=R.style;return!j||j.showAdd===!1?null:C.createElement("button",{ref:q,type:"button",className:"".concat(oe,"-nav-add"),style:_,"aria-label":(m==null?void 0:m.addAriaLabel)||"Add tab",onClick:function(B){j.onEdit("add",{event:B})}},j.addIcon||"+")}var Un=C.forwardRef(un);function li(R,q){var oe=R.prefixCls,j=R.id,m=R.tabs,_=R.locale,b=R.mobile,B=R.moreIcon,z=B===void 0?"More":B,se=R.moreTransitionName,ie=R.style,ge=R.className,je=R.editable,it=R.tabBarGutter,nt=R.rtl,ct=R.onTabClick,zt=Object(C.useState)(!1),Qt=Object(ce.a)(zt,2),Xt=Qt[0],$t=Qt[1],qt=Object(C.useState)(null),Jt=Object(ce.a)(qt,2),Yt=Jt[0],hn=Jt[1],nn="".concat(j,"-more-popup"),Fn="".concat(oe,"-dropdown"),rn=Yt!==null?"".concat(nn,"-").concat(Yt):null,Bt=_==null?void 0:_.dropdownAriaLabel,It=C.createElement(mn,{onClick:function(Ln){var Tn=Ln.key,Qn=Ln.domEvent;ct(Tn,Qn),$t(!1)},id:nn,tabIndex:-1,role:"listbox","aria-activedescendant":rn,selectedKeys:[Yt],"aria-label":Bt!==void 0?Bt:"expanded dropdown"},m.map(function(Cn){return C.createElement(Co,{key:Cn.key,id:"".concat(nn,"-").concat(Cn.key),role:"option","aria-controls":j&&"".concat(j,"-panel-").concat(Cn.key),disabled:Cn.disabled},Cn.tab)}));function sn(Cn){for(var Ln=m.filter(function(Mi){return!Mi.disabled}),Tn=Ln.findIndex(function(Mi){return Mi.key===Yt})||0,Qn=Ln.length,fi=0;fi<Qn;fi+=1){Tn=(Tn+Cn+Qn)%Qn;var Gn=Ln[Tn];if(!Gn.disabled){hn(Gn.key);return}}}function fn(Cn){var Ln=Cn.which;if(!Xt){[N.a.DOWN,N.a.SPACE,N.a.ENTER].includes(Ln)&&($t(!0),Cn.preventDefault());return}switch(Ln){case N.a.UP:sn(-1),Cn.preventDefault();break;case N.a.DOWN:sn(1),Cn.preventDefault();break;case N.a.ESC:$t(!1);break;case N.a.SPACE:case N.a.ENTER:Yt!==null&&ct(Yt,Cn);break}}Object(C.useEffect)(function(){var Cn=document.getElementById(rn);Cn&&Cn.scrollIntoView&&Cn.scrollIntoView(!1)},[Yt]),Object(C.useEffect)(function(){Xt||hn(null)},[Xt]);var Rt=Object(E.a)({},nt?"marginLeft":"marginRight",it);m.length||(Rt.visibility="hidden",Rt.order=1);var gn=S()(Object(E.a)({},"".concat(Fn,"-rtl"),nt)),Hn=b?null:C.createElement(kn.a,{prefixCls:Fn,overlay:It,trigger:["hover"],visible:Xt,transitionName:se,onVisibleChange:$t,overlayClassName:gn,mouseEnterDelay:.1,mouseLeaveDelay:.1},C.createElement("button",{type:"button",className:"".concat(oe,"-nav-more"),style:Rt,tabIndex:-1,"aria-hidden":"true","aria-haspopup":"listbox","aria-controls":nn,id:"".concat(j,"-more"),"aria-expanded":Xt,onKeyDown:fn},z));return C.createElement("div",{className:S()("".concat(oe,"-nav-operations"),ge),style:ie,ref:q},Hn,C.createElement(Un,{prefixCls:oe,locale:_,editable:je}))}var tn=C.forwardRef(li),Cr=Object(C.createContext)(null),On=.1,ui=.01,xn=20,Vi=Math.pow(.995,xn);function lo(){var R=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(R)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(R.substr(0,4)))}function uo(R,q){var oe=Object(C.useState)(),j=Object(ce.a)(oe,2),m=j[0],_=j[1],b=Object(C.useState)(0),B=Object(ce.a)(b,2),z=B[0],se=B[1],ie=Object(C.useState)(0),ge=Object(ce.a)(ie,2),je=ge[0],it=ge[1],nt=Object(C.useState)(),ct=Object(ce.a)(nt,2),zt=ct[0],Qt=ct[1],Xt=Object(C.useRef)();function $t(Bt){var It=Bt.touches[0],sn=It.screenX,fn=It.screenY;_({x:sn,y:fn}),window.clearInterval(Xt.current)}function qt(Bt){if(!m)return;Bt.preventDefault();var It=Bt.touches[0],sn=It.screenX,fn=It.screenY;_({x:sn,y:fn});var Rt=sn-m.x,gn=fn-m.y;q(Rt,gn);var Hn=Date.now();se(Hn),it(Hn-z),Qt({x:Rt,y:gn})}function Jt(){if(!m)return;if(_(null),Qt(null),zt){var Bt=zt.x/je,It=zt.y/je,sn=Math.abs(Bt),fn=Math.abs(It);if(Math.max(sn,fn)<On)return;var Rt=Bt,gn=It;Xt.current=window.setInterval(function(){if(Math.abs(Rt)<ui&&Math.abs(gn)<ui){window.clearInterval(Xt.current);return}Rt*=Vi,gn*=Vi,q(Rt*xn,gn*xn)},xn)}}var Yt=Object(C.useRef)(0),hn=Object(C.useRef)(!1),nn=Object(C.useRef)();function Fn(Bt){var It=Bt.deltaX,sn=Bt.deltaY,fn=0,Rt=Math.abs(It),gn=Math.abs(sn);Rt===gn?fn=nn.current==="x"?It:sn:Rt>gn?(fn=It,nn.current="x"):(fn=sn,nn.current="y");var Hn=Date.now();Hn-Yt.current>100&&(hn.current=!1),(q(-fn,-fn)||hn.current)&&(Bt.preventDefault(),hn.current=!0),Yt.current=Hn}var rn=Object(C.useRef)(null);rn.current={onTouchStart:$t,onTouchMove:qt,onTouchEnd:Jt,onWheel:Fn},C.useEffect(function(){function Bt(Rt){rn.current.onTouchStart(Rt)}function It(Rt){rn.current.onTouchMove(Rt)}function sn(Rt){rn.current.onTouchEnd(Rt)}function fn(Rt){rn.current.onWheel(Rt)}return document.addEventListener("touchmove",It,{passive:!1}),document.addEventListener("touchend",sn,{passive:!1}),R.current.addEventListener("touchstart",Bt,{passive:!1}),R.current.addEventListener("wheel",fn),function(){document.removeEventListener("touchmove",It),document.removeEventListener("touchend",sn)}},[])}function Va(){var R=Object(C.useRef)(new Map);function q(j){return R.current.has(j)||R.current.set(j,C.createRef()),R.current.get(j)}function oe(j){R.current.delete(j)}return[q,oe]}function zo(R,q){var oe=C.useRef(R),j=C.useState({}),m=Object(ce.a)(j,2),_=m[1];function b(B){var z=typeof B=="function"?B(oe.current):B;z!==oe.current&&q(z,oe.current),oe.current=z,_({})}return[oe.current,b]}var ba=function(q){var oe=q.position,j=q.prefixCls,m=q.extra;if(!m)return null;var _,b=m;return oe==="right"&&(_=b.right||!b.left&&b||null),oe==="left"&&(_=b.left||null),_?C.createElement("div",{className:"".concat(j,"-extra-content")},_):null};function Vo(R,q){var oe,j=C.useContext(Cr),m=j.prefixCls,_=j.tabs,b=R.className,B=R.style,z=R.id,se=R.animated,ie=R.activeKey,ge=R.rtl,je=R.extra,it=R.editable,nt=R.locale,ct=R.tabPosition,zt=R.tabBarGutter,Qt=R.children,Xt=R.onTabClick,$t=R.onTabScroll,qt=Object(C.useRef)(),Jt=Object(C.useRef)(),Yt=Object(C.useRef)(),hn=Object(C.useRef)(),nn=Va(),Fn=Object(ce.a)(nn,2),rn=Fn[0],Bt=Fn[1],It=ct==="top"||ct==="bottom",sn=zo(0,function(_n,cn){It&&$t&&$t({direction:_n>cn?"left":"right"})}),fn=Object(ce.a)(sn,2),Rt=fn[0],gn=fn[1],Hn=zo(0,function(_n,cn){!It&&$t&&$t({direction:_n>cn?"top":"bottom"})}),Cn=Object(ce.a)(Hn,2),Ln=Cn[0],Tn=Cn[1],Qn=Object(C.useState)(0),fi=Object(ce.a)(Qn,2),Gn=fi[0],Mi=fi[1],er=Object(C.useState)(0),Pi=Object(ce.a)(er,2),pi=Pi[0],jn=Pi[1],Dn=Object(C.useState)(0),Kn=Object(ce.a)(Dn,2),Wn=Kn[0],tr=Kn[1],Tr=Object(C.useState)(0),Ar=Object(ce.a)(Tr,2),An=Ar[0],dr=Ar[1],Rr=Object(C.useState)(null),Nn=Object(ce.a)(Rr,2),Mn=Nn[0],mi=Nn[1],wa=Object(C.useState)(null),$o=Object(ce.a)(wa,2),Lr=$o[0],Zr=$o[1],xo=Object(C.useState)(0),Yo=Object(ce.a)(xo,2),wo=Yo[0],Xa=Yo[1],$a=Object(C.useState)(0),Ea=Object(ce.a)($a,2),Jo=Ea[0],Zo=Ea[1],Qr=K(new Map),qr=Object(ce.a)(Qr,2),Ya=qr[0],Eo=qr[1],co=Re(_,Ya,Gn),eo="".concat(m,"-nav-operations-hidden"),to=0,nr=0;It?ge?(to=0,nr=Math.max(0,Gn-Mn)):(to=Math.min(0,Mn-Gn),nr=0):(to=Math.min(0,Lr-pi),nr=0);function Ur(_n){return _n<to?[to,!1]:_n>nr?[nr,!1]:[_n,!0]}var Dr=Object(C.useRef)(),ho=Object(C.useState)(),Br=Object(ce.a)(ho,2),So=Br[0],Qo=Br[1];function ko(){Qo(Date.now())}function qo(){window.clearTimeout(Dr.current)}uo(qt,function(_n,cn){var gi=!1;function ji(no,wr){no(function(mo){var Nr=Ur(mo+wr),vi=Object(ce.a)(Nr,2),Mo=vi[0],ta=vi[1];return gi=ta,Mo})}if(It){if(Mn>=Gn)return gi;ji(gn,_n)}else{if(Lr>=pi)return gi;ji(Tn,cn)}return qo(),ko(),gi}),Object(C.useEffect)(function(){return qo(),So&&(Dr.current=window.setTimeout(function(){Qo(0)},100)),qo},[So]);function Pr(){var _n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ie,cn=co.get(_n);if(!cn)return;if(It){var gi=Rt;ge?cn.right<Rt?gi=cn.right:cn.right+cn.width>Rt+Mn&&(gi=cn.right+cn.width-Mn):cn.left<-Rt?gi=-cn.left:cn.left+cn.width>-Rt+Mn&&(gi=-(cn.left+cn.width-Mn)),Tn(0),gn(Ur(gi)[0])}else{var ji=Ln;cn.top<-Ln?ji=-cn.top:cn.top+cn.height>-Ln+Lr&&(ji=-(cn.top+cn.height-Lr)),gn(0),Tn(Ur(ji)[0])}}var Fr=_e(co,{width:Mn,height:Lr,left:Rt,top:Ln},{width:Wn,height:An},{width:wo,height:Jo},Object(H.a)(Object(H.a)({},R),{},{tabs:_})),Sa=Object(ce.a)(Fr,2),Ja=Sa[0],Za=Sa[1],Qa=_.map(function(_n){var cn=_n.key;return C.createElement(ee,{id:z,prefixCls:m,key:cn,rtl:ge,tab:_n,closable:_n.closable,editable:it,active:cn===ie,tabPosition:ct,tabBarGutter:zt,renderWrapper:Qt,removeAriaLabel:nt==null?void 0:nt.removeAriaLabel,ref:rn(cn),onClick:function(ji){Xt(cn,ji)},onRemove:function(){Bt(cn)},onFocus:function(){Pr(cn),ko(),ge||(qt.current.scrollLeft=0),qt.current.scrollTop=0}})}),ea=Q(function(){var _n,cn,gi,ji,no,wr,mo,Nr,vi,Mo=((_n=qt.current)===null||_n===void 0?void 0:_n.offsetWidth)||0,ta=((cn=qt.current)===null||cn===void 0?void 0:cn.offsetHeight)||0,na=((gi=hn.current)===null||gi===void 0?void 0:gi.offsetWidth)||0,Ii=((ji=hn.current)===null||ji===void 0?void 0:ji.offsetHeight)||0,wn=((no=Yt.current)===null||no===void 0?void 0:no.offsetWidth)||0,rr=((wr=Yt.current)===null||wr===void 0?void 0:wr.offsetHeight)||0;mi(Mo),Zr(ta),Xa(na),Zo(Ii);var Er=(((mo=Jt.current)===null||mo===void 0?void 0:mo.offsetWidth)||0)-na,Sr=(((Nr=Jt.current)===null||Nr===void 0?void 0:Nr.offsetHeight)||0)-Ii;Mi(Er),jn(Sr);var ia=(vi=Yt.current)===null||vi===void 0?void 0:vi.className.includes(eo);tr(Er-(ia?0:wn)),dr(Sr-(ia?0:rr)),Eo(function(){var To=new Map;return _.forEach(function(Ta){var Aa=Ta.key,Wr=rn(Aa).current;Wr&&To.set(Aa,{width:Wr.offsetWidth,height:Wr.offsetHeight,left:Wr.offsetLeft,top:Wr.offsetTop})}),To})}),qa=_.slice(0,Ja),Ni=_.slice(Za+1),ni=[].concat(Object($.a)(qa),Object($.a)(Ni)),wi=Object(C.useState)(),ii=Object(ce.a)(wi,2),fo=ii[0],es=ii[1],ir=co.get(ie),ka=Object(C.useRef)();function _a(){O.a.cancel(ka.current)}Object(C.useEffect)(function(){var _n={};return ir&&(It?(ge?_n.right=ir.right:_n.left=ir.left,_n.width=ir.width):(_n.top=ir.top,_n.height=ir.height)),_a(),ka.current=O()(function(){es(_n)}),_a},[ir,It,ge]),Object(C.useEffect)(function(){Pr()},[ie,ir,co,It]),Object(C.useEffect)(function(){ea()},[ge,zt,ie,_.map(function(_n){return _n.key}).join("_")]);var Oa=!!ni.length,Hr="".concat(m,"-nav-wrap"),_o,po,Ma,Oo;return It?ge?(po=Rt>0,_o=Rt+Mn<Gn):(_o=Rt<0,po=-Rt+Mn<Gn):(Ma=Ln<0,Oo=-Ln+Lr<pi),C.createElement("div",{ref:q,role:"tablist",className:S()("".concat(m,"-nav"),b),style:B,onKeyDown:function(){ko()}},C.createElement(ba,{position:"left",extra:je,prefixCls:m}),C.createElement(te.a,{onResize:ea},C.createElement("div",{className:S()(Hr,(oe={},Object(E.a)(oe,"".concat(Hr,"-ping-left"),_o),Object(E.a)(oe,"".concat(Hr,"-ping-right"),po),Object(E.a)(oe,"".concat(Hr,"-ping-top"),Ma),Object(E.a)(oe,"".concat(Hr,"-ping-bottom"),Oo),oe)),ref:qt},C.createElement(te.a,{onResize:ea},C.createElement("div",{ref:Jt,className:"".concat(m,"-nav-list"),style:{transform:"translate(".concat(Rt,"px, ").concat(Ln,"px)"),transition:So?"none":void 0}},Qa,C.createElement(Un,{ref:hn,prefixCls:m,locale:nt,editable:it,style:{visibility:Oa?"hidden":null}}),C.createElement("div",{className:S()("".concat(m,"-ink-bar"),Object(E.a)({},"".concat(m,"-ink-bar-animated"),se.inkBar)),style:fo}))))),C.createElement(tn,Object.assign({},R,{ref:Yt,prefixCls:m,tabs:ni,className:!Oa&&eo})),C.createElement(ba,{position:"right",extra:je,prefixCls:m}))}var Go=C.forwardRef(Vo);function Ga(R){var q=R.id,oe=R.activeKey,j=R.animated,m=R.tabPosition,_=R.rtl,b=R.destroyInactiveTabPane,B=C.useContext(Cr),z=B.prefixCls,se=B.tabs,ie=j.tabPane,ge=se.findIndex(function(je){return je.key===oe});return C.createElement("div",{className:S()("".concat(z,"-content-holder"))},C.createElement("div",{className:S()("".concat(z,"-content"),"".concat(z,"-content-").concat(m),Object(E.a)({},"".concat(z,"-content-animated"),ie)),style:ge&&ie?Object(E.a)({},_?"marginRight":"marginLeft","-".concat(ge,"00%")):null},se.map(function(je){return C.cloneElement(je.node,{key:je.key,prefixCls:z,tabKey:je.key,id:q,animated:ie,active:je.key===oe,destroyInactiveTabPane:b})})))}function Ca(R){var q=R.prefixCls,oe=R.forceRender,j=R.className,m=R.style,_=R.id,b=R.active,B=R.animated,z=R.destroyInactiveTabPane,se=R.tabKey,ie=R.children,ge=C.useState(oe),je=Object(ce.a)(ge,2),it=je[0],nt=je[1];C.useEffect(function(){b?nt(!0):z&&nt(!1)},[b,z]);var ct={};return b||(B?(ct.visibility="hidden",ct.height=0,ct.overflowY="hidden"):ct.display="none"),C.createElement("div",{id:_&&"".concat(_,"-panel-").concat(se),role:"tabpanel",tabIndex:b?0:-1,"aria-labelledby":_&&"".concat(_,"-tab-").concat(se),"aria-hidden":!b,style:Object(H.a)(Object(H.a)({},ct),m),className:S()("".concat(q,"-tabpane"),b&&"".concat(q,"-tabpane-active"),j)},(b||it||oe)&&ie)}var Ko=0;function xa(R){return Object(F.a)(R).map(function(q){if(C.isValidElement(q)){var oe=q.key!==void 0?String(q.key):void 0;return Object(H.a)(Object(H.a)({key:oe},q.props),{},{node:q})}return null}).filter(function(q){return q})}function Ka(R,q){var oe,j=R.id,m=R.prefixCls,_=m===void 0?"rc-tabs":m,b=R.className,B=R.children,z=R.direction,se=R.activeKey,ie=R.defaultActiveKey,ge=R.editable,je=R.animated,it=R.tabPosition,nt=it===void 0?"top":it,ct=R.tabBarGutter,zt=R.tabBarStyle,Qt=R.tabBarExtraContent,Xt=R.locale,$t=R.moreIcon,qt=R.moreTransitionName,Jt=R.destroyInactiveTabPane,Yt=R.renderTabBar,hn=R.onChange,nn=R.onTabClick,Fn=R.onTabScroll,rn=Object(V.a)(R,["id","prefixCls","className","children","direction","activeKey","defaultActiveKey","editable","animated","tabPosition","tabBarGutter","tabBarStyle","tabBarExtraContent","locale","moreIcon","moreTransitionName","destroyInactiveTabPane","renderTabBar","onChange","onTabClick","onTabScroll"]),Bt=xa(B),It=z==="rtl",sn;je===!1?sn={inkBar:!1,tabPane:!1}:sn=Object(H.a)({inkBar:!0,tabPane:!1},je!==!0?je:null);var fn=Object(C.useState)(!1),Rt=Object(ce.a)(fn,2),gn=Rt[0],Hn=Rt[1];Object(C.useEffect)(function(){Hn(lo())},[]);var Cn=Object(U.a)(function(){var An;return(An=Bt[0])===null||An===void 0?void 0:An.key},{value:se,defaultValue:ie}),Ln=Object(ce.a)(Cn,2),Tn=Ln[0],Qn=Ln[1],fi=Object(C.useState)(function(){return Bt.findIndex(function(An){return An.key===Tn})}),Gn=Object(ce.a)(fi,2),Mi=Gn[0],er=Gn[1];Object(C.useEffect)(function(){var An=Bt.findIndex(function(Rr){return Rr.key===Tn});if(An===-1){var dr;An=Math.max(0,Math.min(Mi,Bt.length-1)),Qn((dr=Bt[An])===null||dr===void 0?void 0:dr.key)}er(An)},[Bt.map(function(An){return An.key}).join("_"),Tn,Mi]);var Pi=Object(U.a)(null,{value:j}),pi=Object(ce.a)(Pi,2),jn=pi[0],Dn=pi[1],Kn=nt;gn&&!["left","right"].includes(nt)&&(Kn="top"),Object(C.useEffect)(function(){j||(Dn("rc-tabs-".concat(Ko)),Ko+=1)},[]);function Wn(An,dr){nn==null||nn(An,dr),Qn(An),hn==null||hn(An)}var tr={id:jn,activeKey:Tn,animated:sn,tabPosition:Kn,rtl:It,mobile:gn},Tr,Ar=Object(H.a)(Object(H.a)({},tr),{},{editable:ge,locale:Xt,moreIcon:$t,moreTransitionName:qt,tabBarGutter:ct,onTabClick:Wn,onTabScroll:Fn,extra:Qt,style:zt,panes:B});return Yt?Tr=Yt(Ar,Go):Tr=C.createElement(Go,Object.assign({},Ar)),C.createElement(Cr.Provider,{value:{tabs:Bt,prefixCls:_}},C.createElement("div",Object.assign({ref:q,id:j,className:S()(_,"".concat(_,"-").concat(Kn),(oe={},Object(E.a)(oe,"".concat(_,"-mobile"),gn),Object(E.a)(oe,"".concat(_,"-editable"),ge),Object(E.a)(oe,"".concat(_,"-rtl"),It),oe),b)},rn),Tr,C.createElement(Ga,Object.assign({destroyInactiveTabPane:Jt},tr,{animated:sn}))))}var Jr=C.forwardRef(Ka);Jr.TabPane=Ca;var xr=Jr,Xo=Qe.b=xr},kSUc:function(vt,Qe,y){},lZu9:function(vt,Qe,y){(function(E){E(y("VrN/"),y("1eCo"),y("8EBN"))})(function(E){"use strict";E.defineMode("markdown",function(ce,V){var H=E.getMode(ce,"text/html"),C=H.name=="null";function re(T){if(E.findModeByName){var g=E.findModeByName(T);g&&(T=g.mime||g.mimes[0])}var de=E.getMode(ce,T);return de.name=="null"?null:de}V.highlightFormatting===void 0&&(V.highlightFormatting=!1),V.maxBlockquoteDepth===void 0&&(V.maxBlockquoteDepth=0),V.taskLists===void 0&&(V.taskLists=!1),V.strikethrough===void 0&&(V.strikethrough=!1),V.emoji===void 0&&(V.emoji=!1),V.fencedCodeBlockHighlighting===void 0&&(V.fencedCodeBlockHighlighting=!0),V.fencedCodeBlockDefaultMode===void 0&&(V.fencedCodeBlockDefaultMode="text/plain"),V.xml===void 0&&(V.xml=!0),V.tokenTypeOverrides===void 0&&(V.tokenTypeOverrides={});var S={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 F in S)S.hasOwnProperty(F)&&V.tokenTypeOverrides[F]&&(S[F]=V.tokenTypeOverrides[F]);var U=/^([*\-_])(?:\s*\1){2,}\s*$/,$=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,M=/^\[(x| )\](?=\s)/i,O=V.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,te=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Q=/^[^#!\[\]*_\\<>` "'(~:]+/,K=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,N=/^\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]/,ee=" ";function fe(T,g,de){return g.f=g.inline=de,de(T,g)}function Re(T,g,de){return g.f=g.block=de,de(T,g)}function Ke(T){return!T||!/\S/.test(T.string)}function _e(T){if(T.linkTitle=!1,T.linkHref=!1,T.linkText=!1,T.em=!1,T.strong=!1,T.strikethrough=!1,T.quote=0,T.indentedCode=!1,T.f==Ae){var g=C;if(!g){var de=E.innerMode(H,T.htmlState);g=de.mode.name=="xml"&&de.state.tagStart===null&&!de.state.context&&de.state.tokenize.isInText}g&&(T.f=me,T.block=ye,T.htmlState=null)}return T.trailingSpace=0,T.trailingSpaceNewLine=!1,T.prevLine=T.thisLine,T.thisLine={stream:null},null}function ye(T,g){var de=T.column()===g.indentation,Ie=Ke(g.prevLine.stream),De=g.indentedCode,rt=g.prevLine.hr,ot=g.list!==!1,He=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Ue=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,ot)){for(g.list=null;Ue<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=Ue-g.listStack[g.listStack.length-1])}var Pe=!Ie&&!rt&&!g.prevLine.header&&(!ot||!De)&&!g.prevLine.fencedCodeEnd,Be=(g.list===!1||rt||Ie)&&g.indentation<=He&&T.match(U),ue=null;if(g.indentationDiff>=4&&(De||g.prevLine.fencedCodeEnd||g.prevLine.header||Ie))return T.skipToEnd(),g.indentedCode=!0,S.code;if(T.eatSpace())return null;if(de&&g.indentation<=He&&(ue=T.match(O))&&ue[1].length<=6)return g.quote=0,g.header=ue[1].length,g.thisLine.header=!0,V.highlightFormatting&&(g.formatting="header"),g.f=g.inline,Ee(g);if(g.indentation<=He&&T.eat(">"))return g.quote=de?1:g.quote+1,V.highlightFormatting&&(g.formatting="quote"),T.eatSpace(),Ee(g);if(!Be&&!g.setext&&de&&g.indentation<=He&&(ue=T.match($))){var D=ue[1]?"ol":"ul";return g.indentation=Ue+T.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,V.taskLists&&T.match(M,!1)&&(g.taskList=!0),g.f=g.inline,V.highlightFormatting&&(g.formatting=["list","list-"+D]),Ee(g)}else{if(de&&g.indentation<=He&&(ue=T.match(K,!0)))return g.quote=0,g.fencedEndRE=new RegExp(ue[1]+"+ *$"),g.localMode=V.fencedCodeBlockHighlighting&&re(ue[2]||V.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=E.startState(g.localMode)),g.f=g.block=Ce,V.highlightFormatting&&(g.formatting="code-block"),g.code=-1,Ee(g);if(g.setext||(!Pe||!ot)&&!g.quote&&g.list===!1&&!g.code&&!Be&&!N.test(T.string)&&(ue=T.lookAhead(1))&&(ue=ue.match(te)))return g.setext?(g.header=g.setext,g.setext=0,T.skipToEnd(),V.highlightFormatting&&(g.formatting="header")):(g.header=ue[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,Ee(g);if(Be)return T.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,S.hr;if(T.peek()==="[")return fe(T,g,G)}return fe(T,g,g.inline)}function Ae(T,g){var de=H.token(T,g.htmlState);if(!C){var Ie=E.innerMode(H,g.htmlState);(Ie.mode.name=="xml"&&Ie.state.tagStart===null&&!Ie.state.context&&Ie.state.tokenize.isInText||g.md_inside&&T.current().indexOf(">")>-1)&&(g.f=me,g.block=ye,g.htmlState=null)}return de}function Ce(T,g){var de=g.listStack[g.listStack.length-1]||0,Ie=g.indentation<de,De=de+3;if(g.fencedEndRE&&g.indentation<=De&&(Ie||T.match(g.fencedEndRE))){V.highlightFormatting&&(g.formatting="code-block");var rt;return Ie||(rt=Ee(g)),g.localMode=g.localState=null,g.block=ye,g.f=me,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,Ie?Re(T,g,g.block):rt}else return g.localMode?g.localMode.token(T,g.localState):(T.skipToEnd(),S.code)}function Ee(T){var g=[];if(T.formatting){g.push(S.formatting),typeof T.formatting=="string"&&(T.formatting=[T.formatting]);for(var de=0;de<T.formatting.length;de++)g.push(S.formatting+"-"+T.formatting[de]),T.formatting[de]==="header"&&g.push(S.formatting+"-"+T.formatting[de]+"-"+T.header),T.formatting[de]==="quote"&&(!V.maxBlockquoteDepth||V.maxBlockquoteDepth>=T.quote?g.push(S.formatting+"-"+T.formatting[de]+"-"+T.quote):g.push("error"))}if(T.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(T.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(T.linkHref?g.push(S.linkHref,"url"):(T.strong&&g.push(S.strong),T.em&&g.push(S.em),T.strikethrough&&g.push(S.strikethrough),T.emoji&&g.push(S.emoji),T.linkText&&g.push(S.linkText),T.code&&g.push(S.code),T.image&&g.push(S.image),T.imageAltText&&g.push(S.imageAltText,"link"),T.imageMarker&&g.push(S.imageMarker)),T.header&&g.push(S.header,S.header+"-"+T.header),T.quote&&(g.push(S.quote),!V.maxBlockquoteDepth||V.maxBlockquoteDepth>=T.quote?g.push(S.quote+"-"+T.quote):g.push(S.quote+"-"+V.maxBlockquoteDepth)),T.list!==!1){var Ie=(T.listStack.length-1)%3;Ie?Ie===1?g.push(S.list2):g.push(S.list3):g.push(S.list1)}return T.trailingSpaceNewLine?g.push("trailing-space-new-line"):T.trailingSpace&&g.push("trailing-space-"+(T.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function Fe(T,g){return T.match(Q,!0)?Ee(g):void 0}function me(T,g){var de=g.text(T,g);if(typeof de!="undefined")return de;if(g.list)return g.list=null,Ee(g);if(g.taskList){var Ie=T.match(M,!0)[1]===" ";return Ie?g.taskOpen=!0:g.taskClosed=!0,V.highlightFormatting&&(g.formatting="task"),g.taskList=!1,Ee(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&T.match(/^#+$/,!0))return V.highlightFormatting&&(g.formatting="header"),Ee(g);var De=T.next();if(g.linkTitle){g.linkTitle=!1;var rt=De;De==="("&&(rt=")"),rt=(rt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ot="^\\s*(?:[^"+rt+"\\\\]+|\\\\\\\\|\\\\.)"+rt;if(T.match(new RegExp(ot),!0))return S.linkHref}if(De==="`"){var He=g.formatting;V.highlightFormatting&&(g.formatting="code"),T.eatWhile("`");var Ue=T.current().length;if(g.code==0&&(!g.quote||Ue==1))return g.code=Ue,Ee(g);if(Ue==g.code){var Pe=Ee(g);return g.code=0,Pe}else return g.formatting=He,Ee(g)}else if(g.code)return Ee(g);if(De==="\\"&&(T.next(),V.highlightFormatting)){var Be=Ee(g),ue=S.formatting+"-escape";return Be?Be+" "+ue:ue}if(De==="!"&&T.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,V.highlightFormatting&&(g.formatting="image"),Ee(g);if(De==="["&&g.imageMarker&&T.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,V.highlightFormatting&&(g.formatting="image"),Ee(g);if(De==="]"&&g.imageAltText){V.highlightFormatting&&(g.formatting="image");var Be=Ee(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=ke,Be}if(De==="["&&!g.image)return g.linkText&&T.match(/^.*?\]/)||(g.linkText=!0,V.highlightFormatting&&(g.formatting="link")),Ee(g);if(De==="]"&&g.linkText){V.highlightFormatting&&(g.formatting="link");var Be=Ee(g);return g.linkText=!1,g.inline=g.f=T.match(/\(.*?\)| ?\[.*?\]/,!1)?ke:me,Be}if(De==="<"&&T.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=L,V.highlightFormatting&&(g.formatting="link");var Be=Ee(g);return Be?Be+=" ":Be="",Be+S.linkInline}if(De==="<"&&T.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=L,V.highlightFormatting&&(g.formatting="link");var Be=Ee(g);return Be?Be+=" ":Be="",Be+S.linkEmail}if(V.xml&&De==="<"&&T.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var D=T.string.indexOf(">",T.pos);if(D!=-1){var Ze=T.string.substring(T.start,D);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ze)&&(g.md_inside=!0)}return T.backUp(1),g.htmlState=E.startState(H),Re(T,g,Ae)}if(V.xml&&De==="<"&&T.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(De==="*"||De==="_"){for(var mt=1,Ct=T.pos==1?" ":T.string.charAt(T.pos-2);mt<3&&T.eat(De);)mt++;var ut=T.peek()||" ",st=!/\s/.test(ut)&&(!W.test(ut)||/\s/.test(Ct)||W.test(Ct)),he=!/\s/.test(Ct)&&(!W.test(Ct)||/\s/.test(ut)||W.test(ut)),Me=null,Oe=null;if(mt%2&&(!g.em&&st&&(De==="*"||!he||W.test(Ct))?Me=!0:g.em==De&&he&&(De==="*"||!st||W.test(ut))&&(Me=!1)),mt>1&&(!g.strong&&st&&(De==="*"||!he||W.test(Ct))?Oe=!0:g.strong==De&&he&&(De==="*"||!st||W.test(ut))&&(Oe=!1)),Oe!=null||Me!=null){V.highlightFormatting&&(g.formatting=Me==null?"strong":Oe==null?"em":"strong em"),Me===!0&&(g.em=De),Oe===!0&&(g.strong=De);var Pe=Ee(g);return Me===!1&&(g.em=!1),Oe===!1&&(g.strong=!1),Pe}}else if(De===" "&&(T.eat("*")||T.eat("_"))){if(T.peek()===" ")return Ee(g);T.backUp(1)}if(V.strikethrough){if(De==="~"&&T.eatWhile(De)){if(g.strikethrough){V.highlightFormatting&&(g.formatting="strikethrough");var Pe=Ee(g);return g.strikethrough=!1,Pe}else if(T.match(/^[^\s]/,!1))return g.strikethrough=!0,V.highlightFormatting&&(g.formatting="strikethrough"),Ee(g)}else if(De===" "&&T.match(/^~~/,!0)){if(T.peek()===" ")return Ee(g);T.backUp(2)}}if(V.emoji&&De===":"&&T.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,V.highlightFormatting&&(g.formatting="emoji");var Se=Ee(g);return g.emoji=!1,Se}return De===" "&&(T.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),Ee(g)}function L(T,g){var de=T.next();if(de===">"){g.f=g.inline=me,V.highlightFormatting&&(g.formatting="link");var Ie=Ee(g);return Ie?Ie+=" ":Ie="",Ie+S.linkInline}return T.match(/^[^>]+/,!0),S.linkInline}function ke(T,g){if(T.eatSpace())return null;var de=T.next();return de==="("||de==="["?(g.f=g.inline=k(de==="("?")":"]"),V.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,Ee(g)):"error"}var ve={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function k(T){return function(g,de){var Ie=g.next();if(Ie===T){de.f=de.inline=me,V.highlightFormatting&&(de.formatting="link-string");var De=Ee(de);return de.linkHref=!1,De}return g.match(ve[T]),de.linkHref=!0,Ee(de)}}function G(T,g){return T.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=le,T.next(),V.highlightFormatting&&(g.formatting="link"),g.linkText=!0,Ee(g)):fe(T,g,me)}function le(T,g){if(T.match(/^\]:/,!0)){g.f=g.inline=X,V.highlightFormatting&&(g.formatting="link");var de=Ee(g);return g.linkText=!1,de}return T.match(/^([^\]\\]|\\.)+/,!0),S.linkText}function X(T,g){return T.eatSpace()?null:(T.match(/^[^\s]+/,!0),T.peek()===void 0?g.linkTitle=!0:T.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),g.f=g.inline=me,S.linkHref+" url")}var Le={startState:function(){return{f:ye,prevLine:{stream:null},thisLine:{stream:null},block:ye,htmlState:null,indentation:0,inline:me,text:Fe,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(T){return{f:T.f,prevLine:T.prevLine,thisLine:T.thisLine,block:T.block,htmlState:T.htmlState&&E.copyState(H,T.htmlState),indentation:T.indentation,localMode:T.localMode,localState:T.localMode?E.copyState(T.localMode,T.localState):null,inline:T.inline,text:T.text,formatting:!1,linkText:T.linkText,linkTitle:T.linkTitle,linkHref:T.linkHref,code:T.code,em:T.em,strong:T.strong,strikethrough:T.strikethrough,emoji:T.emoji,header:T.header,setext:T.setext,hr:T.hr,taskList:T.taskList,list:T.list,listStack:T.listStack.slice(0),quote:T.quote,indentedCode:T.indentedCode,trailingSpace:T.trailingSpace,trailingSpaceNewLine:T.trailingSpaceNewLine,md_inside:T.md_inside,fencedEndRE:T.fencedEndRE}},token:function(T,g){if(g.formatting=!1,T!=g.thisLine.stream){if(g.header=0,g.hr=!1,T.match(/^\s*$/,!0))return _e(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:T},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=Ae)){var de=T.match(/^\s*/,!0)[0].replace(/\t/g,ee).length;if(g.indentation=de,g.indentationDiff=null,de>0)return null}}return g.f(T,g)},innerMode:function(T){return T.block==Ae?{state:T.htmlState,mode:H}:T.localState?{state:T.localState,mode:T.localMode}:{state:T,mode:Le}},indent:function(T,g,de){return T.block==Ae&&H.indent?H.indent(T.htmlState,g,de):T.localState&&T.localMode.indent?T.localMode.indent(T.localState,g,de):E.Pass},blankLine:_e,getType:Ee,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Le},"xml"),E.defineMIME("text/markdown","markdown"),E.defineMIME("text/x-markdown","markdown")})},nVVt:function(vt,Qe){vt.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(vt,Qe,y){(function(E){E(y("VrN/"))})(function(E){"use strict";var ce=E.Pos;function V(W,ee){return W.line-ee.line||W.ch-ee.ch}var H="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",C=H+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",re=new RegExp("<(/?)(["+H+"]["+C+"]*)","g");function S(W,ee,fe,Re){this.line=ee,this.ch=fe,this.cm=W,this.text=W.getLine(ee),this.min=Re?Math.max(Re.from,W.firstLine()):W.firstLine(),this.max=Re?Math.min(Re.to-1,W.lastLine()):W.lastLine()}function F(W,ee){var fe=W.cm.getTokenTypeAt(ce(W.line,ee));return fe&&/\btag\b/.test(fe)}function U(W){return W.line>=W.max?void 0:(W.ch=0,W.text=W.cm.getLine(++W.line),!0)}function $(W){return W.line<=W.min?void 0:(W.text=W.cm.getLine(--W.line),W.ch=W.text.length,!0)}function M(W){for(;;){var ee=W.text.indexOf(">",W.ch);if(ee==-1){if(U(W))continue;return}if(!F(W,ee+1)){W.ch=ee+1;continue}var fe=W.text.lastIndexOf("/",ee),Re=fe>-1&&!/\S/.test(W.text.slice(fe+1,ee));return W.ch=ee+1,Re?"selfClose":"regular"}}function O(W){for(;;){var ee=W.ch?W.text.lastIndexOf("<",W.ch-1):-1;if(ee==-1){if($(W))continue;return}if(!F(W,ee+1)){W.ch=ee;continue}re.lastIndex=ee,W.ch=ee;var fe=re.exec(W.text);if(fe&&fe.index==ee)return fe}}function te(W){for(;;){re.lastIndex=W.ch;var ee=re.exec(W.text);if(!ee){if(U(W))continue;return}if(!F(W,ee.index+1)){W.ch=ee.index+1;continue}return W.ch=ee.index+ee[0].length,ee}}function Q(W){for(;;){var ee=W.ch?W.text.lastIndexOf(">",W.ch-1):-1;if(ee==-1){if($(W))continue;return}if(!F(W,ee+1)){W.ch=ee;continue}var fe=W.text.lastIndexOf("/",ee),Re=fe>-1&&!/\S/.test(W.text.slice(fe+1,ee));return W.ch=ee+1,Re?"selfClose":"regular"}}function K(W,ee){for(var fe=[];;){var Re=te(W),Ke,_e=W.line,ye=W.ch-(Re?Re[0].length:0);if(!Re||!(Ke=M(W)))return;if(Ke=="selfClose")continue;if(Re[1]){for(var Ae=fe.length-1;Ae>=0;--Ae)if(fe[Ae]==Re[2]){fe.length=Ae;break}if(Ae<0&&(!ee||ee==Re[2]))return{tag:Re[2],from:ce(_e,ye),to:ce(W.line,W.ch)}}else fe.push(Re[2])}}function N(W,ee){for(var fe=[];;){var Re=Q(W);if(!Re)return;if(Re=="selfClose"){O(W);continue}var Ke=W.line,_e=W.ch,ye=O(W);if(!ye)return;if(ye[1])fe.push(ye[2]);else{for(var Ae=fe.length-1;Ae>=0;--Ae)if(fe[Ae]==ye[2]){fe.length=Ae;break}if(Ae<0&&(!ee||ee==ye[2]))return{tag:ye[2],from:ce(W.line,W.ch),to:ce(Ke,_e)}}}}E.registerHelper("fold","xml",function(W,ee){for(var fe=new S(W,ee.line,0);;){var Re=te(fe);if(!Re||fe.line!=ee.line)return;var Ke=M(fe);if(!Ke)return;if(!Re[1]&&Ke!="selfClose"){var _e=ce(fe.line,fe.ch),ye=K(fe,Re[2]);return ye&&V(ye.from,_e)>0?{from:_e,to:ye.from}:null}}}),E.findMatchingTag=function(W,ee,fe){var Re=new S(W,ee.line,ee.ch,fe);if(Re.text.indexOf(">")==-1&&Re.text.indexOf("<")==-1)return;var Ke=M(Re),_e=Ke&&ce(Re.line,Re.ch),ye=Ke&&O(Re);if(!Ke||!ye||V(Re,ee)>0)return;var Ae={from:ce(Re.line,Re.ch),to:_e,tag:ye[2]};return Ke=="selfClose"?{open:Ae,close:null,at:"open"}:ye[1]?{open:N(Re,ye[2]),close:Ae,at:"close"}:(Re=new S(W,_e.line,_e.ch,fe),{open:Ae,close:K(Re,ye[2]),at:"open"})},E.findEnclosingTag=function(W,ee,fe,Re){for(var Ke=new S(W,ee.line,ee.ch,fe);;){var _e=N(Ke,Re);if(!_e)break;var ye=new S(W,ee.line,ee.ch,fe),Ae=K(ye,_e.tag);if(Ae)return{open:_e,close:Ae}}},E.scanForClosingTag=function(W,ee,fe,Re){var Ke=new S(W,ee.line,ee.ch,Re?{from:0,to:Re}:null);return K(Ke,fe)}})},p5ED:function(vt,Qe,y){"use strict";var E=y("+L6B"),ce=y("2/Rp"),V=y("5Dmo"),H=y("3S7+"),C=y("k1fw"),re=y("9og8"),S=y("tJVT"),F=y("WmNS"),U=y.n(F),$=y("q1tI"),M=y.n($),O=y("vHTk"),te=y.n(O),Q=y("yEEn"),K=y("ZW9T"),N=y("1vsH"),W=y("V0Rq"),ee=y("m3rI"),fe=function(Ke){var _e=Ke.name,ye=Ke.data,Ae=Ke.theme,Ce=Ke.type,Ee=Ke.filename,Fe=Ke.monacoEditor,me=Ke.className,L=Ke.style,ke=Ke.close,ve=Ke.onClose,k=Ke.hasMask,G=Ke.otherData,le=G===void 0?{}:G,X=Object($.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Le=Object(S.a)(X,2),T=Le[0],g=Le[1],de=Object($.useState)(""),Ie=Object(S.a)(de,2),De=Ie[0],rt=Ie[1],ot=Object($.useState)(),He=Object(S.a)(ot,2),Ue=He[0],Pe=He[1],Be,ue=1024*1024,D=10*ue,Ze=Object($.useRef)();Ce==="office"&&(Be=Object(N.R)(ye).filesize,Be>D&&(Ce="other")),Ee&&(Fe.filename=Ee),Object($.useEffect)(function(){var st,he,Me=(st=document.cookie)===null||st===void 0||((he=st.replace(/\s/g,""))===null||he===void 0)?void 0:he.split(";");Me==null||Me.map(function(Oe){var Se=Oe.split("=");Se[0]==="_educoder_session"&&rt(Se[1])})},[]),Object($.useEffect)(function(){Ce==="office"&&mt()},[Ce]);var mt=function(){var st=Object(re.a)(U.a.mark(function he(){var Me,Oe,Se;return U.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return console.log("data:",ye),Me=ye,ye.startsWith("http")||(Me=location.origin+Me),Oe=new URL(Me).pathname.split("/").pop(),Ye.next=6,Object(W.U)({attachment_id:Oe});case 6:Se=Ye.sent,Pe(Se);case 8:case"end":return Ye.stop()}},he)}));return function(){return st.apply(this,arguments)}}(),Ct=function(){if(ye.startsWith("http")||ye.startsWith("blob:")){ut();return}Object(N.x)(Ee||"educoder",ye,Ee)},ut=function(){Object(N.v)(Ee||"educoder",decodeURIComponent(ye))};return M.a.createElement("div",{style:Object(C.a)({},L||{}),className:"".concat(k&&te.a.bgBlack," ").concat(Ce?te.a.wrp:"hide")},ke&&M.a.createElement("div",{className:te.a.close,ref:Ze},M.a.createElement(H.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ze.current}},M.a.createElement("span",{onClick:ut},M.a.createElement("i",{className:"icon-quxiaozhiding"}))),M.a.createElement(H.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ze.current}},M.a.createElement("span",{className:"",onClick:function(){ve(),Pe(null)}},M.a.createElement("i",{className:"icon-guanbi1"})))),M.a.createElement("div",{className:"".concat(te.a[me]," ").concat(me," ").concat(te.a.monaco," ").concat(Ce==="txt"?"show":"hide")},Ce==="txt"&&M.a.createElement(K.b,Fe)),Ce==="audio"&&M.a.createElement("audio",{src:"".concat((ye==null?void 0:ye.indexOf("http://"))>-1||(ye==null?void 0:ye.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(ye),autoPlay:!0}),Ce==="video"&&M.a.createElement(M.a.Fragment,null,(ye==null?void 0:ye.indexOf("http"))>-1?M.a.createElement("video",{controls:!0,src:"".concat(ye),autoPlay:!0}):M.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(ye),autoPlay:!0})),Ce==="office"&&Ue&&M.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(Ue.key,"&url=").concat(ee.a.API_SERVER+Ue.url,"&callbackUrl=").concat(ee.a.API_SERVER+Ue.callbackUrl,"&fileType=").concat(Ue.fileType,"&title=").concat(Ue.title,"&model=view")}),(Ce==="xlsx"||Ce==="doc"||Ce==="pptx"||Ce==="docx")&&M.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(le.key,"&url=").concat(ee.a.API_SERVER+le.url,"&callbackUrl=").concat(ee.a.API_SERVER+le.callbackUrl,"&fileType=").concat(le.fileType,"&title=").concat(le.title,"&model=").concat(le.model)}),Ce==="html"&&M.a.createElement("iframe",{src:ye+"&disposition=inline"}),Ce==="pdf"&&M.a.createElement("embed",{className:te.a.embed,src:ye,type:"application/pdf"}),Ce==="image"&&M.a.createElement("img",{src:"".concat((ye==null?void 0:ye.indexOf("http://"))>-1||(ye==null?void 0:ye.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(ye)}),Ce==="other"&&M.a.createElement("div",null,M.a.createElement(ce.a,{type:"primary",size:"large",onClick:Ct},M.a.createElement(Q.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),Ce==="download"&&M.a.createElement(ce.a,{type:"primary",size:"large",onClick:Ct},M.a.createElement(Q.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))};Qe.a=fe},"p77/":function(vt,Qe,y){},"rAM+":function(vt,Qe,y){"use strict";y.d(Qe,"a",function(){return ce});var E=y("Qw5x");function ce(V,H){var C;if(typeof Symbol=="undefined"||V[Symbol.iterator]==null){if(Array.isArray(V)||(C=Object(E.a)(V))||H&&V&&typeof V.length=="number"){C&&(V=C);var re=0,S=function(){};return{s:S,n:function(){return re>=V.length?{done:!0}:{done:!1,value:V[re++]}},e:function(O){throw O},f:S}}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 F=!0,U=!1,$;return{s:function(){C=V[Symbol.iterator]()},n:function(){var O=C.next();return F=O.done,O},e:function(O){U=!0,$=O},f:function(){try{!F&&C.return!=null&&C.return()}finally{if(U)throw $}}}}},rUJ1:function(vt,Qe){const y=/[&<>"']/,E=/[&<>"']/g,ce=/[<>"']|&(?!#?\w+;)/,V=/[<>"']|&(?!#?\w+;)/g,H={"&":"&","<":"<",">":">",'"':""","'":"'"},C=Ce=>H[Ce];function re(Ce,Ee){if(Ee){if(y.test(Ce))return Ce.replace(E,C)}else if(ce.test(Ce))return Ce.replace(V,C);return Ce}const S=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(Ce){return Ce.replace(S,(Ee,Fe)=>(Fe=Fe.toLowerCase(),Fe==="colon"?":":Fe.charAt(0)==="#"?Fe.charAt(1)==="x"?String.fromCharCode(parseInt(Fe.substring(2),16)):String.fromCharCode(+Fe.substring(1)):""))}const U=/(^|[^\[])\^/g;function $(Ce,Ee){Ce=Ce.source||Ce,Ee=Ee||"";const Fe={replace:(me,L)=>(L=L.source||L,L=L.replace(U,"$1"),Ce=Ce.replace(me,L),Fe),getRegex:()=>new RegExp(Ce,Ee)};return Fe}const M=/[^\w:]/g,O=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function te(Ce,Ee,Fe){if(Ce){let me;try{me=decodeURIComponent(F(Fe)).replace(M,"").toLowerCase()}catch(L){return null}if(me.indexOf("javascript:")===0||me.indexOf("vbscript:")===0||me.indexOf("data:")===0)return null}Ee&&!O.test(Fe)&&(Fe=ee(Ee,Fe));try{Fe=encodeURI(Fe).replace(/%25/g,"%")}catch(me){return null}return Fe}const Q={},K=/^[^:]+:\/*[^/]*$/,N=/^([^:]+:)[\s\S]*$/,W=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ee(Ce,Ee){Q[" "+Ce]||(K.test(Ce)?Q[" "+Ce]=Ce+"/":Q[" "+Ce]=_e(Ce,"/",!0)),Ce=Q[" "+Ce];const Fe=Ce.indexOf(":")===-1;return Ee.substring(0,2)==="//"?Fe?Ee:Ce.replace(N,"$1")+Ee:Ee.charAt(0)==="/"?Fe?Ee:Ce.replace(W,"$1")+Ee:Ce+Ee}const fe={exec:function(){}};function Re(Ce){let Ee=1,Fe,me;for(;Ee<arguments.length;Ee++){Fe=arguments[Ee];for(me in Fe)Object.prototype.hasOwnProperty.call(Fe,me)&&(Ce[me]=Fe[me])}return Ce}function Ke(Ce,Ee){const Fe=Ce.replace(/\|/g,(ke,ve,k)=>{let G=!1,le=ve;for(;--le>=0&&k[le]==="\\";)G=!G;return G?"|":" |"}),me=Fe.split(/ \|/);let L=0;if(me.length>Ee)me.splice(Ee);else for(;me.length<Ee;)me.push("");for(;L<me.length;L++)me[L]=me[L].trim().replace(/\\\|/g,"|");return me}function _e(Ce,Ee,Fe){const me=Ce.length;if(me===0)return"";let L=0;for(;L<me;){const ke=Ce.charAt(me-L-1);if(ke===Ee&&!Fe)L++;else if(ke!==Ee&&Fe)L++;else break}return Ce.substr(0,me-L)}function ye(Ce,Ee){if(Ce.indexOf(Ee[1])===-1)return-1;const Fe=Ce.length;let me=0,L=0;for(;L<Fe;L++)if(Ce[L]==="\\")L++;else if(Ce[L]===Ee[0])me++;else if(Ce[L]===Ee[1]&&(me--,me<0))return L;return-1}function Ae(Ce){Ce&&Ce.sanitize&&!Ce.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")}vt.exports={escape:re,unescape:F,edit:$,cleanUrl:te,resolveUrl:ee,noopTest:fe,merge:Re,splitCells:Ke,rtrim:_e,findClosingBracket:ye,checkSanitizeDeprecation:Ae}},rcnY:function(vt,Qe,y){var E=y("aRTE");function ce(V,H){this.totalCount=V,this.dataCount=H}ce.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],ce.getRSBlocks=function(V,H){var C=ce.getRsBlockTable(V,H);if(C==null)throw new Error("bad rs block @ typeNumber:"+V+"/errorCorrectLevel:"+H);for(var re=C.length/3,S=new Array,F=0;F<re;F++)for(var U=C[F*3+0],$=C[F*3+1],M=C[F*3+2],O=0;O<U;O++)S.push(new ce($,M));return S},ce.getRsBlockTable=function(V,H){switch(H){case E.L:return ce.RS_BLOCK_TABLE[(V-1)*4+0];case E.M:return ce.RS_BLOCK_TABLE[(V-1)*4+1];case E.Q:return ce.RS_BLOCK_TABLE[(V-1)*4+2];case E.H:return ce.RS_BLOCK_TABLE[(V-1)*4+3];default:return}},vt.exports=ce},t23M:function(vt,Qe,y){"use strict";var E=y("VTBJ"),ce=y("1OyB"),V=y("vuIU"),H=y("Ji7U"),C=y("LK+K"),re=y("q1tI"),S=y.n(re),F=y("m+aA"),U=y("Zm9Q"),$=y("Kwbf"),M=y("c+Xe"),O=y("bdgK"),te="rc-observer-key",Q=function(K){Object(H.a)(W,K);var N=Object(C.a)(W);function W(){var ee;return Object(ce.a)(this,W),ee=N.apply(this,arguments),ee.resizeObserver=null,ee.childNode=null,ee.currentElement=null,ee.state={width:0,height:0,offsetHeight:0,offsetWidth:0},ee.onResize=function(fe){var Re=ee.props.onResize,Ke=fe[0].target,_e=Ke.getBoundingClientRect(),ye=_e.width,Ae=_e.height,Ce=Ke.offsetWidth,Ee=Ke.offsetHeight,Fe=Math.floor(ye),me=Math.floor(Ae);if(ee.state.width!==Fe||ee.state.height!==me||ee.state.offsetWidth!==Ce||ee.state.offsetHeight!==Ee){var L={width:Fe,height:me,offsetWidth:Ce,offsetHeight:Ee};ee.setState(L),Re&&Promise.resolve().then(function(){Re(Object(E.a)(Object(E.a)({},L),{},{offsetWidth:Ce,offsetHeight:Ee}))})}},ee.setChildNode=function(fe){ee.childNode=fe},ee}return Object(V.a)(W,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var fe=this.props.disabled;if(fe){this.destroyObserver();return}var Re=Object(F.a)(this.childNode||this),Ke=Re!==this.currentElement;Ke&&(this.destroyObserver(),this.currentElement=Re),!this.resizeObserver&&Re&&(this.resizeObserver=new O.default(this.onResize),this.resizeObserver.observe(Re))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var fe=this.props.children,Re=Object(U.a)(fe);if(Re.length>1)Object($.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(Re.length===0)return Object($.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var Ke=Re[0];if(re.isValidElement(Ke)&&Object(M.c)(Ke)){var _e=Ke.ref;Re[0]=re.cloneElement(Ke,{ref:Object(M.a)(_e,this.setChildNode)})}return Re.length===1?Re[0]:Re.map(function(ye,Ae){return!re.isValidElement(ye)||"key"in ye&&ye.key!==null?ye:re.cloneElement(ye,{key:"".concat(te,"-").concat(Ae)})})}}]),W}(re.Component);Q.displayName="ResizeObserver",Qe.a=Q},vHTk:function(vt,Qe,y){vt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(vt,Qe){function y(){this.buffer=new Array,this.length=0}y.prototype={get:function(E){var ce=Math.floor(E/8);return(this.buffer[ce]>>>7-E%8&1)==1},put:function(E,ce){for(var V=0;V<ce;V++)this.putBit((E>>>ce-V-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(E){var ce=Math.floor(this.length/8);this.buffer.length<=ce&&this.buffer.push(0),E&&(this.buffer[ce]|=128>>>this.length%8),this.length++}},vt.exports=y},xz5A:function(vt,Qe,y){vt.exports={wrapper:"wrapper___12wjq",cover:"cover___1GkB-",title:"title___3YAzg",desc:"desc___S4YrB",info:"info___3i5kz",create_time:"create_time___3X1Dr",tagWrapper:"tagWrapper___2Xfw-",btnWrapper:"btnWrapper___3JhOM",btn:"btn___1VL7l",fileWrapper:"fileWrapper___3yI82",fileSize:"fileSize___3672L",download:"download___2tlkv",mainInfo:"mainInfo___133l4",mainText:"mainText___32dN7"}}}]);
|