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

349 lines
788 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[175,7,8],{"+NIl":function(rt,ue,l){(function(q){q(l("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(_e,me){"use strict";function we(x,w){x.cmdState.push(w)}function Ee(x){return x.cmdState.length>0?x.cmdState[x.cmdState.length-1]:null}function fe(x){var w=x.cmdState.pop();w&&w.closeBracket()}function Y(x){for(var w=x.cmdState,M=w.length-1;M>=0;M--){var m=w[M];if(m.name=="DEFAULT")continue;return m}return{styleIdentifier:function(){return null}}}function B(x,w,M){return function(){this.name=x,this.bracketNo=0,this.style=w,this.styles=M,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var N={};N.importmodule=B("importmodule","tag",["string","builtin"]),N.documentclass=B("documentclass","tag",["","atom"]),N.usepackage=B("usepackage","tag",["atom"]),N.begin=B("begin","tag",["atom"]),N.end=B("end","tag",["atom"]),N.label=B("label","tag",["atom"]),N.ref=B("ref","tag",["atom"]),N.eqref=B("eqref","tag",["atom"]),N.cite=B("cite","tag",["atom"]),N.bibitem=B("bibitem","tag",["atom"]),N.Bibitem=B("Bibitem","tag",["atom"]),N.RBibitem=B("RBibitem","tag",["atom"]),N.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function A(x,w){x.f=w}function _(x,w){var M;if(x.match(/^\\[a-zA-Z@]+/)){var m=x.current().slice(1);return M=N.hasOwnProperty(m)?N[m]:N.DEFAULT,M=new M,we(w,M),A(w,O),M.style}if(x.match(/^\\[$&%#{}_]/))return"tag";if(x.match(/^\\[,;!\/\\]/))return"tag";if(x.match("\\["))return A(w,function(f,L){return C(f,L,"\\]")}),"keyword";if(x.match("\\("))return A(w,function(f,L){return C(f,L,"\\)")}),"keyword";if(x.match("$$"))return A(w,function(f,L){return C(f,L,"$$")}),"keyword";if(x.match("$"))return A(w,function(f,L){return C(f,L,"$")}),"keyword";var v=x.next();if(v=="%")return x.skipToEnd(),"comment";if(v=="}"||v=="]"){if(M=Ee(w),M)M.closeBracket(v),A(w,O);else return"error";return"bracket"}else return v=="{"||v=="["?(M=N.DEFAULT,M=new M,we(w,M),"bracket"):/\d/.test(v)?(x.eatWhile(/[\w.%]/),"atom"):(x.eatWhile(/[\w\-_]/),M=Y(w),M.name=="begin"&&(M.argument=x.current()),M.styleIdentifier())}function C(x,w,M){if(x.eatSpace())return null;if(M&&x.match(M))return A(w,_),"keyword";if(x.match(/^\\[a-zA-Z@]+/))return"tag";if(x.match(/^[a-zA-Z]+/))return"variable-2";if(x.match(/^\\[$&%#{}_]/))return"tag";if(x.match(/^\\[,;!\/]/))return"tag";if(x.match(/^[\^_&]/))return"tag";if(x.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(x.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var m=x.next();return m=="{"||m=="}"||m=="["||m=="]"||m=="("||m==")"?"bracket":m=="%"?(x.skipToEnd(),"comment"):"error"}function O(x,w){var M=x.peek(),m;return M=="{"||M=="["?(m=Ee(w),m.openBracket(M),x.eat(M),A(w,_),"bracket"):/[ \t\r]/.test(M)?(x.eat(M),null):(A(w,_),fe(w),_(x,w))}return{startState:function(){var x=me.inMathMode?function(w,M){return C(w,M)}:_;return{cmdState:[],f:x}},copyState:function(x){return{cmdState:x.cmdState.slice(),f:x.f}},token:function(x,w){return w.f(x,w)},blankLine:function(x){x.f=_,x.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+RXH":function(rt,ue,l){rt.exports=l.p+"static/shu.a39bf729.svg"},"+ua5":function(rt,ue,l){},"+yhJ":function(rt,ue,l){rt.exports=l.p+"static/xixi.d492fb65.svg"},"/cxE":function(rt,ue,l){"use strict";l.d(ue,"e",function(){return me}),l.d(ue,"f",function(){return we}),l.d(ue,"g",function(){return Ee}),l.d(ue,"d",function(){return Y}),l.d(ue,"a",function(){return B}),l.d(ue,"b",function(){return N}),l.d(ue,"c",function(){return A});var q=function(){function _(){this.listeners=[],this.unexpectedErrorHandler=function(C){setTimeout(function(){throw C.stack?new Error(C.message+`
`+C.stack):C},0)}}return _.prototype.emit=function(C){this.listeners.forEach(function(O){O(C)})},_.prototype.onUnexpectedError=function(C){this.unexpectedErrorHandler(C),this.emit(C)},_.prototype.onUnexpectedExternalError=function(C){this.unexpectedErrorHandler(C)},_}(),_e=new q;function me(_){Y(_)||_e.onUnexpectedError(_);return}function we(_){Y(_)||_e.onUnexpectedExternalError(_);return}function Ee(_){if(_ instanceof Error){var C=_.name,O=_.message,x=_.stacktrace||_.stack;return{$isError:!0,name:C,message:O,stack:x}}return _}var fe="Canceled";function Y(_){return _ instanceof Error&&_.name===fe&&_.message===fe}function B(){var _=new Error(fe);return _.name=_.message,_}function N(_){return _?new Error("Illegal argument: "+_):new Error("Illegal argument")}function A(_){return _?new Error("Illegal state: "+_):new Error("Illegal state")}},"0eGx":function(rt,ue,l){rt.exports=l.p+"static/zhong.c1924b73.svg"},"19Vz":function(rt,ue,l){(function(q){q(l("VrN/"))})(function(q){q.defineOption("placeholder","",function(B,N,A){var _=A&&A!=q.Init;if(N&&!_)B.on("blur",Ee),B.on("change",fe),B.on("swapDoc",fe),q.on(B.getInputField(),"compositionupdate",B.state.placeholderCompose=function(){we(B)}),fe(B);else if(!N&&_){B.off("blur",Ee),B.off("change",fe),B.off("swapDoc",fe),q.off(B.getInputField(),"compositionupdate",B.state.placeholderCompose),_e(B);var C=B.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}N&&!B.hasFocus()&&Ee(B)});function _e(B){B.state.placeholder&&(B.state.placeholder.parentNode.removeChild(B.state.placeholder),B.state.placeholder=null)}function me(B){_e(B);var N=B.state.placeholder=document.createElement("pre");N.style.cssText="height: 0; overflow: visible",N.style.direction=B.getOption("direction"),N.className="CodeMirror-placeholder CodeMirror-line-like";var A=B.getOption("placeholder");typeof A=="string"&&(A=document.createTextNode(A)),N.appendChild(A),B.display.lineSpace.insertBefore(N,B.display.lineSpace.firstChild)}function we(B){setTimeout(function(){var N=!1,A=B.getInputField();A.nodeName=="TEXTAREA"?N=!A.value:B.lineCount()==1&&(N=!/[^\u200b]/.test(A.querySelector(".CodeMirror-line").textContent)),N?me(B):_e(B)},20)}function Ee(B){Y(B)&&me(B)}function fe(B){var N=B.getWrapperElement(),A=Y(B);N.className=N.className.replace(" CodeMirror-empty","")+(A?" CodeMirror-empty":""),A?me(B):_e(B)}function Y(B){return B.lineCount()===1&&B.getLine(0)===""}})},"1eCo":function(rt,ue,l){(function(q){q(l("VrN/"))})(function(q){"use strict";var _e={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},me={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(we,Ee){var fe=we.indentUnit,Y={},B=Ee.htmlMode?_e:me;for(var N in B)Y[N]=B[N];for(var N in Ee)Y[N]=Ee[N];var A,_;function C(S,Q){function z(de){return Q.tokenize=de,de(S,Q)}var U=S.next();if(U=="<")return S.eat("!")?S.eat("[")?S.match("CDATA[")?z(w("atom","]]>")):null:S.match("--")?z(w("comment","-->")):S.match("DOCTYPE",!0,!0)?(S.eatWhile(/[\w\._\-]/),z(M(1))):null:S.eat("?")?(S.eatWhile(/[\w\._\-]/),Q.tokenize=w("meta","?>"),"meta"):(A=S.eat("/")?"closeTag":"openTag",Q.tokenize=O,"tag bracket");if(U=="&"){var K;return S.eat("#")?S.eat("x")?K=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):K=S.eatWhile(/[\d]/)&&S.eat(";"):K=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),K?"atom":"error"}else return S.eatWhile(/[^&<]/),null}C.isInText=!0;function O(S,Q){var z=S.next();if(z==">"||z=="/"&&S.eat(">"))return Q.tokenize=C,A=z==">"?"endTag":"selfcloseTag","tag bracket";if(z=="=")return A="equals",null;if(z=="<"){Q.tokenize=C,Q.state=L,Q.tagName=Q.tagStart=null;var U=Q.tokenize(S,Q);return U?U+" tag error":"tag error"}else return/[\'\"]/.test(z)?(Q.tokenize=x(z),Q.stringStartCol=S.column(),Q.tokenize(S,Q)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function x(S){var Q=function(z,U){for(;!z.eol();)if(z.next()==S){U.tokenize=O;break}return"string"};return Q.isInAttribute=!0,Q}function w(S,Q){return function(z,U){for(;!z.eol();){if(z.match(Q)){U.tokenize=C;break}z.next()}return S}}function M(S){return function(Q,z){for(var U;(U=Q.next())!=null;){if(U=="<")return z.tokenize=M(S+1),z.tokenize(Q,z);if(U==">")if(S==1){z.tokenize=C;break}else return z.tokenize=M(S-1),z.tokenize(Q,z)}return"meta"}}function m(S,Q,z){this.prev=S.context,this.tagName=Q,this.indent=S.indented,this.startOfLine=z,(Y.doNotIndent.hasOwnProperty(Q)||S.context&&S.context.noIndent)&&(this.noIndent=!0)}function v(S){S.context&&(S.context=S.context.prev)}function f(S,Q){for(var z;;){if(!S.context)return;if(z=S.context.tagName,!Y.contextGrabbers.hasOwnProperty(z)||!Y.contextGrabbers[z].hasOwnProperty(Q))return;v(S)}}function L(S,Q,z){return S=="openTag"?(z.tagStart=Q.column(),ee):S=="closeTag"?oe:L}function ee(S,Q,z){return S=="word"?(z.tagName=Q.current(),_="tag",se):Y.allowMissingTagName&&S=="endTag"?(_="tag bracket",se(S,Q,z)):(_="error",ee)}function oe(S,Q,z){if(S=="word"){var U=Q.current();return z.context&&z.context.tagName!=U&&Y.implicitlyClosed.hasOwnProperty(z.context.tagName)&&v(z),z.context&&z.context.tagName==U||Y.matchClosing===!1?(_="tag",F):(_="tag error",b)}else return Y.allowMissingTagName&&S=="endTag"?(_="tag bracket",F(S,Q,z)):(_="error",b)}function F(S,Q,z){return S!="endTag"?(_="error",F):(v(z),L)}function b(S,Q,z){return _="error",F(S,Q,z)}function se(S,Q,z){if(S=="word")return _="attribute",j;if(S=="endTag"||S=="selfcloseTag"){var U=z.tagName,K=z.tagStart;return z.tagName=z.tagStart=null,S=="selfcloseTag"||Y.autoSelfClosers.hasOwnProperty(U)?f(z,U):(f(z,U),z.context=new m(z,U,K==z.indented)),L}return _="error",se}function j(S,Q,z){return S=="equals"?re:(Y.allowMissing||(_="error"),se(S,Q,z))}function re(S,Q,z){return S=="string"?k:S=="word"&&Y.allowUnquoted?(_="string",se):(_="error",se(S,Q,z))}function k(S,Q,z){return S=="string"?k:se(S,Q,z)}return{startState:function(S){var Q={tokenize:C,state:L,indented:S||0,tagName:null,tagStart:null,context:null};return S!=null&&(Q.baseIndent=S),Q},token:function(S,Q){if(!Q.tagName&&S.sol()&&(Q.indented=S.indentation()),S.eatSpace())return null;A=null;var z=Q.tokenize(S,Q);return(z||A)&&z!="comment"&&(_=null,Q.state=Q.state(A||z,S,Q),_&&(z=_=="error"?z+" error":_)),z},indent:function(S,Q,z){var U=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+fe;if(U&&U.noIndent)return q.Pass;if(S.tokenize!=O&&S.tokenize!=C)return z?z.match(/^(\s*)/)[0].length:0;if(S.tagName)return Y.multilineTagIndentPastTag!==!1?S.tagStart+S.tagName.length+2:S.tagStart+fe*(Y.multilineTagIndentFactor||1);if(Y.alignCDATA&&/<!\[CDATA\[/.test(Q))return 0;var K=Q&&/^<(\/)?([\w_:\.-]*)/.exec(Q);if(K&&K[1])for(;U;)if(U.tagName==K[2]){U=U.prev;break}else if(Y.implicitlyClosed.hasOwnProperty(U.tagName))U=U.prev;else break;else if(K)for(;U;){var de=Y.contextGrabbers[U.tagName];if(de&&de.hasOwnProperty(K[2]))U=U.prev;else break}for(;U&&U.prev&&!U.startOfLine;)U=U.prev;return U?U.indent+fe:S.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:Y.htmlMode?"html":"xml",helperType:Y.htmlMode?"html":"xml",skipAttribute:function(S){S.state==re&&(S.state=se)},xmlCurrentTag:function(S){return S.tagName?{name:S.tagName,close:S.type=="closeTag"}:null},xmlCurrentContext:function(S){for(var Q=[],z=S.context;z;z=z.prev)z.tagName&&Q.push(z.tagName);return Q.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(rt,ue,l){"use strict";l.d(ue,"a",function(){return me});var q=l("JYp7"),_e=function(){function we(Ee){this.element=Ee,this.next=we.Undefined,this.prev=we.Undefined}return we.Undefined=new we(void 0),we}(),me=function(){function we(){this._first=_e.Undefined,this._last=_e.Undefined,this._size=0}return Object.defineProperty(we.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),we.prototype.isEmpty=function(){return this._first===_e.Undefined},we.prototype.clear=function(){this._first=_e.Undefined,this._last=_e.Undefined,this._size=0},we.prototype.unshift=function(Ee){return this._insert(Ee,!1)},we.prototype.push=function(Ee){return this._insert(Ee,!0)},we.prototype._insert=function(Ee,fe){var Y=this,B=new _e(Ee);if(this._first===_e.Undefined)this._first=B,this._last=B;else if(fe){var N=this._last;this._last=B,B.prev=N,N.next=B}else{var A=this._first;this._first=B,B.next=A,A.prev=B}this._size+=1;var _=!1;return function(){_||(_=!0,Y._remove(B))}},we.prototype.shift=function(){if(this._first===_e.Undefined)return;var Ee=this._first.element;return this._remove(this._first),Ee},we.prototype.pop=function(){if(this._last===_e.Undefined)return;var Ee=this._last.element;return this._remove(this._last),Ee},we.prototype._remove=function(Ee){if(Ee.prev!==_e.Undefined&&Ee.next!==_e.Undefined){var fe=Ee.prev;fe.next=Ee.next,Ee.next.prev=fe}else Ee.prev===_e.Undefined&&Ee.next===_e.Undefined?(this._first=_e.Undefined,this._last=_e.Undefined):Ee.next===_e.Undefined?(this._last=this._last.prev,this._last.next=_e.Undefined):Ee.prev===_e.Undefined&&(this._first=this._first.next,this._first.prev=_e.Undefined);this._size-=1},we.prototype.iterator=function(){var Ee,fe=this._first;return{next:function(){return fe===_e.Undefined?q.c:(Ee?Ee.value=fe.element:Ee={done:!1,value:fe.element},fe=fe.next,Ee)}}},we.prototype.toArray=function(){for(var Ee=[],fe=this._first;fe!==_e.Undefined;fe=fe.next)Ee.push(fe.element);return Ee},we}()},"2sxD":function(rt,ue,l){rt.exports={list:"list___3_VOx",head:"head___37dUf",name:"name___1VbnU",right:"right___gDdSx",body:"body___1wO_8",top:"top___cjRoo",bottom:"bottom___O44ku",l:"l___3de2t",ListGroup:"ListGroup___22jzr",a:"a___3Rx6Z",b:"b___S9Ybp",c:"c___3CVXw",c1:"c1___3b8Zq",radio:"radio___LnwQZ",d:"d___2-cs-"}},"51dB":function(rt,ue,l){rt.exports=l.p+"static/sc.c1696770.svg"},"5MlY":function(rt,ue,l){rt.exports=l.p+"static/sm.8ccb50bf.svg"},"6+eU":function(rt,ue,l){"use strict";l.d(ue,"a",function(){return F});var q=l("wx14"),_e=l("rePB"),me=l("VTBJ"),we=l("1OyB"),Ee=l("vuIU"),fe=l("Ji7U"),Y=l("LK+K"),B=l("q1tI"),N=l.n(B),A=l("TSYQ"),_=l.n(A),C=function(se){var j,re="".concat(se.rootPrefixCls,"-item"),k=_()(re,"".concat(re,"-").concat(se.page),(j={},Object(_e.a)(j,"".concat(re,"-active"),se.active),Object(_e.a)(j,se.className,!!se.className),Object(_e.a)(j,"".concat(re,"-disabled"),!se.page),j)),S=function(){se.onClick(se.page)},Q=function(U){se.onKeyPress(U,se.onClick,se.page)};return N.a.createElement("li",{title:se.showTitle?se.page:null,className:k,onClick:S,onKeyPress:Q,tabIndex:"0"},se.itemRender(se.page,"page",N.a.createElement("a",{rel:"nofollow"},se.page)))},O=C,x={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},w=function(b){Object(fe.a)(j,b);var se=Object(Y.a)(j);function j(){var re;Object(we.a)(this,j);for(var k=arguments.length,S=new Array(k),Q=0;Q<k;Q++)S[Q]=arguments[Q];return re=se.call.apply(se,[this].concat(S)),re.state={goInputText:""},re.buildOptionText=function(z){return"".concat(z," ").concat(re.props.locale.items_per_page)},re.changeSize=function(z){re.props.changeSize(Number(z))},re.handleChange=function(z){re.setState({goInputText:z.target.value})},re.handleBlur=function(z){var U=re.props,K=U.goButton,de=U.quickGo,J=U.rootPrefixCls,be=re.state.goInputText;if(K||be==="")return;if(z.relatedTarget&&(z.relatedTarget.className.indexOf("".concat(J,"-prev"))>=0||z.relatedTarget.className.indexOf("".concat(J,"-next"))>=0))return;re.setState({goInputText:""}),de(re.getValidValue())},re.go=function(z){var U=re.state.goInputText;if(U==="")return;(z.keyCode===x.ENTER||z.type==="click")&&(re.setState({goInputText:""}),re.props.quickGo(re.getValidValue()))},re}return Object(Ee.a)(j,[{key:"getValidValue",value:function(){var k=this.state,S=k.goInputText,Q=k.current;return!S||isNaN(S)?Q:Number(S)}},{key:"getPageSizeOptions",value:function(){var k=this.props,S=k.pageSize,Q=k.pageSizeOptions;return Q.some(function(z){return z.toString()===S.toString()})?Q:Q.concat([S.toString()]).sort(function(z,U){var K=isNaN(Number(z))?0:Number(z),de=isNaN(Number(U))?0:Number(U);return K-de})}},{key:"render",value:function(){var k=this,S=this.props,Q=S.pageSize,z=S.locale,U=S.rootPrefixCls,K=S.changeSize,de=S.quickGo,J=S.goButton,be=S.selectComponentClass,I=S.buildOptionText,y=S.selectPrefixCls,pe=S.disabled,Ue=this.state.goInputText,De="".concat(U,"-options"),nt=be,Ne=null,Pe=null,ae=null;if(!K&&!de)return null;var Z=this.getPageSizeOptions();if(K&&nt){var ye=Z.map(function(W,T){return N.a.createElement(nt.Option,{key:T,value:W.toString()},(I||k.buildOptionText)(W))});Ne=N.a.createElement(nt,{disabled:pe,prefixCls:y,showSearch:!1,className:"".concat(De,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(Q||Z[0]).toString(),onChange:this.changeSize,getPopupContainer:function(T){return T.parentNode}},ye)}return de&&(J&&(ae=typeof J=="boolean"?N.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:pe,className:"".concat(De,"-quick-jumper-button")},z.jump_to_confirm):N.a.createElement("span",{onClick:this.go,onKeyUp:this.go},J)),Pe=N.a.createElement("div",{className:"".concat(De,"-quick-jumper")},z.jump_to,N.a.createElement("input",{disabled:pe,type:"text",value:Ue,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),z.page,ae)),N.a.createElement("li",{className:"".concat(De)},Ne,Pe)}}]),j}(N.a.Component);w.defaultProps={pageSizeOptions:["10","20","50","100"]};var M=w,m=l("N2Kk");function v(){}function f(b){return typeof b=="number"&&isFinite(b)&&Math.floor(b)===b}function L(b,se,j){return j}function ee(b,se,j){var re=typeof b=="undefined"?se.pageSize:b;return Math.floor((j.total-1)/re)+1}var oe=function(b){Object(fe.a)(j,b);var se=Object(Y.a)(j);function j(re){var k;Object(we.a)(this,j),k=se.call(this,re),k.getJumpPrevPage=function(){return Math.max(1,k.state.current-(k.props.showLessItems?3:5))},k.getJumpNextPage=function(){return Math.min(ee(void 0,k.state,k.props),k.state.current+(k.props.showLessItems?3:5))},k.getItemIcon=function(K,de){var J=k.props.prefixCls,be=K||N.a.createElement("button",{type:"button","aria-label":de,className:"".concat(J,"-item-link")});return typeof K=="function"&&(be=N.a.createElement(K,Object(me.a)({},k.props))),be},k.savePaginationNode=function(K){k.paginationNode=K},k.isValid=function(K){return f(K)&&K!==k.state.current},k.shouldDisplayQuickJumper=function(){var K=k.props,de=K.showQuickJumper,J=K.pageSize,be=K.total;return be<=J?!1:de},k.handleKeyDown=function(K){(K.keyCode===x.ARROW_UP||K.keyCode===x.ARROW_DOWN)&&K.preventDefault()},k.handleKeyUp=function(K){var de=k.getValidValue(K),J=k.state.currentInputValue;de!==J&&k.setState({currentInputValue:de}),K.keyCode===x.ENTER?k.handleChange(de):K.keyCode===x.ARROW_UP?k.handleChange(de-1):K.keyCode===x.ARROW_DOWN&&k.handleChange(de+1)},k.changePageSize=function(K){var de=k.state.current,J=ee(K,k.state,k.props);de=de>J?J:de,J===0&&(de=k.state.current),typeof K=="number"&&("pageSize"in k.props||k.setState({pageSize:K}),"current"in k.props||k.setState({current:de,currentInputValue:de})),k.props.onShowSizeChange(de,K),"onChange"in k.props&&k.props.onChange&&k.props.onChange(de,K)},k.handleChange=function(K){var de=k.props.disabled,J=K;if(k.isValid(J)&&!de){var be=ee(void 0,k.state,k.props);J>be?J=be:J<1&&(J=1),"current"in k.props||k.setState({current:J,currentInputValue:J});var I=k.state.pageSize;return k.props.onChange(J,I),J}return k.state.current},k.prev=function(){k.hasPrev()&&k.handleChange(k.state.current-1)},k.next=function(){k.hasNext()&&k.handleChange(k.state.current+1)},k.jumpPrev=function(){k.handleChange(k.getJumpPrevPage())},k.jumpNext=function(){k.handleChange(k.getJumpNextPage())},k.hasPrev=function(){return k.state.current>1},k.hasNext=function(){return k.state.current<ee(void 0,k.state,k.props)},k.runIfEnter=function(K,de){if(K.key==="Enter"||K.charCode===13){for(var J=arguments.length,be=new Array(J>2?J-2:0),I=2;I<J;I++)be[I-2]=arguments[I];de.apply(void 0,be)}},k.runIfEnterPrev=function(K){k.runIfEnter(K,k.prev)},k.runIfEnterNext=function(K){k.runIfEnter(K,k.next)},k.runIfEnterJumpPrev=function(K){k.runIfEnter(K,k.jumpPrev)},k.runIfEnterJumpNext=function(K){k.runIfEnter(K,k.jumpNext)},k.handleGoTO=function(K){(K.keyCode===x.ENTER||K.type==="click")&&k.handleChange(k.state.currentInputValue)};var S=re.onChange!==v,Q="current"in re;Q&&!S&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var z=re.defaultCurrent;"current"in re&&(z=re.current);var U=re.defaultPageSize;return"pageSize"in re&&(U=re.pageSize),z=Math.min(z,ee(U,void 0,re)),k.state={current:z,currentInputValue:z,pageSize:U},k}return Object(Ee.a)(j,[{key:"componentDidUpdate",value:function(k,S){var Q=this.props.prefixCls;if(S.current!==this.state.current&&this.paginationNode){var z=this.paginationNode.querySelector(".".concat(Q,"-item-").concat(S.current));z&&document.activeElement===z&&z.blur()}}},{key:"getValidValue",value:function(k){var S=k.target.value,Q=ee(void 0,this.state,this.props),z=this.state.currentInputValue,U;return S===""?U=S:isNaN(Number(S))?U=z:S>=Q?U=Q:U=Number(S),U}},{key:"getShowSizeChanger",value:function(){var k=this.props,S=k.showSizeChanger,Q=k.total,z=k.totalBoundaryShowSizeChanger;return typeof S!="undefined"?S:Q>z}},{key:"renderPrev",value:function(k){var S=this.props,Q=S.prevIcon,z=S.itemRender,U=z(k,"prev",this.getItemIcon(Q,"prev page")),K=!this.hasPrev();return Object(B.isValidElement)(U)?Object(B.cloneElement)(U,{disabled:K}):U}},{key:"renderNext",value:function(k){var S=this.props,Q=S.nextIcon,z=S.itemRender,U=z(k,"next",this.getItemIcon(Q,"next page")),K=!this.hasNext();return Object(B.isValidElement)(U)?Object(B.cloneElement)(U,{disabled:K}):U}},{key:"render",value:function(){var k=this,S=this.props,Q=S.prefixCls,z=S.className,U=S.style,K=S.disabled,de=S.hideOnSinglePage,J=S.total,be=S.locale,I=S.showQuickJumper,y=S.showLessItems,pe=S.showTitle,Ue=S.showTotal,De=S.simple,nt=S.itemRender,Ne=S.showPrevNextJumpers,Pe=S.jumpPrevIcon,ae=S.jumpNextIcon,Z=S.selectComponentClass,ye=S.selectPrefixCls,W=S.pageSizeOptions,T=this.state,Ce=T.current,We=T.pageSize,Ze=T.currentInputValue;if(de===!0&&J<=We)return null;var Be=ee(void 0,this.state,this.props),H=[],G=null,he=null,ke=null,Me=null,Ge=null,et=I&&I.goButton,Ke=y?1:2,yt=Ce-1>0?Ce-1:0,ct=Ce+1<Be?Ce+1:Be,gt=Object.keys(this.props).reduce(function(P,D){return(D.substr(0,5)==="data-"||D.substr(0,5)==="aria-"||D==="role")&&(P[D]=k.props[D]),P},{});if(De)return et&&(typeof et=="boolean"?Ge=N.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},be.jump_to_confirm):Ge=N.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},et),Ge=N.a.createElement("li",{title:pe?"".concat(be.jump_to).concat(Ce,"/").concat(Be):null,className:"".concat(Q,"-simple-pager")},Ge)),N.a.createElement("ul",Object(q.a)({className:_()(Q,"".concat(Q,"-simple"),Object(_e.a)({},"".concat(Q,"-disabled"),K),z),style:U,ref:this.savePaginationNode},gt),N.a.createElement("li",{title:pe?be.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:_()("".concat(Q,"-prev"),Object(_e.a)({},"".concat(Q,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(yt)),N.a.createElement("li",{title:pe?"".concat(Ce,"/").concat(Be):null,className:"".concat(Q,"-simple-pager")},N.a.createElement("input",{type:"text",value:Ze,disabled:K,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),N.a.createElement("span",{className:"".concat(Q,"-slash")},"/"),Be),N.a.createElement("li",{title:pe?be.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:_()("".concat(Q,"-next"),Object(_e.a)({},"".concat(Q,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ct)),Ge);if(Be<=3+Ke*2){var st={locale:be,rootPrefixCls:Q,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:pe,itemRender:nt};Be||H.push(N.a.createElement(O,Object(q.a)({},st,{key:"noPager",page:Be,className:"".concat(Q,"-disabled")})));for(var Ot=1;Ot<=Be;Ot+=1){var xt=Ce===Ot;H.push(N.a.createElement(O,Object(q.a)({},st,{key:Ot,page:Ot,active:xt})))}}else{var wt=y?be.prev_3:be.prev_5,Le=y?be.next_3:be.next_5;Ne&&(G=N.a.createElement("li",{title:pe?wt:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:_()("".concat(Q,"-jump-prev"),Object(_e.a)({},"".concat(Q,"-jump-prev-custom-icon"),!!Pe))},nt(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(Pe,"prev page"))),he=N.a.createElement("li",{title:pe?Le:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:_()("".concat(Q,"-jump-next"),Object(_e.a)({},"".concat(Q,"-jump-next-custom-icon"),!!ae))},nt(this.getJumpNextPage(),"jump-next",this.getItemIcon(ae,"next page")))),Me=N.a.createElement(O,{locale:be,last:!0,rootPrefixCls:Q,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Be,page:Be,active:!1,showTitle:pe,itemRender:nt}),ke=N.a.createElement(O,{locale:be,rootPrefixCls:Q,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:pe,itemRender:nt});var ft=Math.max(1,Ce-Ke),At=Math.min(Ce+Ke,Be);Ce-1<=Ke&&(At=1+Ke*2),Be-Ce<=Ke&&(ft=Be-Ke*2);for(var He=ft;He<=At;He+=1){var Xe=Ce===He;H.push(N.a.createElement(O,{locale:be,rootPrefixCls:Q,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:Xe,showTitle:pe,itemRender:nt}))}Ce-1>=Ke*2&&Ce!==1+2&&(H[0]=Object(B.cloneElement)(H[0],{className:"".concat(Q,"-item-after-jump-prev")}),H.unshift(G)),Be-Ce>=Ke*2&&Ce!==Be-2&&(H[H.length-1]=Object(B.cloneElement)(H[H.length-1],{className:"".concat(Q,"-item-before-jump-next")}),H.push(he)),ft!==1&&H.unshift(ke),At!==Be&&H.push(Me)}var $=null;Ue&&($=N.a.createElement("li",{className:"".concat(Q,"-total-text")},Ue(J,[J===0?0:(Ce-1)*We+1,Ce*We>J?J:Ce*We])));var ne=!this.hasPrev()||!Be,ie=!this.hasNext()||!Be;return N.a.createElement("ul",Object(q.a)({className:_()(Q,z,Object(_e.a)({},"".concat(Q,"-disabled"),K)),style:U,unselectable:"unselectable",ref:this.savePaginationNode},gt),$,N.a.createElement("li",{title:pe?be.prev_page:null,onClick:this.prev,tabIndex:ne?null:0,onKeyPress:this.runIfEnterPrev,className:_()("".concat(Q,"-prev"),Object(_e.a)({},"".concat(Q,"-disabled"),ne)),"aria-disabled":ne},this.renderPrev(yt)),H,N.a.createElement("li",{title:pe?be.next_page:null,onClick:this.next,tabIndex:ie?null:0,onKeyPress:this.runIfEnterNext,className:_()("".concat(Q,"-next"),Object(_e.a)({},"".concat(Q,"-disabled"),ie)),"aria-disabled":ie},this.renderNext(ct)),N.a.createElement(M,{disabled:K,locale:be,rootPrefixCls:Q,selectComponentClass:Z,selectPrefixCls:ye,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ce,pageSize:We,pageSizeOptions:W,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:et}))}}],[{key:"getDerivedStateFromProps",value:function(k,S){var Q={};if("current"in k&&(Q.current=k.current,k.current!==S.current&&(Q.currentInputValue=Q.current)),"pageSize"in k&&k.pageSize!==S.pageSize){var z=S.current,U=ee(k.pageSize,S,k);z=z>U?U:z,"current"in k||(Q.current=z,Q.currentInputValue=z),Q.pageSize=k.pageSize}return Q}}]),j}(N.a.Component);oe.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:v,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:v,locale:m.a,style:{},itemRender:L,totalBoundaryShowSizeChanger:50};var F=oe},"6K3P":function(rt,ue,l){rt.exports=l.p+"static/jinshi.9b74f304.svg"},"746U":function(rt,ue,l){"use strict";l.d(ue,"d",function(){return _e}),l.d(ue,"j",function(){return me}),l.d(ue,"i",function(){return we}),l.d(ue,"h",function(){return Ee}),l.d(ue,"e",function(){return fe}),l.d(ue,"k",function(){return Y}),l.d(ue,"l",function(){return B}),l.d(ue,"a",function(){return N}),l.d(ue,"f",function(){return _}),l.d(ue,"g",function(){return C}),l.d(ue,"m",function(){return O}),l.d(ue,"c",function(){return M}),l.d(ue,"b",function(){return m}),l.d(ue,"n",function(){return v}),l.d(ue,"o",function(){return f});var q={number:"number",string:"string",undefined:"undefined",object:"object",function:"function"};function _e(L){return Array.isArray?Array.isArray(L):!!(L&&typeof L.length===q.number&&L.constructor===Array)}function me(L){return typeof L===q.string||L instanceof String}function we(L){return typeof L===q.object&&L!==null&&!Array.isArray(L)&&!(L instanceof RegExp)&&!(L instanceof Date)}function Ee(L){return(typeof L===q.number||L instanceof Number)&&!isNaN(L)}function fe(L){return L===!0||L===!1}function Y(L){return typeof L===q.undefined}function B(L){return Y(L)||L===null}function N(L,ee){if(!L)throw new Error(ee?"Unexpected type, expected '"+ee+"'":"Unexpected type")}var A=Object.prototype.hasOwnProperty;function _(L){if(!we(L))return!1;for(var ee in L)if(A.call(L,ee))return!1;return!0}function C(L){return typeof L===q.function}function O(L,ee){for(var oe=Math.min(L.length,ee.length),F=0;F<oe;F++)x(L[F],ee[F])}function x(L,ee){if(me(ee)){if(typeof L!==ee)throw new Error("argument does not match constraint: typeof "+ee)}else if(C(ee)){try{if(L instanceof ee)return}catch(oe){}if(!B(L)&&L.constructor===ee)return;if(ee.length===1&&ee.call(void 0,L)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function w(L){for(var ee=[],oe=Object.getPrototypeOf(L);Object.prototype!==oe;)ee=ee.concat(Object.getOwnPropertyNames(oe)),oe=Object.getPrototypeOf(oe);return ee}function M(L){for(var ee=[],oe=0,F=w(L);oe<F.length;oe++){var b=F[oe];typeof L[b]=="function"&&ee.push(b)}return ee}function m(L,ee){for(var oe=function(re){return function(){var k=Array.prototype.slice.call(arguments,0);return ee(re,k)}},F={},b=0,se=L;b<se.length;b++){var j=se[b];F[j]=oe(j)}return F}function v(L){return L===null?void 0:L}function f(L){return typeof L=="undefined"?null:L}},"7Cbv":function(rt,ue,l){"use strict";var q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),_e=new Uint8Array(16);function me(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(_e)}var we=/^(?:[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 Ee(O){return typeof O=="string"&&we.test(O)}for(var fe=Ee,Y=[],B=0;B<256;++B)Y.push((B+256).toString(16).substr(1));function N(O){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,w=(Y[O[x+0]]+Y[O[x+1]]+Y[O[x+2]]+Y[O[x+3]]+"-"+Y[O[x+4]]+Y[O[x+5]]+"-"+Y[O[x+6]]+Y[O[x+7]]+"-"+Y[O[x+8]]+Y[O[x+9]]+"-"+Y[O[x+10]]+Y[O[x+11]]+Y[O[x+12]]+Y[O[x+13]]+Y[O[x+14]]+Y[O[x+15]]).toLowerCase();if(!fe(w))throw TypeError("Stringified UUID is invalid");return w}var A=N;function _(O,x,w){O=O||{};var M=O.random||(O.rng||me)();if(M[6]=M[6]&15|64,M[8]=M[8]&63|128,x){w=w||0;for(var m=0;m<16;++m)x[w+m]=M[m];return x}return A(M)}var C=ue.a=_},"7ahc":function(rt,ue,l){"use strict";l.d(ue,"a",function(){return ee});var q=l("k1fw"),_e=l("0Owb"),me=l("+L6B"),we=l("2/Rp"),Ee=l("y8nQ"),fe=l("Vl3Y"),Y=l("tJVT"),B=l("OaEy"),N=l("2fM7"),A=l("q1tI"),_=l.n(A),C=l("VrN/"),O=l.n(C),x=l("p77/"),w=l.n(x),M=l("c5Ni"),m=l.n(M),v=N.a.Option,f={labelCol:{span:4},wrapperCol:{span:20}},L={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"]};ue.b=function(oe){var F=oe.callback,b=oe.onCancel,se=Object(A.useState)("python"),j=Object(Y.a)(se,2),re=j[0],k=j[1];function S(z){k(L[z][1])}function Q(z){F(z)}return _.a.createElement(fe.a,Object(_e.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Q}),_.a.createElement(fe.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},_.a.createElement(N.a,{onChange:S},Object.keys(L).map(function(z){return _.a.createElement(v,{key:z,value:z},L[z][0])}))),_.a.createElement(fe.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},_.a.createElement(ee,{mode:re})),_.a.createElement("div",{className:"flex-container flex-end"},_.a.createElement(we.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),_.a.createElement(we.a,{type:"ghost",onClick:b},"\u53D6\u6D88")))};function ee(oe){var F=oe.value,b=oe.onChange,se=oe.mode,j=oe.options,re=j===void 0?{}:j,k=Object(A.useRef)(),S=Object(A.useState)(),Q=Object(Y.a)(S,2),z=Q[0],U=Q[1];return Object(A.useEffect)(function(){if(z){function K(de){var J=de.getValue();b&&b(J)}return z.on("change",K),function(){z.off("change",K)}}},[z,b]),Object(A.useEffect)(function(){z&&z.setOption("mode",se)},[z,se]),Object(A.useEffect)(function(){z&&((F!==z.getValue()||F==="")&&setTimeout(function(){z.setValue(F||" ")},300))},[z,F]),Object(A.useEffect)(function(){if(k.current&&!z){var K=O.a.fromTextArea(k.current,Object(q.a)({mode:se,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},re));U(K)}},[k.current,z]),_.a.createElement("div",{className:"my-codemirror-container"},_.a.createElement("textarea",{ref:k}))}},"7ixt":function(rt,ue,l){"use strict";l.d(ue,"a",function(){return me});var q={adjustX:1,adjustY:1},_e=[0,0],me={left:{points:["cr","cl"],overflow:q,offset:[-4,0],targetOffset:_e},right:{points:["cl","cr"],overflow:q,offset:[4,0],targetOffset:_e},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:_e},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:_e},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:_e},leftTop:{points:["tr","tl"],overflow:q,offset:[-4,0],targetOffset:_e},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:_e},rightTop:{points:["tl","tr"],overflow:q,offset:[4,0],targetOffset:_e},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:_e},rightBottom:{points:["bl","br"],overflow:q,offset:[4,0],targetOffset:_e},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:_e},leftBottom:{points:["br","bl"],overflow:q,offset:[-4,0],targetOffset:_e}},we=me},"7qnI":function(rt,ue,l){"use strict";var q=l("5Dmo"),_e=l("3S7+"),me=l("fWQN"),we=l("mtLc"),Ee=l("yKVA"),fe=l("879j"),Y=l("5NDa"),B=l("5rEg"),N=l("q1tI"),A=l.n(N),_=l("O2Wb"),C=l.n(_),O=B.a.TextArea,x=function(w){Object(Ee.a)(m,w);var M=Object(fe.a)(m);function m(){return Object(me.a)(this,m),M.apply(this,arguments)}return Object(we.a)(m,[{key:"render",value:function(){var f=this,L=this.props,ee=L.index,oe=L.onAnswerChange,F=L.addChildAnswer,b=L.exerciseIsPublish,se=L.answers,j=L.activeOptionErrorIndex,re=L.flex,k=re===void 0?"0 0 1000px":re;return A.a.createElement("div",{className:C.a.flex},A.a.createElement("div",{className:"".concat(C.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",ee+1,"):"),A.a.createElement("div",{className:"".concat(C.a.flex," ").concat(C.a.flex1),style:{flexDirection:"column"}},se.map(function(S,Q){var z="".concat(ee,"-").concat(Q);return A.a.createElement("div",{className:"".concat(C.a.flex," ").concat(C.a.flex1),key:Q},A.a.createElement("div",{className:C.a.flex1,style:{flex:k}},A.a.createElement("div",null,A.a.createElement(O,{className:z===j?C.a.error:"",spellCheck:!1,rows:4,value:S||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(Q==0?"":"(\u53EF\u9009)"),onChange:function(K){return oe(ee,Q,K.target.value)},style:{minHeight:95}}))),!b&&A.a.createElement(A.a.Fragment,null,Q!=0&&A.a.createElement(_e.a,{title:"\u5220\u9664"},A.a.createElement("i",{className:"".concat(C.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return f.props.deleteChildAnswer(ee,Q)},style:{float:"right"}})),Q===0&&A.a.createElement(_e.a,{title:"\u5220\u9664"},A.a.createElement("i",{className:"".concat(C.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return f.props.deleteChildAnswermain(ee,Q)},style:{float:"right"}})),A.a.createElement(_e.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},A.a.createElement("i",{className:"".concat(C.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return F(ee)},style:{float:"right",visibility:Q==se.length-1?"":"hidden"}}))))})))}}]),m}(N.Component);ue.a=x},"815F":function(rt,ue,l){"use strict";l.d(ue,"e",function(){return Y}),l.d(ue,"c",function(){return N}),l.d(ue,"d",function(){return A}),l.d(ue,"a",function(){return C}),l.d(ue,"f",function(){return O}),l.d(ue,"b",function(){return x});var q=l("KQm4"),_e=l("VTBJ"),me=l("Ff2n"),we=l("Zm9Q"),Ee=l("Kwbf"),fe=l("OZM5");function Y(w,M){return w!=null?w:M}function B(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=new Map;function m(v){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(v||[]).forEach(function(L){var ee=L.key,oe=L.children;Object(Ee.a)(ee!=null,"Tree node must have a certain key: [".concat(f).concat(ee,"]"));var F=String(ee);Object(Ee.a)(!M.has(F)||ee===null||ee===void 0,"Same 'key' exist in the Tree: ".concat(F)),M.set(F,!0),m(oe,"".concat(f).concat(F," > "))})}m(w)}function N(w){function M(m){var v=Object(we.a)(m);return v.map(function(f){if(!Object(fe.i)(f))return Object(Ee.a)(!f,"Tree/TreeNode can only accept TreeNode as children."),null;var L=f.key,ee=f.props,oe=ee.children,F=Object(me.a)(ee,["children"]),b=Object(_e.a)({key:L},F),se=M(oe);return se.length&&(b.children=se),b}).filter(function(f){return f})}return M(w)}function A(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=new Set(M===!0?[]:M),v=[];function f(L){var ee=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return L.map(function(oe,F){var b=Object(fe.h)(ee?ee.pos:"0",F),se=Y(oe.key,b),j=Object(_e.a)(Object(_e.a)({},oe),{},{parent:ee,pos:b,children:null,data:oe,isStart:[].concat(Object(q.a)(ee?ee.isStart:[]),[F===0]),isEnd:[].concat(Object(q.a)(ee?ee.isEnd:[]),[F===L.length-1])});return v.push(j),M===!0||m.has(se)?j.children=f(oe.children||[],j):j.children=[],j})}return f(w),v}function _(w,M,m){var v;m?typeof m=="string"?v=function(ee){return ee[m]}:typeof m=="function"&&(v=function(ee){return m(ee)}):v=function(ee,oe){return Y(ee.key,oe)};function f(L,ee,oe){var F=L?L.children:w,b=L?Object(fe.h)(oe.pos,ee):"0";if(L){var se=v(L,b),j={node:L,index:ee,pos:b,key:se,parentPos:oe.node?oe.pos:null,level:oe.level+1};M(j)}F&&F.forEach(function(re,k){f(re,k,{node:L,pos:b,level:oe?oe.level+1:-1})})}f(null)}function C(w){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=M.initWrapper,v=M.processEntity,f=M.onProcessFinished,L=arguments.length>2?arguments[2]:void 0,ee={},oe={},F={posEntities:ee,keyEntities:oe};return m&&(F=m(F)||F),_(w,function(b){var se=b.node,j=b.index,re=b.pos,k=b.key,S=b.parentPos,Q=b.level,z={node:se,index:j,key:k,pos:re,level:Q},U=Y(k,re);ee[re]=z,oe[U]=z,z.parent=ee[S],z.parent&&(z.parent.children=z.parent.children||[],z.parent.children.push(z)),v&&v(z,F)},L),f&&f(F),F}function O(w,M){var m=M.expandedKeys,v=M.selectedKeys,f=M.loadedKeys,L=M.loadingKeys,ee=M.checkedKeys,oe=M.halfCheckedKeys,F=M.dragOverNodeKey,b=M.dropPosition,se=M.keyEntities,j=se[w],re={eventKey:w,expanded:m.indexOf(w)!==-1,selected:v.indexOf(w)!==-1,loaded:f.indexOf(w)!==-1,loading:L.indexOf(w)!==-1,checked:ee.indexOf(w)!==-1,halfChecked:oe.indexOf(w)!==-1,pos:String(j?j.pos:""),dragOver:F===w&&b===0,dragOverGapTop:F===w&&b===-1,dragOverGapBottom:F===w&&b===1};return re}function x(w){var M=w.data,m=w.expanded,v=w.selected,f=w.checked,L=w.loaded,ee=w.loading,oe=w.halfChecked,F=w.dragOver,b=w.dragOverGapTop,se=w.dragOverGapBottom,j=w.pos,re=w.active,k=Object(_e.a)(Object(_e.a)({},M),{},{expanded:m,selected:v,checked:f,loaded:L,loading:ee,halfChecked:oe,dragOver:F,dragOverGapTop:b,dragOverGapBottom:se,pos:j,active:re});return"props"in k||Object.defineProperty(k,"props",{get:function(){return Object(Ee.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),w}}),k}},"8EBN":function(rt,ue,l){(function(q){q(l("VrN/"))})(function(q){"use strict";q.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var _e=0;_e<q.modeInfo.length;_e++){var me=q.modeInfo[_e];me.mimes&&(me.mime=me.mimes[0])}q.findModeByMIME=function(we){we=we.toLowerCase();for(var Ee=0;Ee<q.modeInfo.length;Ee++){var fe=q.modeInfo[Ee];if(fe.mime==we)return fe;if(fe.mimes){for(var Y=0;Y<fe.mimes.length;Y++)if(fe.mimes[Y]==we)return fe}}if(/\+xml$/.test(we))return q.findModeByMIME("application/xml");if(/\+json$/.test(we))return q.findModeByMIME("application/json")},q.findModeByExtension=function(we){we=we.toLowerCase();for(var Ee=0;Ee<q.modeInfo.length;Ee++){var fe=q.modeInfo[Ee];if(fe.ext){for(var Y=0;Y<fe.ext.length;Y++)if(fe.ext[Y]==we)return fe}}},q.findModeByFileName=function(we){for(var Ee=0;Ee<q.modeInfo.length;Ee++){var fe=q.modeInfo[Ee];if(fe.file&&fe.file.test(we))return fe}var Y=we.lastIndexOf("."),B=Y>-1&&we.substring(Y+1,we.length);if(B)return q.findModeByExtension(B)},q.findModeByName=function(we){we=we.toLowerCase();for(var Ee=0;Ee<q.modeInfo.length;Ee++){var fe=q.modeInfo[Ee];if(fe.name.toLowerCase()==we)return fe;if(fe.alias){for(var Y=0;Y<fe.alias.length;Y++)if(fe.alias[Y].toLowerCase()==we)return fe}}}})},"8HAY":function(rt,ue,l){"use strict";l.d(ue,"a",function(){return fe}),l.d(ue,"b",function(){return Y});var q=l("pmY6"),_e=l("MI8n"),me=function(){var B=function(N,A){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,C){_.__proto__=C}||function(_,C){for(var O in C)C.hasOwnProperty(O)&&(_[O]=C[O])},B(N,A)};return function(N,A){B(N,A);function _(){this.constructor=N}N.prototype=A===null?Object.create(A):(_.prototype=A.prototype,new _)}}(),we=function(B,N,A,_){function C(O){return O instanceof A?O:new A(function(x){x(O)})}return new(A||(A=Promise))(function(O,x){function w(v){try{m(_.next(v))}catch(f){x(f)}}function M(v){try{m(_.throw(v))}catch(f){x(f)}}function m(v){v.done?O(v.value):C(v.value).then(w,M)}m((_=_.apply(B,N||[])).next())})},Ee=function(B,N){var A={label:0,sent:function(){if(O[0]&1)throw O[1];return O[1]},trys:[],ops:[]},_,C,O,x;return x={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function w(m){return function(v){return M([m,v])}}function M(m){if(_)throw new TypeError("Generator is already executing.");for(;A;)try{if(_=1,C&&(O=m[0]&2?C.return:m[0]?C.throw||((O=C.return)&&O.call(C),0):C.next)&&!(O=O.call(C,m[1])).done)return O;(C=0,O)&&(m=[m[0]&2,O.value]);switch(m[0]){case 0:case 1:O=m;break;case 4:return A.label++,{value:m[1],done:!1};case 5:A.label++,C=m[1],m=[0];continue;case 7:m=A.ops.pop(),A.trys.pop();continue;default:if(!(O=A.trys,O=O.length>0&&O[O.length-1])&&(m[0]===6||m[0]===2)){A=0;continue}if(m[0]===3&&(!O||m[1]>O[0]&&m[1]<O[3])){A.label=m[1];break}if(m[0]===6&&A.label<O[1]){A.label=O[1],O=m;break}if(O&&A.label<O[2]){A.label=O[2],A.ops.push(m);break}O[2]&&A.ops.pop(),A.trys.pop();continue}m=N.call(B,A)}catch(v){m=[6,v],C=0}finally{_=O=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},fe=function(B){me(N,B);function N(A,_,C,O,x){_===void 0&&(_=""),C===void 0&&(C=""),O===void 0&&(O=!0);var w=B.call(this)||this;return w._onDidChange=w._register(new _e.a),w.onDidChange=w._onDidChange.event,w._enabled=!0,w._checked=!1,w._id=A,w._label=_,w._cssClass=C,w._enabled=O,w._actionCallback=x,w}return Object.defineProperty(N.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(N.prototype,"label",{get:function(){return this._label},set:function(A){this._setLabel(A)},enumerable:!0,configurable:!0}),N.prototype._setLabel=function(A){this._label!==A&&(this._label=A,this._onDidChange.fire({label:A}))},Object.defineProperty(N.prototype,"tooltip",{get:function(){return this._tooltip||""},set:function(A){this._setTooltip(A)},enumerable:!0,configurable:!0}),N.prototype._setTooltip=function(A){this._tooltip!==A&&(this._tooltip=A,this._onDidChange.fire({tooltip:A}))},Object.defineProperty(N.prototype,"class",{get:function(){return this._cssClass},set:function(A){this._setClass(A)},enumerable:!0,configurable:!0}),N.prototype._setClass=function(A){this._cssClass!==A&&(this._cssClass=A,this._onDidChange.fire({class:A}))},Object.defineProperty(N.prototype,"enabled",{get:function(){return this._enabled},set:function(A){this._setEnabled(A)},enumerable:!0,configurable:!0}),N.prototype._setEnabled=function(A){this._enabled!==A&&(this._enabled=A,this._onDidChange.fire({enabled:A}))},Object.defineProperty(N.prototype,"checked",{get:function(){return this._checked},set:function(A){this._setChecked(A)},enumerable:!0,configurable:!0}),N.prototype._setChecked=function(A){this._checked!==A&&(this._checked=A,this._onDidChange.fire({checked:A}))},N.prototype.run=function(A,_){return this._actionCallback?this._actionCallback(A):Promise.resolve(!0)},N}(q.a),Y=function(B){me(N,B);function N(){var A=B!==null&&B.apply(this,arguments)||this;return A._onDidBeforeRun=A._register(new _e.a),A.onDidBeforeRun=A._onDidBeforeRun.event,A._onDidRun=A._register(new _e.a),A.onDidRun=A._onDidRun.event,A}return N.prototype.run=function(A,_){return we(this,void 0,void 0,function(){var C,O;return Ee(this,function(x){switch(x.label){case 0:if(!A.enabled)return[2,Promise.resolve(null)];this._onDidBeforeRun.fire({action:A}),x.label=1;case 1:return x.trys.push([1,3,,4]),[4,this.runAction(A,_)];case 2:return C=x.sent(),this._onDidRun.fire({action:A,result:C}),[3,4];case 3:return O=x.sent(),this._onDidRun.fire({action:A,error:O}),[3,4];case 4:return[2]}})})},N.prototype.runAction=function(A,_){var C=_?A.run(_):A.run();return Promise.resolve(C)},N}(q.a)},"8hTe":function(rt,ue,l){rt.exports={button:"button___1wy9m"}},"9Bee":function(rt,ue,l){"use strict";var q=l("DYRE"),_e=l("zeV3"),me=l("+L6B"),we=l("2/Rp"),Ee=l("k1fw"),fe=l("9og8"),Y=l("tJVT"),B=l("WmNS"),N=l.n(B),A=l("q1tI"),_=l.n(A),C=l("vg9a"),O=l("DlQD"),x=l.n(O),w=l("rUJ1");function M(u,o){var a=u.match(/^(\s+)(?:```)/);if(a===null)return o;var c=a[1];return o.split(`
`).map(function(p){var h=p.match(/^\s+/);if(h===null)return p;var ce=Object(Y.a)(h,1),tt=ce[0];return tt.length>=c.length?p.slice(c.length):p}).join(`
`)}var m=[],v=["<ul>"],f=new x.a.Renderer,L=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function ee(){m.length=0,v=["<ul>"]}var oe={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function F(u,o,a,c){if(o>=u.length||u[o].level<=a)return o;var p=u[o];c.push("<li><a href='#"+p.anchor+"'>"+p.text+"</a>"),o++;var h=[];return o=F(u,o,p.level,h),h.length>0&&(c.push("<ul>"),h.forEach(function(ce){c.push(ce)}),c.push("</ul>")),c.push("</li>"),o=F(u,o,a,c),o}function b(){return F(m,0,0,v),v.push("</ul>"),v.join("")}var se={heading:function(o){var a=L.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 c=a[0],p=M(c,a[3]||""),h=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(h)>=0){var ce=k(),tt=p;p=ce,S[ce]={type:"block",expression:tt}}return{type:"code",raw:c,lang:h,text:p}}}},j=/(?:\${2})([^\n`]+?)(?:\${2})/gi,re=0,k=function(){return"__special_katext_id_".concat(re++,"__")},S={};function Q(){return S}function z(){re=0,S={}}function U(u){return u=u.replace(j,function(o,a){var c=k();return S[c]={type:"inline",expression:a},c}),u}var K=f.listitem;f.listitem=function(u){return K(U(u))};var de=f.paragraph;f.paragraph=function(u){return de(U(u))};var J=f.tablecell;f.tablecell=function(u,o){return J(U(u),o)},f.code=function(u,o,a){var c=(o||"").match(/\S*/)[0];return c?["latex","katex","math"].indexOf(c)>=0?"<p class='editormd-tex'>".concat(u,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?u:Object(w.escape)(u,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?u:Object(w.escape)(u,!0))+"</code></pre>"},f.heading=function(u,o,a){var c=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:c,level:o,text:u}),"<h"+o+' id="'+c+'">'+u+"</h"+o+">"},x.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),x.a.use({tokenizer:se,renderer:f});var be=x.a,I=l("SJMd"),y=l("ulZh"),pe=l.n(y),Ue=l("m3rI"),De=l("Oy/b"),nt=l("p5ED"),Ne=l("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Pe=function(u,o){return(Pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(a[p]=c[p])})(u,o)};function ae(u,o){function a(){this.constructor=u}Pe(u,o),u.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Z(u,o,a,c){return new(a||(a=Promise))(function(p,h){function ce(It){try{ht(c.next(It))}catch(Re){h(Re)}}function tt(It){try{ht(c.throw(It))}catch(Re){h(Re)}}function ht(It){var Re;It.done?p(It.value):(Re=It.value,Re instanceof a?Re:new a(function(ge){ge(Re)})).then(ce,tt)}ht((c=c.apply(u,o||[])).next())})}function ye(u,o){var a,c,p,h,ce={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return h={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function tt(ht){return function(It){return function(Re){if(a)throw new TypeError("Generator is already executing.");for(;ce;)try{if(a=1,c&&(p=2&Re[0]?c.return:Re[0]?c.throw||((p=c.return)&&p.call(c),0):c.next)&&!(p=p.call(c,Re[1])).done)return p;switch(c=0,p&&(Re=[2&Re[0],p.value]),Re[0]){case 0:case 1:p=Re;break;case 4:return ce.label++,{value:Re[1],done:!1};case 5:ce.label++,c=Re[1],Re=[0];continue;case 7:Re=ce.ops.pop(),ce.trys.pop();continue;default:if(!(p=ce.trys,(p=p.length>0&&p[p.length-1])||Re[0]!==6&&Re[0]!==2)){ce=0;continue}if(Re[0]===3&&(!p||Re[1]>p[0]&&Re[1]<p[3])){ce.label=Re[1];break}if(Re[0]===6&&ce.label<p[1]){ce.label=p[1],p=Re;break}if(p&&ce.label<p[2]){ce.label=p[2],ce.ops.push(Re);break}p[2]&&ce.ops.pop(),ce.trys.pop();continue}Re=o.call(u,ce)}catch(ge){Re=[6,ge],c=0}finally{a=p=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([ht,It])}}}function W(){for(var u=0,o=0,a=arguments.length;o<a;o++)u+=arguments[o].length;var c=Array(u),p=0;for(o=0;o<a;o++)for(var h=arguments[o],ce=0,tt=h.length;ce<tt;ce++,p++)c[p]=h[ce];return c}var T=function(){function u(){}return u.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},u.setAttributes=function(o,a){for(var c=0,p=a;c<p.length;c++){var h=p[c],ce=h[0],tt=h[1];o.setAttribute(ce,tt)}},u.createRect=function(o,a,c){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),c&&u.setAttributes(p,c),p},u.createLine=function(o,a,c,p,h){var ce=document.createElementNS("http://www.w3.org/2000/svg","line");return ce.setAttribute("x1",o.toString()),ce.setAttribute("y1",a.toString()),ce.setAttribute("x2",c.toString()),ce.setAttribute("y2",p.toString()),h&&u.setAttributes(ce,h),ce},u.createPolygon=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","polygon");return c.setAttribute("points",o),a&&u.setAttributes(c,a),c},u.createCircle=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","circle");return c.setAttribute("cx",(o/2).toString()),c.setAttribute("cy",(o/2).toString()),c.setAttribute("r",o.toString()),a&&u.setAttributes(c,a),c},u.createEllipse=function(o,a,c){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()),c&&u.setAttributes(p,c),p},u.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&u.setAttributes(a,o),a},u.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},u.createMarker=function(o,a,c,p,h,ce,tt){var ht=document.createElementNS("http://www.w3.org/2000/svg","marker");return u.setAttributes(ht,[["id",o],["orient",a],["markerWidth",c.toString()],["markerHeight",p.toString()],["refX",h.toString()],["refY",ce.toString()]]),ht.appendChild(tt),ht},u.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&u.setAttributes(a,o),a},u.createTSpan=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","tspan");return c.textContent=o,a&&u.setAttributes(c,a),c},u.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&u.setAttributes(a,o),a},u.createPoint=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return c.x=o,c.y=a,c},u.createPath=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",o),a&&u.setAttributes(c,a),c},u}(),Ce=function(){function u(){}return u.addKey=function(o){u.key=o},Object.defineProperty(u,"isLicensed",{get:function(){return!!u.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(u.key)},enumerable:!1,configurable:!0}),u}(),We=function(){function u(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return u.prototype.rasterize=function(o,a,c){var p=this;return new Promise(function(h){var ce=c!==void 0?c:document.createElement("canvas");o===null&&(p.markersOnly=!0,p.naturalSize=!1);var tt=document.createElementNS("http://www.w3.org/2000/svg","svg");tt.setAttribute("xmlns","http://www.w3.org/2000/svg"),tt.setAttribute("width",a.width.baseVal.valueAsString),tt.setAttribute("height",a.height.baseVal.valueAsString),tt.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),tt.innerHTML=a.innerHTML,p.naturalSize===!0?(tt.width.baseVal.value=o.naturalWidth,tt.height.baseVal.value=o.naturalHeight):p.width!==void 0&&p.height!==void 0&&(tt.width.baseVal.value=p.width,tt.height.baseVal.value=p.height),ce.width=tt.width.baseVal.value,ce.height=tt.height.baseVal.value;var ht=tt.outerHTML,It=ce.getContext("2d");p.markersOnly!==!0&&It.drawImage(o,0,0,ce.width,ce.height);var Re=window.URL,ge=new Image(ce.width,ce.height);ge.setAttribute("crossOrigin","anonymous");var qe=new Blob([ht],{type:"image/svg+xml"}),Lt=Re.createObjectURL(qe);ge.onload=function(){It.drawImage(ge,0,0),Re.revokeObjectURL(Lt);var Pt=ce.toDataURL(p.imageType,p.imageQuality);h(Pt)},ge.src=Lt})},u}(),Ze=function(){},Be=function(){function u(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(u.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(u.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(u.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),u.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},u.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)},u.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 H("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new H("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new H("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new G("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new G("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},u.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},u}(),H=function(u,o){this.selector=u,this.style=o},G=function(u,o){this.localName=u,this.style=o},he=function(){function u(o,a,c,p,h){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=c,this.uiStyleSettings=p,this.styles=h,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return u.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 c=document.createElement("div");c.className=this.toolbarBlockStyleClass.name,c.style.whiteSpace="nowrap",this.uiContainer.appendChild(c),this.addActionButton(c,'<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(c,'<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(c,'<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(c,'<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(c,'<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(c,'<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(c,'<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(c,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(h){var ce=document.createElement("div");ce.className=""+a.toolbarButtonStyleClass.name,ce.setAttribute("data-type-name",h.typeName),ce.innerHTML=h.icon,ce.addEventListener("click",function(){a.markerToolbarButtonClicked(ce,h)}),a.buttons.push(ce),a.markerButtons.push(ce)}),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()},u.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},u.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},u.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},u.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]))}},u.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")},u.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)})},u.prototype.addActionButton=function(o,a,c){var p=this,h=document.createElement("div");switch(h.className=""+this.toolbarButtonStyleClass.name,h.innerHTML=a,h.setAttribute("data-action",c),h.addEventListener("click",function(){p.actionToolbarButtonClicked(h,c)}),c){case"select":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":h.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":h.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":h.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":h.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(h),this.buttons.push(h)},u.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new G("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new G("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new G("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new G("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new G("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new G("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*o)+`px;
padding: `+o+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new G("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new G("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new H("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new H("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},u.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(c){return c("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},u.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(c){return c("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},u.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)},u.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(c){return c.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},u.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(c){return/delete|notes/.test(c.getAttribute("data-action"))}).forEach(function(c){a.currentMarker===void 0?(c.style.fillOpacity="0.4",c.style.pointerEvents="none"):(c.style.fillOpacity="1",c.style.pointerEvents="all")})},u}(),ke=function(){function u(o,a,c,p){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=c,this.styles=p,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return u.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new G("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new G("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new G("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new G("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new G("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new G("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new G("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*a)+`px;
padding: `+a+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new G("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new G("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new H("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new H("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},u.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)},u.prototype.setPanelButtons=function(o){var a,c,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+" "+((c=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&c!==void 0?c:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(h){var ce;h.uiStyleSettings=p.uiStyleSettings;var tt=document.createElement("div");tt.className=p.toolboxButtonStyleClass.name+" "+((ce=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ce!==void 0?ce:p.toolboxButtonStyleColorsClass.name),tt.innerHTML=h.icon,tt.title=h.title,tt.addEventListener("click",function(){p.panelButtonClick(h)}),p.panelButtons.push(tt),p.buttonRow.appendChild(tt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},u.prototype.panelButtonClick=function(o){var a=this,c=-1;if(o!==this.activePanel){c=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(h,ce){var tt,ht;h.className=a.toolboxButtonStyleClass.name+" "+(ce===c?""+((tt=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&tt!==void 0?tt:a.toolboxActiveButtonStyleColorsClass.name):""+((ht=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ht!==void 0?ht:a.toolboxButtonStyleColorsClass.name))})},u}(),Me=function(u,o){this.title=u,this.icon=o},Ge=function(u){function o(a,c,p,h){var ce=u.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return ce.colors=[],ce.addTransparent=!1,ce.colorBoxes=[],ce.colors=c,ce.currentColor=p,ce.setCurrentColor=ce.setCurrentColor.bind(ce),ce.getColorBox=ce.getColorBox.bind(ce),ce}return ae(o,u),o.prototype.getUi=function(){var a=this,c=document.createElement("div");return c.style.overflow="hidden",c.style.whiteSpace="nowrap",this.colors.forEach(function(p){var h=a.getColorBox(p);c.appendChild(h),a.colorBoxes.push(h)}),c},o.prototype.getColorBox=function(a){var c=this,p=this.uiStyleSettings.toolbarHeight/4,h=this.uiStyleSettings.toolbarHeight-p,ce=document.createElement("div");ce.style.display="inline-block",ce.style.boxSizing="content-box",ce.style.width=h-2+"px",ce.style.height=h-2+"px",ce.style.padding="1px",ce.style.marginRight="2px",ce.style.marginBottom="2px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderRadius=(h+2)/2+"px",ce.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){c.setCurrentColor(a,ce)});var tt=document.createElement("div");return tt.style.display="inline-block",tt.style.width=h-2+"px",tt.style.height=h-2+"px",tt.style.backgroundColor=a,tt.style.borderRadius=h/2+"px",a==="transparent"&&(tt.style.fill=this.uiStyleSettings.toolboxAccentColor,tt.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>`),ce.appendChild(tt),ce},o.prototype.setCurrentColor=function(a,c){var p=this;this.currentColor=a,this.colorBoxes.forEach(function(h){h.style.borderColor=h===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(Me),et=function(){function u(o,a,c){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=c,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(u.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(o){return!1},Object.defineProperty(u.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),u.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},u.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},u.prototype.pointerDown=function(o,a){},u.prototype.dblClick=function(o,a){},u.prototype.manipulate=function(o){},u.prototype.pointerUp=function(o){this.stateChanged()},u.prototype.dispose=function(){},u.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},u.prototype.getState=function(){return{typeName:u.typeName,state:this.state,notes:this.notes}},u.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},u.prototype.scale=function(o,a){},u.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},u.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},u.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)}},u.typeName="MarkerBase",u}(),Ke=function(){function u(){this.findGripByVisual=this.findGripByVisual.bind(this)}return u.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},u}(),yt=function(){function u(){this.GRIP_SIZE=10,this.visual=T.createGroup(),this.visual.appendChild(T.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(T.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return u.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},u}(),ct=function(){function u(){}return u.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},u.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},u}(),gt=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.left=0,h.top=0,h.width=0,h.height=0,h.defaultSize={x:50,y:20},h.offsetX=0,h.offsetY=0,h.rotationAngle=0,h.CB_DISTANCE=10,h._suppressMarkerCreateEvent=!1,h.container.transform.baseVal.appendItem(T.createTransform()),h.setupControlBox(),h}return ae(o,u),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 c=T.createTransform();this._visual.transform.baseVal.appendItem(c)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!u.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,c){u.prototype.pointerDown.call(this,a,c),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(c),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(c)){this.activeGrip=this.rotatorGrip;var h=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=h.x-this.width/2,this.top=h.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ce=this.container.transform.baseVal.getItem(0);ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var c=this.state;u.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",c==="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 c=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(c.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(c.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(c):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var c=this.manipulationStartLeft,p=this.manipulationStartWidth,h=this.manipulationStartTop,ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:c=this.manipulationStartLeft+a.x-this.manipulationStartX,p=this.manipulationStartWidth+this.manipulationStartLeft-c;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:h=this.manipulationStartTop+a.y-this.manipulationStartY,ce=this.manipulationStartHeight+this.manipulationStartTop-h;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ce=this.manipulationStartHeight+a.y-this.manipulationStartY}p>=0?(this.left=c,this.width=p):(this.left=c+p,this.width=-p),ce>=0?(this.top=h,this.height=ce):(this.top=h+ce,this.height=-ce),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 c=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*c,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 c=this.container.getCTM(),p=T.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(c)).x,y:p.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var c=this.container.getCTM();c=c.inverse();var p=T.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(c)).x,y:p.y}},o.prototype.select=function(){u.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){u.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=T.createGroup();var a=T.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=T.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=T.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 Ke,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 yt;return a.visual.transform.baseVal.appendItem(T.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,c=-a/2,p=c,h=(this.width+this.CB_DISTANCE)/2-a/2,ce=(this.height+this.CB_DISTANCE)/2-a/2,tt=this.height+this.CB_DISTANCE-a/2,ht=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,c,p),this.positionGrip(this.controlGrips.topCenter.visual,h,p),this.positionGrip(this.controlGrips.topRight.visual,ht,p),this.positionGrip(this.controlGrips.centerLeft.visual,c,ce),this.positionGrip(this.controlGrips.centerRight.visual,ht,ce),this.positionGrip(this.controlGrips.bottomLeft.visual,c,tt),this.positionGrip(this.controlGrips.bottomCenter.visual,h,tt),this.positionGrip(this.controlGrips.bottomRight.visual,ht,tt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,h,p-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,c,p){var h=a.transform.baseVal.getItem(0);h.setTranslate(c,p),a.transform.baseVal.replaceItem(h,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ct.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ct.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},u.prototype.getState.call(this))},o.prototype.restoreState=function(a){u.prototype.restoreState.call(this,a);var c=a;this.left=c.left,this.top=c.top,this.width=c.width,this.height=c.height,this.rotationAngle=c.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ct.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,c.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ct.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,c.containerTransformMatrix))},o.prototype.scale=function(a,c){u.prototype.scale.call(this,a,c);var p=this.rotatePoint({x:this.left,y:this.top}),h=this.unrotatePoint({x:p.x*a,y:p.y*c});this.left=h.x,this.top=h.y,this.width=this.width*a,this.height=this.height*c,this.adjustControlBox()},o}(et),st=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.createVisual=h.createVisual.bind(h),h}return ae(o,u),o.prototype.ownsTarget=function(a){return!(!u.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=T.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,c){u.prototype.pointerDown.call(this,a,c),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){u.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){u.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){u.prototype.setSize.call(this),T.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){u.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&T.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&T.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&T.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&T.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},u.prototype.getState.call(this))},o.prototype.restoreState=function(a){var c=a;this.fillColor=c.fillColor,this.strokeColor=c.strokeColor,this.strokeWidth=c.strokeWidth,this.strokeDasharray=c.strokeDasharray,this.opacity=c.opacity,this.createVisual(),u.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,c){u.prototype.scale.call(this,a,c),this.setSize()},o.title="Rectangle marker",o}(gt),Ot=function(u){function o(a,c,p,h){var ce=u.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ce.widths=[],ce.widthBoxes=[],ce.widths=c,ce.currentWidth=p,ce.setCurrentWidth=ce.setCurrentWidth.bind(ce),ce}return ae(o,u),o.prototype.getUi=function(){var a=this,c=document.createElement("div");return c.style.display="flex",c.style.overflow="hidden",c.style.flexGrow="2",this.widths.forEach(function(p){var h=document.createElement("div");h.style.display="flex",h.style.flexGrow="2",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=p===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentWidth(p,h)}),c.appendChild(h);var ce=document.createElement("div");ce.innerText=p.toString(),ce.style.marginRight="5px",h.appendChild(ce);var tt=document.createElement("div");tt.style.minHeight="20px",tt.style.flexGrow="2",tt.style.display="flex",tt.style.alignItems="center";var ht=document.createElement("hr");ht.style.minWidth="20px",ht.style.border="0px",ht.style.borderTop=p+"px solid "+a.uiStyleSettings.toolboxColor,ht.style.flexGrow="2",tt.appendChild(ht),h.appendChild(tt),a.widthBoxes.push(h)}),c},o.prototype.setCurrentWidth=function(a,c){var p=this;this.currentWidth=a,this.widthBoxes.forEach(function(h){h.style.borderColor=h===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(Me),xt=function(u){function o(a,c,p,h){var ce=u.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return ce.styles=[],ce.styleBoxes=[],ce.styles=c,ce.currentStyle=p,ce.setCurrentStyle=ce.setCurrentStyle.bind(ce),ce}return ae(o,u),o.prototype.getUi=function(){var a=this,c=document.createElement("div");return c.style.display="flex",c.style.overflow="hidden",c.style.flexGrow="2",this.styles.forEach(function(p){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.styles.length-5+"%",h.style.borderColor=p===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentStyle(p,h)}),c.appendChild(h);var ce=document.createElement("div");ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.overflow="hidden";var tt=`<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>`;ce.innerHTML=tt,h.appendChild(ce),a.styleBoxes.push(h)}),c},o.prototype.setCurrentStyle=function(a,c){var p=this;this.currentStyle=a,this.styleBoxes.forEach(function(h){h.style.borderColor=h===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(Me),wt=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.strokeColor=p.defaultColor,h.strokeWidth=p.defaultStrokeWidth,h.strokeDasharray=p.defaultStrokeDasharray,h.strokePanel=new Ge("Line color",p.defaultColorSet,p.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new Ot("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new xt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ae(o,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=u.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}(st),Le=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},ft=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.x1=0,h.y1=0,h.x2=0,h.y2=0,h.defaultLength=50,h.manipulationStartX=0,h.manipulationStartY=0,h.manipulationStartX1=0,h.manipulationStartY1=0,h.manipulationStartX2=0,h.manipulationStartY2=0,h.setupControlBox(),h}return ae(o,u),o.prototype.ownsTarget=function(a){return!!u.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,c){u.prototype.pointerDown.call(this,a,c),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(c)?this.activeGrip=this.grip1:this.grip2.ownsTarget(c)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var c=this.state;u.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",c==="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(){u.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){u.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=T.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 yt;return a.visual.transform.baseVal.appendItem(T.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,c,p){var h=a.transform.baseVal.getItem(0);h.setTranslate(c,p),a.transform.baseVal.replaceItem(h,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},u.prototype.getState.call(this))},o.prototype.restoreState=function(a){u.prototype.restoreState.call(this,a);var c=a;this.x1=c.x1,this.y1=c.y1,this.x2=c.x2,this.y2=c.y2},o.prototype.scale=function(a,c){u.prototype.scale.call(this,a,c),this.x1=this.x1*a,this.y1=this.y1*c,this.x2=this.x2*a,this.y2=this.y2*c,this.adjustVisual(),this.adjustControlBox()},o}(et),At=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.strokeColor=p.defaultColor,h.strokeWidth=p.defaultStrokeWidth,h.strokeDasharray=p.defaultStrokeDasharray,h.strokePanel=new Ge("Line color",p.defaultColorSet,p.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new Ot("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new xt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ae(o,u),o.prototype.ownsTarget=function(a){return!(!u.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=T.createGroup(),this.selectorLine=T.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=T.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,c){u.prototype.pointerDown.call(this,a,c),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()),T.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),T.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),T.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},u.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){u.prototype.restoreState.call(this,a);var c=a;this.strokeColor=c.strokeColor,this.strokeWidth=c.strokeWidth,this.strokeDasharray=c.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}(ft),He=function(u){function o(a,c,p,h){var ce=u.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return ce.fonts=[],ce.fontBoxes=[],ce.fonts=c,ce.currentFont=p,ce.setCurrentFont=ce.setCurrentFont.bind(ce),ce}return ae(o,u),o.prototype.getUi=function(){var a=this,c=document.createElement("div");return c.style.overflow="hidden",c.style.flexGrow="2",this.fonts.forEach(function(p){var h=document.createElement("div");h.style.display="inline-block",h.style.alignItems="center",h.style.justifyContent="space-between",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.overflow="hidden",h.style.maxWidth=100/a.fonts.length-5+"%",h.style.borderColor=p===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentFont(p,h)}),c.appendChild(h);var ce=document.createElement("div");ce.style.display="flex",ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.fontFamily=p,ce.style.overflow="hidden";var tt=document.createElement("div");tt.style.whiteSpace="nowrap",tt.style.overflow="hidden",tt.style.textOverflow="ellipsis",tt.innerHTML="The quick brown fox jumps over the lazy dog",ce.appendChild(tt),h.appendChild(ce),a.fontBoxes.push(h)}),c},o.prototype.setCurrentFont=function(a,c){var p=this;this.currentFont=a,this.fontBoxes.forEach(function(h){h.style.borderColor=h===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(Me),Xe=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.color="transparent",h.padding=5,h.DEFAULT_TEXT="your text here",h.text=h.DEFAULT_TEXT,h.isMoved=!1,h.color=p.defaultColor,h.fontFamily=p.defaultFontFamily,h.defaultSize={x:100,y:30},h.setColor=h.setColor.bind(h),h.setFont=h.setFont.bind(h),h.renderText=h.renderText.bind(h),h.sizeText=h.sizeText.bind(h),h.textEditDivClicked=h.textEditDivClicked.bind(h),h.showTextEditor=h.showTextEditor.bind(h),h.setSize=h.setSize.bind(h),h.positionTextEditor=h.positionTextEditor.bind(h),h.colorPanel=new Ge("Color",p.defaultColorSet,p.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.fontFamilyPanel=new He("Font",p.defaultFontFamilies,p.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h}return ae(o,u),o.prototype.ownsTarget=function(a){if(u.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var c=!1;return this.textElement.childNodes.forEach(function(p){p===a&&(c=!0)}),c},o.prototype.createVisual=function(){this.visual=T.createGroup(),this.bgRectangle=T.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=T.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(T.createTransform()),this.textElement.transform.baseVal.appendItem(T.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,c){u.prototype.pointerDown.call(this,a,c),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(c){a.textElement.appendChild(T.createTSpan(c.trim()===""?" ":c.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),c=1;if(a.width>0&&a.height>0){var p=(1*this.width-this.width*this.padding*2/100)/a.width,h=(1*this.height-this.height*this.padding*2/100)/a.height;c=Math.min(p,h)}return c},o.prototype.getTextPosition=function(a){var c=this.textElement.getBBox(),p=0,h=0;return c.width>0&&c.height>0&&(p=(this.width-c.width*a)/2,h=this.height/2-c.height*a/2),{x:p,y:h}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),c=this.getTextScale(),p=this.getTextPosition(c);p.y-=a.y*c,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+p.x+"px, "+p.y+"px) scale("+c+", "+c+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(p.x,p.y),this.textElement.transform.baseVal.getItem(1).setScale(c,c))},o.prototype.manipulate=function(a){u.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){u.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){u.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(T.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),T.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var c=this.state;c==="creating"&&(this._suppressMarkerCreateEvent=!0),u.prototype.pointerUp.call(this,a),this.setSize(),(c==="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(c){c.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var c=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&c>.9;)c-=.1,a.textEditor.style.fontSize=Math.max(c,.9)+"em"}),this.textEditor.addEventListener("keyup",function(c){c.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(c){if(c.clipboardData){var p=c.clipboardData.getData("text"),h=window.getSelection();if(!h.rangeCount)return!1;h.deleteFromDocument(),h.getRangeAt(0).insertNode(document.createTextNode(p)),c.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(),c=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),p=this.textElement.getBBox(),h={x:p.width*a,y:p.height*a};c.x-=h.x/2,c.y-=h.y/2,this.textEditor.style.top=c.y+"px",this.textEditor.style.left=c.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-c.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(){u.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),u.prototype.deselect.call(this)},o.prototype.dblClick=function(a,c){u.prototype.dblClick.call(this,a,c),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&T.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&&T.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},u.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var c=a;this.color=c.color,this.fontFamily=c.fontFamily,this.padding=c.padding,this.text=c.text,this.createVisual(),u.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,c){u.prototype.scale.call(this,a,c),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}(gt),$=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.color="transparent",h.lineWidth=3,h.drawing=!1,h.pixelRatio=1,h.color=p.defaultColor,h.lineWidth=p.defaultStrokeWidth,h.pixelRatio=p.freehandPixelRatio,h.setColor=h.setColor.bind(h),h.addCanvas=h.addCanvas.bind(h),h.finishCreation=h.finishCreation.bind(h),h.setLineWidth=h.setLineWidth.bind(h),h.colorPanel=new Ge("Color",p.defaultColorSet,p.defaultColor),h.colorPanel.onColorChanged=h.setColor,h.lineWidthPanel=new Ot("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.lineWidthPanel.onWidthChanged=h.setLineWidth,h}return ae(o,u),o.prototype.ownsTarget=function(a){return!(!u.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=T.createGroup(),this.drawingImage=T.createImage(),this.visual.appendChild(this.drawingImage);var a=T.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,c){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):u.prototype.pointerDown.call(this,a,c)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):u.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){u.prototype.resize.call(this,a),T.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),T.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()):u.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(),u.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),u.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),c=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],p=c[0],h=c[1],ce=c[2],tt=c[3],ht=!1,It=0;It<this.canvasElement.height;It++)for(var Re=0;Re<this.canvasElement.width;Re++)a.data[It*this.canvasElement.width*4+4*Re+3]>0&&(ht=!0,It<h&&(h=It),Re<p&&(p=Re),It>tt&&(tt=It),Re>ce&&(ce=Re));if(ht){this.left=p/this.pixelRatio,this.top=h/this.pixelRatio,this.width=(ce-p)/this.pixelRatio,this.height=(tt-h)/this.pixelRatio;var ge=document.createElement("canvas");ge.width=ce-p,ge.height=tt-h,ge.getContext("2d").putImageData(this.canvasContext.getImageData(p,h,ce-p,tt-h),0,0),this.drawingImgUrl=ge.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){T.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),T.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},u.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),u.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,c){u.prototype.scale.call(this,a,c),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}(gt),ne=function(u){function o(a,c,p){var h=u.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 h.typeBoxes=[],h.currentType=c,h.setCurrentType=h.setCurrentType.bind(h),h}return ae(o,u),o.prototype.getUi=function(){var a=this,c=document.createElement("div");c.style.display="flex",c.style.overflow="hidden",c.style.flexGrow="2";for(var p=function(tt){var ht="both";switch(tt){case 0:ht="both";break;case 1:ht="start";break;case 2:ht="end";break;case 3:ht="none"}var It=document.createElement("div");if(It.style.display="flex",It.style.flexGrow="2",It.style.alignItems="center",It.style.justifyContent="space-between",It.style.padding="5px",It.style.borderWidth="2px",It.style.borderStyle="solid",It.style.borderColor=ht===h.currentType?h.uiStyleSettings.toolboxAccentColor:"transparent",It.addEventListener("click",function(){a.setCurrentType(ht,It)}),c.appendChild(It),ht==="both"||ht==="start"){var Re=document.createElement("div");Re.style.display="flex",Re.style.alignItems="center",Re.style.minHeight="20px",Re.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Re.style.marginLeft="5px",It.appendChild(Re)}var ge=document.createElement("div");ge.style.display="flex",ge.style.alignItems="center",ge.style.minHeight="20px",ge.style.flexGrow="2";var qe=document.createElement("hr");if(qe.style.minWidth="20px",qe.style.border="0px",qe.style.borderTop="3px solid "+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee"),qe.style.flexGrow="2",ge.appendChild(qe),It.appendChild(ge),ht==="both"||ht==="end"){var Lt=document.createElement("div");Lt.style.display="flex",Lt.style.alignItems="center",Lt.style.minHeight="20px",Lt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(h.uiStyleSettings!==void 0?h.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Lt.style.marginRight="5px",It.appendChild(Lt)}h.typeBoxes.push(It)},h=this,ce=0;ce<4;ce++)p(ce);return c},o.prototype.setCurrentType=function(a,c){var p=this;this.currentType=a,this.typeBoxes.forEach(function(h){h.style.borderColor=h===c?p.uiStyleSettings!==void 0?p.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(Me),ie=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.arrowType="end",h.arrowBaseHeight=10,h.arrowBaseWidth=10,h.getArrowPoints=h.getArrowPoints.bind(h),h.setArrowType=h.setArrowType.bind(h),h.arrowTypePanel=new ne("Arrow type","end"),h.arrowTypePanel.onArrowTypeChanged=h.setArrowType,h}return ae(o,u),o.prototype.ownsTarget=function(a){return!(!u.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,c){var p=this.arrowBaseWidth+2*this.strokeWidth,h=this.arrowBaseHeight+2*this.strokeWidth;return a-p/2+","+(c+h/2)+" "+a+","+(c-h/2)+" "+(a+p/2)+","+(c+h/2)},o.prototype.createTips=function(){this.arrow1=T.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(T.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=T.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(T.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,c){u.prototype.pointerDown.call(this,a,c),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(u.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",T.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),T.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),c=this.arrow1.transform.baseVal.getItem(0);c.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(c,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},u.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){u.prototype.restoreState.call(this,a);var c=a;this.arrowType=c.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(At),P=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.fillColor=p.defaultFillColor,h.strokeWidth=0,h.fillPanel=new Ge("Color",p.defaultColorSet,p.defaultFillColor),h.fillPanel.onColorChanged=h.setFillColor,h}return ae(o,u),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=u.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}(st),D=function(u){function o(a,c,p,h){var ce=u.call(this,a,h||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return ce.opacities=[],ce.opacityBoxes=[],ce.opacities=c,ce.currentOpacity=p,ce.setCurrentOpacity=ce.setCurrentOpacity.bind(ce),ce}return ae(o,u),o.prototype.getUi=function(){var a=this,c=document.createElement("div");return c.style.display="flex",c.style.overflow="hidden",c.style.flexGrow="2",c.style.justifyContent="space-between",this.opacities.forEach(function(p){var h=document.createElement("div");h.style.display="flex",h.style.alignItems="center",h.style.justifyContent="center",h.style.padding="5px",h.style.borderWidth="2px",h.style.borderStyle="solid",h.style.borderColor=p===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",h.addEventListener("click",function(){a.setCurrentOpacity(p,h)}),c.appendChild(h);var ce=document.createElement("div");ce.innerText=100*p+"%",h.appendChild(ce),a.opacityBoxes.push(h)}),c},o.prototype.setCurrentOpacity=function(a,c){var p=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(h){h.style.borderColor=h===c?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(Me),X=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.setOpacity=h.setOpacity.bind(h),h.fillColor=p.defaultHighlightColor,h.strokeWidth=0,h.opacity=p.defaultHighlightOpacity,h.fillPanel=new Ge("Color",p.defaultColorSet,h.fillColor),h.fillPanel.onColorChanged=h.setFillColor,h.opacityPanel=new D("Opacity",p.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ae(o,u),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&T.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=u.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}(P),V='<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>',xe=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.bgColor="transparent",h.tipPosition={x:0,y:0},h.tipBase1Position={x:0,y:0},h.tipBase2Position={x:0,y:0},h.tipMoving=!1,h.color=p.defaultStrokeColor,h.bgColor=p.defaultFillColor,h.fontFamily=p.defaultFontFamily,h.defaultSize={x:100,y:30},h.setBgColor=h.setBgColor.bind(h),h.getTipPoints=h.getTipPoints.bind(h),h.positionTip=h.positionTip.bind(h),h.setTipPoints=h.setTipPoints.bind(h),h.colorPanel=new Ge("Text color",p.defaultColorSet,h.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),h.colorPanel.onColorChanged=h.setColor,h.bgColorPanel=new Ge("Fill color",p.defaultColorSet,h.bgColor,V),h.bgColorPanel.onColorChanged=h.setBgColor,h.fontFamilyPanel=new He("Font",p.defaultFontFamilies,p.defaultFontFamily),h.fontFamilyPanel.onFontChanged=h.setFont,h.tipGrip=new yt,h.tipGrip.visual.transform.baseVal.appendItem(T.createTransform()),h.controlBox.appendChild(h.tipGrip.visual),h}return ae(o,u),o.prototype.ownsTarget=function(a){return u.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){T.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=T.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,c){this.state==="new"&&u.prototype.pointerDown.call(this,a,c),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(c)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):u.prototype.pointerDown.call(this,a,c)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,u.prototype.pointerUp.call(this,a);else{var c=this.state==="creating";u.prototype.pointerUp.call(this,a),this.setTipPoints(c),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var c=this.unrotatePoint(a);this.tipPosition={x:c.x-this.manipulationStartLeft,y:c.y-this.manipulationStartTop},this.positionTip()}else u.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(T.setAttributes(this.bgRectangle,[["fill",a]]),T.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 c=Math.min(this.height/2,15),p=this.height/5;a&&(this.tipPosition={x:c+p/2,y:this.height+20});var h=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(p=this.width/5,c=Math.min(this.width/2,15),this.tipBase1Position={x:c,y:0},this.tipBase2Position={x:c+p,y:0}):(this.tipBase1Position={x:0,y:c},this.tipBase2Position={x:0,y:c+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?h<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(p=this.width/5,c=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-c-p,y:0},this.tipBase2Position={x:this.width-c,y:0}):(this.tipBase1Position={x:this.width,y:c},this.tipBase2Position={x:this.width,y:c+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?h<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(p=this.width/5,c=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-c-p,y:this.height},this.tipBase2Position={x:this.width-c,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-c-p},this.tipBase2Position={x:this.width,y:this.height-c}):h<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(p=this.width/5,c=Math.min(this.width/2,15),this.tipBase1Position={x:c,y:this.height},this.tipBase2Position={x:c+p,y:this.height}):(this.tipBase1Position={x:0,y:this.height-c},this.tipBase2Position={x:0,y:this.height-c-p})},o.prototype.resize=function(a){u.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){T.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(),u.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},u.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var c=a;this.bgColor=c.bgColor,this.tipPosition=c.tipPosition,u.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,c){u.prototype.scale.call(this,a,c),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*c},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}(Xe),ve=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.fillColor="transparent",h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.opacity=1,h.strokeColor=p.defaultColor,h.strokeWidth=p.defaultStrokeWidth,h.strokeDasharray=p.defaultStrokeDasharray,h.fillColor=p.defaultFillColor,h.setStrokeColor=h.setStrokeColor.bind(h),h.setFillColor=h.setFillColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.setOpacity=h.setOpacity.bind(h),h.createVisual=h.createVisual.bind(h),h.strokePanel=new Ge("Line color",W(p.defaultColorSet,["transparent"]),p.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.fillPanel=new Ge("Fill color",W(p.defaultColorSet,["transparent"]),h.fillColor,V),h.fillPanel.onColorChanged=h.setFillColor,h.strokeWidthPanel=new Ot("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new xt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h.opacityPanel=new D("Opacity",p.defaultOpacitySteps,h.opacity),h.opacityPanel.onOpacityChanged=h.setOpacity,h}return ae(o,u),o.prototype.ownsTarget=function(a){return!(!u.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=T.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,c){u.prototype.pointerDown.call(this,a,c),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){u.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){u.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){u.prototype.setSize.call(this),T.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){u.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&T.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&T.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&T.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&T.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&T.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},u.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var c=a;this.fillColor=c.fillColor,this.strokeColor=c.strokeColor,this.strokeWidth=c.strokeWidth,this.strokeDasharray=c.strokeDasharray,this.opacity=c.opacity,this.createVisual(),u.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,c){u.prototype.scale.call(this,a,c),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}(gt),Oe=function(u){function o(a,c,p){return u.call(this,a,c,p)||this}return ae(o,u),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!u.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=T.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(T.createTransform()),this.visual.appendChild(this.tip1),this.tip2=T.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(T.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,c){u.prototype.pointerDown.call(this,a,c),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(u.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(T.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()]]),T.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),c=this.tip1.transform.baseVal.getItem(0);c.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(c,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=u.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){u.prototype.restoreState.call(this,a),this.createTips(),this.adjustVisual()},o.typeName="MeasurementMarker",o.title="Measurement marker",o.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',o}(At),lt=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.strokePanel.colors=p.defaultColorSet,h.fillColor="transparent",h}return ae(o,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=u.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}(ve),Ye=function(){function u(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(u.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),u.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))},u.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},u.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},u.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}},u.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},u}(),je=function(u){function o(a,c,p){var h=u.call(this,a,c,p)||this;return h.strokeColor="transparent",h.strokeWidth=0,h.strokeDasharray="",h.curveX=0,h.curveY=0,h.manipulationStartCurveX=0,h.manipulationStartCurveY=0,h.setStrokeColor=h.setStrokeColor.bind(h),h.setStrokeWidth=h.setStrokeWidth.bind(h),h.setStrokeDasharray=h.setStrokeDasharray.bind(h),h.positionGrips=h.positionGrips.bind(h),h.addControlGrips=h.addControlGrips.bind(h),h.adjustVisual=h.adjustVisual.bind(h),h.setupControlBox=h.setupControlBox.bind(h),h.resize=h.resize.bind(h),h.strokeColor=p.defaultColor,h.strokeWidth=p.defaultStrokeWidth,h.strokeDasharray=p.defaultStrokeDasharray,h.strokePanel=new Ge("Line color",p.defaultColorSet,p.defaultColor),h.strokePanel.onColorChanged=h.setStrokeColor,h.strokeWidthPanel=new Ot("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),h.strokeWidthPanel.onWidthChanged=h.setStrokeWidth,h.strokeStylePanel=new xt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),h.strokeStylePanel.onStyleChanged=h.setStrokeDasharray,h}return ae(o,u),o.prototype.ownsTarget=function(a){return!(!u.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=T.createGroup(),this.selectorCurve=T.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=T.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,c){u.prototype.pointerDown.call(this,a,c),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(c)&&(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()),T.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),T.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),T.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){u.prototype.setupControlBox.call(this),this.curveControlLine1=T.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=T.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,u.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){u.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),u.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),u.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,c){this.curveX=this.curveX*a,this.curveY=this.curveY*c,u.prototype.scale.call(this,a,c)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},u.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){u.prototype.restoreState.call(this,a);var c=a;this.strokeColor=c.strokeColor,this.strokeWidth=c.strokeWidth,this.strokeDasharray=c.strokeDasharray,this.curveX=c.curveX,this.curveY=c.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}(ft),pt=function(){function u(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(u.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),u.prototype.preventDefault=function(){this._defaultPrevented=!0},u}(),Ut=function(u){function o(a,c,p){var h=u.call(this,a,!1)||this;return h.dataUrl=c,h.state=p,h}return ae(o,u),o}(pt),ut=function(u){function o(a,c,p){p===void 0&&(p=!1);var h=u.call(this,a,p)||this;return h.marker=c,h}return ae(o,u),o}(pt),$t=function(){function u(){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 u.prototype.addEventListener=function(o,a){this[o].push(a)},u.prototype.removeEventListener=function(o,a){var c=this[o].indexOf(a);c>-1&&this[o].splice(c,1)},u}(),ot=function(){function u(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 Le,this._isOpen=!1,this.undoRedoManager=new Ye,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 $t,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=u.instanceCounter++,this.styles=new Be(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(u.prototype,"ALL_MARKER_TYPES",{get:function(){return[wt,$,ie,Xe,lt,ve,X,xe,Oe,P,At,je]},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[wt,$,ie,Xe,ve,X,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"BASIC_MARKER_TYPES",{get:function(){return[wt,$,ie,Xe,X]},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(c){if(typeof c=="string"){var p=a.ALL_MARKER_TYPES.find(function(h){return h.typeName===c});p!==void 0&&a._availableMarkerTypes.push(p)}else a._availableMarkerTypes.push(c)})},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(u.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(u.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),u.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ce.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},u.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&Ze.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ze.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new pt(o))})},u.prototype.render=function(){return Z(this,void 0,void 0,function(){var o;return ye(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new We).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()]}})})},u.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var c=!1;o||this.eventListeners.beforeclose.forEach(function(p){var h=new pt(a,!0);p(h),h.defaultPrevented&&(c=!0)}),c||(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)}},u.prototype.addMarkersToToolbar=function(){for(var o,a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];(o=this._availableMarkerTypes).push.apply(o,a)},u.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},u.prototype.removeRenderEventListener=function(o){},u.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},u.prototype.removeCloseEventListener=function(o){},u.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))},u.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,c=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,c)},u.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},u.prototype.resize=function(o,a){this._isResizing=!0;var c=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(c,p),this._isResizing=!1},u.prototype.scaleMarkers=function(o,a){var c,p=this;this._currentMarker&&this._currentMarker instanceof Xe?this._currentMarker.scale(o,a):(c=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(h){h!==p._currentMarker&&h.scale(o,a)}),c!==void 0&&this.setCurrentMarker(c)},u.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"},u.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},u.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)},u.prototype.addDefs=function(){for(var o,a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];this.defs=T.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},u.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},u.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)},u.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},u.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},u.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)},u.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},u.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)},u.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()},u.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")},u.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"},u.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},u.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 he(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 ke(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},u.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},u.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},u.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())},u.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()}},u.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(p){var h=new ut(o,o._currentMarker,!0);p(h),h.defaultPrevented&&(a=!0)}),!a){var c=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 ut(o,c))})}}},u.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ce){var tt=new ut(o,void 0,!0);ce(tt),tt.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var c=function(ce){var tt=p.markers[ce];p.setCurrentMarker(p.markers[ce]),p._currentMarker.dispose(),p.markerImage.removeChild(p._currentMarker.container),p.markers.splice(p.markers.indexOf(p._currentMarker),1),p.eventListeners.markerdelete.forEach(function(ht){return ht(new ut(o,tt))})},p=this,h=this.markers.length-1;h>=0;h--)c(h);this.addUndoStep()}},Object.defineProperty(u.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),u.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))},u.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)},u.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},u.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),c=this.undoRedoManager.getLastUndoStep();if(!c||c.width===a.width&&c.height===a.height){var p=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),p<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(h){return h(new pt(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(h){return h(new pt(o))})}},u.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},u.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(c){return c(new pt(o))}))},u.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},u.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(c){return c(new pt(o))}))},u.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},u.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},u.prototype.startRenderAndClose=function(){return Z(this,void 0,void 0,function(){var o,a,c=this;return ye(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(h){return h(new Ut(c,o,a))}),this.close(!0),[2]}})})},u.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(c){return a.markers.push(c.getState())}),a},u.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(c){var p=a._availableMarkerTypes.find(function(ce){return ce.typeName===c.typeName});if(p!==void 0){var h=a.addNewMarker(p);h.restoreState(c),a.markers.push(h)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(c){return c(new pt(a))})},u.prototype.addNewMarker=function(o){var a=T.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},u.prototype.createNewMarker=function(o){var a,c=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 ut(c,c._currentMarker))}))},u.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof $&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker($):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(c){return c(new ut(a,a._currentMarker))})},u.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},u.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},u.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(c){return c(new ut(a,o))})},u.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(c){return c(new ut(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(c){return c(new ut(a,a._currentMarker))}))},u.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(c){return c.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))},u.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(c){return c.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()}},u.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}))},u.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()},u.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},u.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},u.prototype.clientToLocalCoordinates=function(o,a){var c=this.markerImage.getBoundingClientRect();return{x:(o-c.left)/this.zoomLevel,y:(a-c.top)/this.zoomLevel}},u.prototype.onWindowResize=function(){this.positionUI()},u.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()},u.prototype.addLicenseKey=function(o){Ce.addKey(o)},u.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},u.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},u.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(u.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),u.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))}))},u.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))}))},u.instanceCounter=0,u}();/* **********************************
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 Xt=function(u,o){return(Xt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(a[p]=c[p])})(u,o)};function Wt(u,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=u}Xt(u,o),u.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function St(u,o,a,c){return new(a||(a=Promise))(function(p,h){function ce(It){try{ht(c.next(It))}catch(Re){h(Re)}}function tt(It){try{ht(c.throw(It))}catch(Re){h(Re)}}function ht(It){var Re;It.done?p(It.value):(Re=It.value,Re instanceof a?Re:new a(function(ge){ge(Re)})).then(ce,tt)}ht((c=c.apply(u,o||[])).next())})}function Yt(u,o){var a,c,p,h,ce={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return h={next:tt(0),throw:tt(1),return:tt(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function tt(ht){return function(It){return function(Re){if(a)throw new TypeError("Generator is already executing.");for(;ce;)try{if(a=1,c&&(p=2&Re[0]?c.return:Re[0]?c.throw||((p=c.return)&&p.call(c),0):c.next)&&!(p=p.call(c,Re[1])).done)return p;switch(c=0,p&&(Re=[2&Re[0],p.value]),Re[0]){case 0:case 1:p=Re;break;case 4:return ce.label++,{value:Re[1],done:!1};case 5:ce.label++,c=Re[1],Re=[0];continue;case 7:Re=ce.ops.pop(),ce.trys.pop();continue;default:if(!(p=ce.trys,(p=p.length>0&&p[p.length-1])||Re[0]!==6&&Re[0]!==2)){ce=0;continue}if(Re[0]===3&&(!p||Re[1]>p[0]&&Re[1]<p[3])){ce.label=Re[1];break}if(Re[0]===6&&ce.label<p[1]){ce.label=p[1],p=Re;break}if(p&&ce.label<p[2]){ce.label=p[2],ce.ops.push(Re);break}p[2]&&ce.ops.pop(),ce.trys.pop();continue}Re=o.call(u,ce)}catch(ge){Re=[6,ge],c=0}finally{a=p=0}if(5&Re[0])throw Re[1];return{value:Re[0]?Re[1]:void 0,done:!0}}([ht,It])}}}var zt=function(){function u(){}return u.addKey=function(o){u.key=o},Object.defineProperty(u,"isLicensed",{get:function(){return!!u.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(u.key)},enumerable:!1,configurable:!0}),u}(),Je=function(){function u(){}return u.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},u.setAttributes=function(o,a){for(var c=0,p=a;c<p.length;c++){var h=p[c],ce=h[0],tt=h[1];o.setAttribute(ce,tt)}},u.createRect=function(o,a,c){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),c&&u.setAttributes(p,c),p},u.createLine=function(o,a,c,p,h){var ce=document.createElementNS("http://www.w3.org/2000/svg","line");return ce.setAttribute("x1",o.toString()),ce.setAttribute("y1",a.toString()),ce.setAttribute("x2",c.toString()),ce.setAttribute("y2",p.toString()),h&&u.setAttributes(ce,h),ce},u.createPolygon=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","polygon");return c.setAttribute("points",o),a&&u.setAttributes(c,a),c},u.createCircle=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","circle");return c.setAttribute("cx",(o/2).toString()),c.setAttribute("cy",(o/2).toString()),c.setAttribute("r",o.toString()),a&&u.setAttributes(c,a),c},u.createEllipse=function(o,a,c){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()),c&&u.setAttributes(p,c),p},u.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&u.setAttributes(a,o),a},u.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},u.createMarker=function(o,a,c,p,h,ce,tt){var ht=document.createElementNS("http://www.w3.org/2000/svg","marker");return u.setAttributes(ht,[["id",o],["orient",a],["markerWidth",c.toString()],["markerHeight",p.toString()],["refX",h.toString()],["refY",ce.toString()]]),ht.appendChild(tt),ht},u.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&u.setAttributes(a,o),a},u.createTSpan=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","tspan");return c.textContent=o,a&&u.setAttributes(c,a),c},u.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&u.setAttributes(a,o),a},u.createPoint=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return c.x=o,c.y=a,c},u.createPath=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg","path");return c.setAttribute("d",o),a&&u.setAttributes(c,a),c},u.createElement=function(o,a){var c=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&u.setAttributes(c,a),c},u.getHollowRectanglePath=function(o,a,c,p,h,ce,tt,ht){return"M"+o+","+a+"V"+(a+p)+"H"+(o+c)+"V"+a+"H"+h+"V"+ce+"H"+(h+tt)+"V"+(ce+ht)+"H"+h+"V"+a+"Z"},u}(),ze=function(){function u(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(u.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(u.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(u.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),u.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},u.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)},u.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 Ae("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ae("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ae("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new $e("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new $e("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},u.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},u}(),Ae=function(u,o){this.selector=u,this.style=o},$e=function(u,o){this.localName=u,this.style=o},Dt=function(){function u(){this.blocks=[],this.display=""}return u.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},u.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},u.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},u}(),Nt=function(){function u(){}return u.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},u}(),Jt=function(u){function o(){var a=u!==null&&u.apply(this,arguments)||this;return a.buttons=[],a}return Wt(o,u),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=u.prototype.getUI.call(this);return this.buttons.forEach(function(c){return a.appendChild(c.getUI())}),a},o}(Nt),Ft=function(){function u(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(u.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),u.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},u.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,"")))},u.prototype.hide=function(){this._isHidden=!0},u}(),_t=function(u){function o(){var a=u!==null&&u.apply(this,arguments)||this;return a.elements=[],a}return Wt(o,u),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=u.prototype.getUI.call(this);return this.elements.forEach(function(c){return a.appendChild(c)}),a},o}(Nt),an=function(){function u(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(u.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),u.prototype.getVerticalLength=function(o){return o/this.ratio},u.prototype.getHorizontalLength=function(o){return o*this.ratio},u}(),jt=function(){function u(){}return u.getIcon=function(o,a){if(o>0&&a>0){var c=new an(o,a),p=c.ratio>=1?20:c.getHorizontalLength(20),h=c.ratio<1?20:c.getVerticalLength(20),ce=document.createElementNS("http://www.w3.org/2000/svg","svg");ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ce);var tt=Je.createDefs();ce.appendChild(tt);var ht=Je.createElement("clipPath",[["id","text-bg-clip"]]);tt.appendChild(ht);var It=Je.createPath(Je.getHollowRectanglePath((24-p)/2,(24-h)/2,p,h,(24-p)/2+2,(24-h)/2+2,p-4,h-4));ce.appendChild(It);var Re=Je.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Re.appendChild(Je.createTSpan(o+":"+a)),ce.appendChild(Re);var ge=Re.getBBox();Je.setAttributes(Re,[["x",((24-ge.width)/2).toString()],["y",((24-ge.height)/2-ge.y).toString()]]);var qe=Je.createPath(Je.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(ge.width))/2,(24-Math.ceil(ge.height))/2,Math.ceil(ge.width),Math.ceil(ge.height)));return ht.appendChild(qe),Je.setAttributes(It,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ce),ce.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>'},u}(),cn=function(u){function o(a,c,p){var h=u.call(this,a,c)||this;return h.isDropdownOpen=!1,h.onClick=h.dropdownButtonClicked,h.dropdownButtons=p,h}return Wt(o,u),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(c){c.className=a.className,c.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(c.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}(Ft),Kt=function(){function u(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=Je.createGroup(),this.visual.appendChild(Je.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Je.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return u.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},u.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(c){return Je.setAttributes(c,[["cx",o.toString()],["cy",a.toString()]])})},u}(),dn=function(){function u(o,a,c,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=c,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(u.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(u.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&Je.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),u.prototype.open=function(){var o=this;this.cropShadeElement=Je.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Je.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(Je.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Je.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(c){return o.gridContainer.appendChild(c)}),this.verticalGridLines.forEach(function(c){return o.gridContainer.appendChild(c)}),this.cropRectElement=Je.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Kt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Kt(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Kt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Kt(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},u.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),Je.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var c=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(h,ce){var tt=a.y+c*(ce+1);Je.setAttributes(h,[["x1",""+a.x],["y1",""+tt],["x2",""+(a.x+a.width)],["y2",""+tt]])});var p=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(h,ce){var tt=a.x+p*(ce+1);Je.setAttributes(h,[["x1",""+tt],["y1",""+a.y],["x2",""+tt],["y2",""+(a.y+a.height)]])}),Je.setAttributes(this.cropShadeElement,[["d",Je.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},u.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)},u.prototype.clientToLocalCoordinates=function(o,a){var c=this.container.getBoundingClientRect();return{x:o-c.left+this.margin,y:a-c.top+this.margin}},u.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)},u.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()},u.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},u.prototype.move=function(o){var a=o.x-this.previousPoint.x,c=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,c=-c/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+c),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},u.prototype.resize=function(o){var a=Object.assign({},this.cropRect),c=o.x-this.previousPoint.x,p=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+c<this.margin&&(c=this.margin-a.x),a.x+=c,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+c>this.canvasWidth*this.zoomFactor&&(c=this.canvasWidth*this.zoomFactor-a.width),a.width+=c}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(c),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))},u.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,c=this.aspectRatio.getHorizontalLength(this.cropRect.height),p=this.aspectRatio.getVerticalLength(this.cropRect.width);c/this.canvasWidth<p/this.canvasHeight?this.cropRect.width=c: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)}},u.prototype.getRescaledRect=function(o,a,c,p,h,ce){var tt=c/o,ht=p/a;return{x:(h.x-ce)*tt+ce,y:(h.y-ce)*ht+ce,width:h.width*tt,height:h.height*ht}},u.prototype.scaleCanvas=function(o,a){var c=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(c),this.setCropRectangle(c)},u}(),Nn=function(){function u(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(u.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),u.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},u.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},u.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},u.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},u.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();Je.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},u.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)}},u.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,c=1;c<=this.width/5+10;c++){var p=c%5==0?this.height/3:this.height/6;a+="h4v"+-p+"h1v"+p}a+="v1H0Z",this.scaleShape=Je.createPath(a);var h=Je.createTransform();this.scaleShape.transform.baseVal.appendItem(h),o.appendChild(this.scaleShape),this.angleLabelElement=Je.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Je.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ce=Je.createTSpan("");return ce.innerHTML="&deg;",this.angleLabelElement.appendChild(ce),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},u}(),sn=function(){function u(){this.naturalSize=!1,this.imageType="image/png"}return u.prototype.rasterize=function(o,a,c,p,h,ce,tt){var ht=this;return new Promise(function(It){var Re=document.createElement("canvas");Re.width=o.width.baseVal.value-2*p,Re.height=o.height.baseVal.value-2*p;var ge=1,qe=1;ht.naturalSize===!0?(ge=a.naturalWidth/(o.width.baseVal.value-2*p)/ce,qe=a.naturalHeight/(o.height.baseVal.value-2*p)/tt,Re.width=a.naturalWidth/ce,Re.height=a.naturalHeight/tt):ht.width!==void 0&&ht.height!==void 0&&(ge=ht.width/c.width,qe=ht.height/c.height,Re.width*=ge,Re.height*=qe);var Lt=Re.getContext("2d");Lt.translate(Re.width/2,Re.height/2),Lt.rotate(h*Math.PI/180),Lt.scale(ce,tt),Lt.translate(-Re.width/2,-Re.height/2),Lt.drawImage(a,0,0,Re.width,Re.height);var Pt=document.createElement("canvas");Pt.width=c.width*ge,Pt.height=c.height*qe,Pt.getContext("2d").putImageData(Lt.getImageData((c.x-p)*ge,(c.y-p)*qe,c.width*ge,c.height*qe),0,0),It(Pt.toDataURL(ht.imageType,ht.imageQuality))})},u}(),Fe=function(){function u(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=u.instanceCounter++,this.styles=new ze(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(u.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(u.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(u.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(u.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(u.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(u.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}),u.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},u.prototype.show=function(){this.showUI(),this.open()},u.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)},u.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},u.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},u.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},u.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},u.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))},u.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,c=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,c)}},u.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},u.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",Je.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},u.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()},u.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();Je.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},u.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},u.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=Je.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Je.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Je.createGroup(),this.editingTargetRotationScaleContainer=Je.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=Je.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=Je.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=Je.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)},u.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},u.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Je.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new dn(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()},u.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)}},u.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)},u.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},u.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},u.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"},u.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},u.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},u.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},u.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Dt,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 Jt;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var c=[];this.aspectRatios.forEach(function(qe){var Lt=new Ft(jt.getIcon(qe.horizontal,qe.vertical),qe.horizontal===0&&qe.vertical===0?"FREE":qe.horizontal+":"+qe.vertical);Lt.onClick=function(){return o.ratioButtonClicked(qe)},c.push(Lt)}),this.aspectRatioButton=new cn(jt.getIcon(0,0),"Aspect ratio",c),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 Ft('<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 h=new Ft('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(h.isActive=this.zoomToCropEnabled,h.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,h.isActive=o.zoomToCropEnabled},a.addButton(h),!zt.isLicensed){var ce=new _t;this.topToolbar.addElementBlock(ce);var tt=document.createElement("div");tt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ht=document.createElement("a");ht.style.color="currentColor",ht.href="https://markerjs.com/products/cropro",ht.target="_blank",ht.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>',tt.appendChild(ht),ce.addElement(tt)}var It=new Jt;It.minWidth=3*this.toolbarHeight+"px",It.contentAlign="end",this.topToolbar.addButtonBlock(It);var Re=new Ft('<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");Re.onClick=this.startRenderAndClose,It.addButton(Re),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Re.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var ge=new Ft('<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");ge.onClick=this.close,It.addButton(ge),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(ge.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},u.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Dt,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 Jt;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var c=new Ft('<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");c.onClick=this.rotateLeftButtonClicked,a.addButton(c);var p=new Ft('<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 h=new _t;h.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(h),this.straightener=new Nn("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(It){o.rotateBy(It),o.straightener.angle=o.rotationAngle},h.addElement(this.straightener.getUI());var ce=new Jt;ce.minWidth=2*this.toolbarHeight+"px",ce.contentAlign="end",this.bottomToolbar.addButtonBlock(ce);var tt=new Ft('<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");tt.onClick=this.flipHorizontallyButtonClicked,ce.addButton(tt);var ht=new Ft('<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");ht.onClick=this.flipVerticallyButtonClicked,ce.addButton(ht)},u.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},u.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=jt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},u.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new an(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},u.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},u.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},u.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()}},u.prototype.clientToLocalCoordinates=function(o,a){var c=this.cropImage.getBoundingClientRect();return{x:o-c.left,y:a-c.top}},u.prototype.onWindowResize=function(){this.positionUI()},u.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()},u.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)},u.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)},u.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},u.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},u.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 c=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/c.width,this.imageHeight/c.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},u.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},u.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},u.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},u.prototype.startRenderAndClose=function(){return St(this,void 0,void 0,function(){var o,a;return Yt(this,function(c){switch(c.label){case 0:return[4,this.render()];case 1:return o=c.sent(),a=this.getState(),this.renderEventListeners.forEach(function(p){return p(o,a)}),this.close(!0),[2]}})})},u.prototype.render=function(){return St(this,void 0,void 0,function(){var o;return Yt(this,function(a){switch(a.label){case 0:return(o=new sn).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),Je.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()]}})})},u.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new $e("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 $e("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new $e("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new $e("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 $e("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new $e("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Ae("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ae("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new $e("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 $e("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new $e("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 $e("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 $e("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},u.instanceCounter=0,u}(),it=l("8hTe"),Gt=l.n(it),qt=/<pre[^>]*>/g;function nn(u){var o=document.createElement("div");return o.innerHTML=u,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var ln=ue.a=function(u){var o=u.value,a=o===void 0?"":o,c=u.edit,p=c===void 0?!1:c,h=u.className,ce=u.showTextOnly,tt=u.showLines,ht=u.replaces,It=u.zoomImg,Re=u.hasMask,ge=u.style,qe=ge===void 0?{}:ge,Lt=u.stylesPrev,Pt=Lt===void 0?{}:Lt,Tt=String(a),Mt=Object(A.useRef)(),mn=Object(A.useRef)(),jn=Object(A.useState)(""),kn=Object(Y.a)(jn,2),_n=kn[0],Ln=kn[1],Un=Object(A.useState)("office"),ti=Object(Y.a)(Un,2),wi=ti[0],Xn=ti[1],$n=function(){var En=new Fe(mn.current);En.displayMode="popup",En.addRenderEventListener(function(){var li=Object(fe.a)(N.a.mark(function gn(Hn){var wn;return N.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:return Mt.current.style.display="none",Yn.next=3,Object(Ne.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Hn}});case 3:wn=Yn.sent,wn!=null&&wn.id&&ht(mn.current.getAttribute("src").replace(Ue.a.API_SERVER,""),"/api/attachments/".concat(wn==null?void 0:wn.id,"?type=").concat(wn.content_type));case 5:case"end":return Yn.stop()}},gn)}));return function(gn){return li.apply(this,arguments)}}()),En.show()},$i=function(){var En=new ot(mn.current);En.settings.displayMode="popup",En.addEventListener("render",function(){var li=Object(fe.a)(N.a.mark(function gn(Hn){var wn;return N.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:if(Mt.current.style.display="none",!mn.current){Yn.next=6;break}return Yn.next=4,Object(Ne.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Hn.dataUrl}});case 4:wn=Yn.sent,wn!=null&&wn.id&&ht(mn.current.getAttribute("src").replace(Ue.a.API_SERVER,""),"/api/attachments/".concat(wn==null?void 0:wn.id,"?type=").concat(wn.content_type));case 6:case"end":return Yn.stop()}},gn)}));return function(gn){return li.apply(this,arguments)}}()),En.show(),window.markerArea=En},_i=Object(A.useMemo)(function(){try{var zn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,En=/\"\/api\/attachments\/|\"\/attachments\/download\//g,li=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Tt=Tt.replace(zn,"("+Ue.a.API_SERVER+"/api/attachments/").replace(En,'"'+Ue.a.API_SERVER+"/api/attachments/").replace(li,'"'+Ue.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,`
`),Tt=Tt.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(di){}var gn=be(Tt),Hn=Q();if(Tt.match(/\[TOC\]/)&&(gn=gn.replace("<p>[TOC]</p>",b()),ee()),gn=gn.replace(/(__special_katext_id_\d+__)/g,function(di,Yn){var Ci=Hn[Yn],pr=Ci.type,nr=Ci.expression;return Object(De.renderToString)(nn(nr)||"",{displayMode:pr==="block",throwOnError:!1,output:"html"})}),gn=gn.replace(/▁/g,"\u2581\u2581\u2581"),z(),ce){var wn=document.createElement("div");return wn.innerHTML=gn,wn.innerText}return setTimeout(function(){return ar()},500),gn},[Tt]),An=Object(A.useRef)();oe.WebkitLineClamp=tt,tt&&(qe=Object(Ee.a)(Object(Ee.a)({},qe),oe));function Fi(zn){var En=zn.target;if(En.tagName.toUpperCase()==="IMG"){if(It){var li=En.getAttribute("src");Ln(li),Xn("image")}}else if(En.tagName.toUpperCase()==="A"){var gn=En.getAttribute("href");if(gn.indexOf("office")>-1)zn.preventDefault(),Ln(gn),Xn("office");else if(gn.indexOf("application/pdf")>-1)zn.preventDefault(),Ln(gn),Xn("pdf");else if(gn.indexOf("type=text")>-1)zn.preventDefault(),Ln(gn),Xn("html");else if(gn.startsWith("#")){zn.preventDefault();var Hn=document.getElementById(gn.replace("#",""));Hn&&Hn.scrollIntoView(!0)}}}var ar=function(){var En,li=(En=An.current)===null||En===void 0?void 0:En.querySelectorAll("video");li==null||li.forEach(function(gn){if(gn.oncontextmenu=function(){return!1},gn.src.indexOf(".m3u8")>-1&&!gn.canPlayType("application/vnd.apple.mpegurl")){if(pe.a.isSupported()){var Hn=new pe.a;Hn.loadSource(gn.src),Hn.attachMedia(gn)}}})};Object(A.useEffect)(function(){if(An.current&&_i&&(_i.match(qt)&&window.PR.prettyPrint()),An.current)return An.current.addEventListener("click",Fi),function(){An.current.removeEventListener("click",Fi),z(),ee()}},[_i,An.current,Fi]);var fr=function(En){if(!p)return;En.target.nodeName==="IMG"?(Mt.current.style.display="flex",Mt.current.style.width=En.target.clientWidth+"px",Mt.current.style.height=En.target.clientHeight+"px",Mt.current.style.top=En.target.offsetTop+"px",Mt.current.style.left=En.target.offsetLeft+"px",mn.current.src=En.target.getAttribute("src")):Mt.current.style.display="none"};return _.a.createElement("div",{style:{position:"relative"}},_.a.createElement("div",{ref:An,style:Object(Ee.a)({},qe),className:"".concat(h||""," markdown-body ").concat(Gt.a.mdBody),onMouseOver:fr,dangerouslySetInnerHTML:{__html:_i}}),_.a.createElement("div",{ref:Mt,className:Gt.a.button},_.a.createElement(_e.a,null,_.a.createElement(we.a,{onClick:function(){return $n()}},"\u88C1\u526A"),_.a.createElement(we.a,{onClick:function(){return $i()}},"\u7F16\u8F91"))),_.a.createElement("img",{ref:mn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),_.a.createElement(nt.a,{close:!0,data:_n,hasMask:Re,type:_n!=null&&_n.length?wi:"",style:Object(Ee.a)({},Pt),onClose:function(){return Ln("")}}))}},"9VGf":function(rt,ue,l){"use strict";l.d(ue,"a",function(){return me});var q=l("q1tI"),_e=l.n(q);function me(we,Ee){var fe=Object(q.useRef)();Object(q.useEffect)(function(){fe.current=we}),Object(q.useEffect)(function(){function Y(){fe.current()}if(Ee!==null){var B=setInterval(Y,Ee);return function(){return clearInterval(B)}}},[Ee])}},"A+k2":function(rt,ue,l){rt.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:function(rt,ue,l){(function(q){q(l("VrN/"),l("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(N,A,_){if(_!=q.Init&&_&&N.removeKeyMap("autoCloseTags"),!A)return;var C={name:"autoCloseTags"};(typeof A!="object"||A.whenClosing!==!1)&&(C["'/'"]=function(O){return fe(O)}),(typeof A!="object"||A.whenOpening!==!1)&&(C["'>'"]=function(O){return we(O)}),N.addKeyMap(C)});var _e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],me=["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 we(N){if(N.getOption("disableInput"))return q.Pass;for(var A=N.listSelections(),_=[],C=N.getOption("autoCloseTags"),O=0;O<A.length;O++){if(!A[O].empty())return q.Pass;var x=A[O].head,w=N.getTokenAt(x),M=q.innerMode(N.getMode(),w.state),m=M.state,v=M.mode.xmlCurrentTag&&M.mode.xmlCurrentTag(m),f=v&&v.name;if(!f)return q.Pass;var L=M.mode.configuration=="html",ee=typeof C=="object"&&C.dontCloseTags||L&&_e,oe=typeof C=="object"&&C.indentTags||L&&me;w.end>x.ch&&(f=f.slice(0,f.length-w.end+x.ch));var F=f.toLowerCase();if(!f||w.type=="string"&&(w.end!=x.ch||!/[\"\']/.test(w.string.charAt(w.string.length-1))||w.string.length==1)||w.type=="tag"&&v.close||w.string.indexOf("/")==x.ch-w.start-1||ee&&Y(ee,F)>-1||B(N,M.mode.xmlCurrentContext&&M.mode.xmlCurrentContext(m)||[],f,x,!0))return q.Pass;var b=typeof C=="object"&&C.emptyTags;if(b&&Y(b,f)>-1){_[O]={text:"/>",newPos:q.Pos(x.line,x.ch+2)};continue}var se=oe&&Y(oe,F)>-1;_[O]={indent:se,text:">"+(se?`
`:"")+"</"+f+">",newPos:se?q.Pos(x.line+1,0):q.Pos(x.line,x.ch+1)}}for(var j=typeof C=="object"&&C.dontIndentOnAutoClose,O=A.length-1;O>=0;O--){var re=_[O];N.replaceRange(re.text,A[O].head,A[O].anchor,"+insert");var k=N.listSelections().slice(0);k[O]={head:re.newPos,anchor:re.newPos},N.setSelections(k),!j&&re.indent&&(N.indentLine(re.newPos.line,null,!0),N.indentLine(re.newPos.line+1,null,!0))}}function Ee(N,A){for(var _=N.listSelections(),C=[],O=A?"/":"</",x=N.getOption("autoCloseTags"),w=typeof x=="object"&&x.dontIndentOnSlash,M=0;M<_.length;M++){if(!_[M].empty())return q.Pass;var m=_[M].head,v=N.getTokenAt(m),f=q.innerMode(N.getMode(),v.state),L=f.state;if(A&&(v.type=="string"||v.string.charAt(0)!="<"||v.start!=m.ch-1))return q.Pass;var ee,oe=f.mode.name!="xml"&&N.getMode().name=="htmlmixed";if(oe&&f.mode.name=="javascript")ee=O+"script";else if(oe&&f.mode.name=="css")ee=O+"style";else{var F=f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(L);if(!F||F.length&&B(N,F,F[F.length-1],m))return q.Pass;ee=O+F[F.length-1]}N.getLine(m.line).charAt(v.end)!=">"&&(ee+=">"),C[M]=ee}if(N.replaceSelections(C),_=N.listSelections(),!w)for(var M=0;M<_.length;M++)(M==_.length-1||_[M].head.line<_[M+1].head.line)&&N.indentLine(_[M].head.line)}function fe(N){return N.getOption("disableInput")?q.Pass:Ee(N,!0)}q.commands.closeTag=function(N){return Ee(N)};function Y(N,A){if(N.indexOf)return N.indexOf(A);for(var _=0,C=N.length;_<C;++_)if(N[_]==A)return _;return-1}function B(N,A,_,C,O){if(!q.scanForClosingTag)return!1;var x=Math.min(N.lastLine()+1,C.line+500),w=q.scanForClosingTag(N,C,null,x);if(!w||w.tag!=_)return!1;for(var M=O?1:0,m=A.length-1;m>=0&&A[m]==_;m--)++M;C=w.to;for(var m=1;m<M;m++){var v=q.scanForClosingTag(N,C,null,x);if(!v||v.tag!=_)return!1;C=v.to}return!0}})},BjJ7:function(rt,ue,l){"use strict";l.d(ue,"d",function(){return _e}),l.d(ue,"c",function(){return me}),l.d(ue,"e",function(){return we}),l.d(ue,"b",function(){return Ee}),l.d(ue,"a",function(){return Y});var q=l("m3rI");function _e(B){var N=!0;if(B.length>0){for(var A=0;A<B.length;A++)if(B[A].compile_success==0||!B[A].compile_success){N=!1;break}}else N=!1;return N}function me(B){for(var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",A=[],_=0;_<B.length;_++){var C=B[_],O=N?"".concat(N,"/").concat(C.name):"".concat(C.name);A.push({title:C.name,isLeaf:!(C.type==="tree"),key:O})}return A}function we(B,N,A){for(var _=0;_<B.length;_++){var C=B[_];if(C.key===N){C.children=A;break}C.children&&we(C.children,N,A)}return B}function Ee(B,N,A){var _;return function(){var C=this,O=arguments,x=function(){_=null,A||B.apply(C,O)},w=A&&!_;clearTimeout(_),_=setTimeout(x,N),w&&B.apply(C,O)}}var fe=!0,Y=q.a.API_SERVER},"C+DQ":function(rt,ue,l){},"C/vA":function(rt,ue,l){"use strict";l.d(ue,"a",function(){return q});function q(_e){var me=this,we=!1,Ee;return function(){return we||(we=!0,Ee=_e.apply(me,arguments)),Ee}}},"Cg/j":function(rt,ue,l){"use strict";l.d(ue,"b",function(){return q}),l.d(ue,"a",function(){return _e}),l.d(ue,"c",function(){return we}),l.d(ue,"d",function(){return Ee});var q;(function(fe){fe.serviceIds=new Map,fe.DI_TARGET="$di$target",fe.DI_DEPENDENCIES="$di$dependencies";function Y(B){return B[fe.DI_DEPENDENCIES]||[]}fe.getServiceDependencies=Y})(q||(q={}));var _e=we("instantiationService");function me(fe,Y,B,N){Y[q.DI_TARGET]===Y?Y[q.DI_DEPENDENCIES].push({id:fe,index:B,optional:N}):(Y[q.DI_DEPENDENCIES]=[{id:fe,index:B,optional:N}],Y[q.DI_TARGET]=Y)}function we(fe){if(q.serviceIds.has(fe))return q.serviceIds.get(fe);var Y=function(B,N,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");me(Y,B,A,!1)};return Y.toString=function(){return fe},q.serviceIds.set(fe,Y),Y}function Ee(fe){return function(Y,B,N){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");me(fe,Y,N,!0)}}},DlQD:function(rt,ue,l){(function(q,_e){rt.exports=_e()})(this,function(){"use strict";function q($,ne){for(var ie=0;ie<ne.length;ie++){var P=ne[ie];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty($,P.key,P)}}function _e($,ne,ie){return ne&&q($.prototype,ne),ie&&q($,ie),$}function me($,ne){if(!$)return;if(typeof $=="string")return we($,ne);var ie=Object.prototype.toString.call($).slice(8,-1);if(ie==="Object"&&$.constructor&&(ie=$.constructor.name),ie==="Map"||ie==="Set")return Array.from($);if(ie==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ie))return we($,ne)}function we($,ne){(ne==null||ne>$.length)&&(ne=$.length);for(var ie=0,P=new Array(ne);ie<ne;ie++)P[ie]=$[ie];return P}function Ee($,ne){var ie;if(typeof Symbol=="undefined"||$[Symbol.iterator]==null){if(Array.isArray($)||(ie=me($))||ne&&$&&typeof $.length=="number"){ie&&($=ie);var P=0;return function(){return P>=$.length?{done:!0}:{done:!1,value:$[P++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return ie=$[Symbol.iterator](),ie.next.bind(ie)}function fe($,ne){return ne={exports:{}},$(ne,ne.exports),ne.exports}var Y=fe(function($){function ne(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function ie(P){$.exports.defaults=P}$.exports={defaults:ne(),getDefaults:ne,changeDefaults:ie}}),B=Y.defaults,N=Y.getDefaults,A=Y.changeDefaults,_=/[&<>"']/,C=/[&<>"']/g,O=/[<>"']|&(?!#?\w+;)/,x=/[<>"']|&(?!#?\w+;)/g,w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},M=function(ne){return w[ne]};function m($,ne){if(ne){if(_.test($))return $.replace(C,M)}else if(O.test($))return $.replace(x,M);return $}var v=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function f($){return $.replace(v,function(ne,ie){return ie=ie.toLowerCase(),ie==="colon"?":":ie.charAt(0)==="#"?ie.charAt(1)==="x"?String.fromCharCode(parseInt(ie.substring(2),16)):String.fromCharCode(+ie.substring(1)):""})}var L=/(^|[^\[])\^/g;function ee($,ne){$=$.source||$,ne=ne||"";var ie={replace:function(D,X){return X=X.source||X,X=X.replace(L,"$1"),$=$.replace(D,X),ie},getRegex:function(){return new RegExp($,ne)}};return ie}var oe=/[^\w:]/g,F=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b($,ne,ie){if($){var P;try{P=decodeURIComponent(f(ie)).replace(oe,"").toLowerCase()}catch(D){return null}if(P.indexOf("javascript:")===0||P.indexOf("vbscript:")===0||P.indexOf("data:")===0)return null}ne&&!F.test(ie)&&(ie=S(ne,ie));try{ie=encodeURI(ie).replace(/%25/g,"%")}catch(D){return null}return ie}var se={},j=/^[^:]+:\/*[^/]*$/,re=/^([^:]+:)[\s\S]*$/,k=/^([^:]+:\/*[^/]*)[\s\S]*$/;function S($,ne){se[" "+$]||(j.test($)?se[" "+$]=$+"/":se[" "+$]=K($,"/",!0)),$=se[" "+$];var ie=$.indexOf(":")===-1;return ne.substring(0,2)==="//"?ie?ne:$.replace(re,"$1")+ne:ne.charAt(0)==="/"?ie?ne:$.replace(k,"$1")+ne:$+ne}var Q={exec:function(){}};function z($){for(var ne=1,ie,P;ne<arguments.length;ne++){ie=arguments[ne];for(P in ie)Object.prototype.hasOwnProperty.call(ie,P)&&($[P]=ie[P])}return $}function U($,ne){var ie=$.replace(/\|/g,function(X,V,xe){for(var ve=!1,Oe=V;--Oe>=0&&xe[Oe]==="\\";)ve=!ve;return ve?"|":" |"}),P=ie.split(/ \|/),D=0;if(P.length>ne)P.splice(ne);else for(;P.length<ne;)P.push("");for(;D<P.length;D++)P[D]=P[D].trim().replace(/\\\|/g,"|");return P}function K($,ne,ie){var P=$.length;if(P===0)return"";for(var D=0;D<P;){var X=$.charAt(P-D-1);if(X===ne&&!ie)D++;else if(X!==ne&&ie)D++;else break}return $.substr(0,P-D)}function de($,ne){if($.indexOf(ne[1])===-1)return-1;for(var ie=$.length,P=0,D=0;D<ie;D++)if($[D]==="\\")D++;else if($[D]===ne[0])P++;else if($[D]===ne[1]&&(P--,P<0))return D;return-1}function J($){$&&$.sanitize&&!$.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 be={escape:m,unescape:f,edit:ee,cleanUrl:b,resolveUrl:S,noopTest:Q,merge:z,splitCells:U,rtrim:K,findClosingBracket:de,checkSanitizeDeprecation:J},I=Y.defaults,y=be.rtrim,pe=be.splitCells,Ue=be.escape,De=be.findClosingBracket;function nt($,ne,ie){var P=ne.href,D=ne.title?Ue(ne.title):null,X=$[1].replace(/\\([\[\]])/g,"$1");return $[0].charAt(0)!=="!"?{type:"link",raw:ie,href:P,title:D,text:X}:{type:"image",raw:ie,href:P,title:D,text:Ue(X)}}function Ne($,ne){var ie=$.match(/^(\s+)(?:```)/);if(ie===null)return ne;var P=ie[1];return ne.split(`
`).map(function(D){var X=D.match(/^\s+/);if(X===null)return D;var V=X[0];return V.length>=P.length?D.slice(P.length):D}).join(`
`)}var Pe=function(){function $(ie){this.options=ie||I}var ne=$.prototype;return ne.space=function(P){var D=this.rules.block.newline.exec(P);if(D)return D[0].length>1?{type:"space",raw:D[0]}:{raw:`
`}},ne.code=function(P,D){var X=this.rules.block.code.exec(P);if(X){var V=D[D.length-1];if(V&&V.type==="paragraph")return{raw:X[0],text:X[0].trimRight()};var xe=X[0].replace(/^ {4}/gm,"");return{type:"code",raw:X[0],codeBlockStyle:"indented",text:this.options.pedantic?xe:y(xe,`
`)}}},ne.fences=function(P){var D=this.rules.block.fences.exec(P);if(D){var X=D[0],V=Ne(X,D[3]||"");return{type:"code",raw:X,lang:D[2]?D[2].trim():D[2],text:V}}},ne.heading=function(P){var D=this.rules.block.heading.exec(P);if(D)return{type:"heading",raw:D[0],depth:D[1].length,text:D[2]}},ne.nptable=function(P){var D=this.rules.block.nptable.exec(P);if(D){var X={type:"table",header:pe(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split(`
`):[],raw:D[0]};if(X.header.length===X.align.length){var V=X.align.length,xe;for(xe=0;xe<V;xe++)/^ *-+: *$/.test(X.align[xe])?X.align[xe]="right":/^ *:-+: *$/.test(X.align[xe])?X.align[xe]="center":/^ *:-+ *$/.test(X.align[xe])?X.align[xe]="left":X.align[xe]=null;for(V=X.cells.length,xe=0;xe<V;xe++)X.cells[xe]=pe(X.cells[xe],X.header.length);return X}}},ne.hr=function(P){var D=this.rules.block.hr.exec(P);if(D)return{type:"hr",raw:D[0]}},ne.blockquote=function(P){var D=this.rules.block.blockquote.exec(P);if(D){var X=D[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:D[0],text:X}}},ne.list=function(P){var D=this.rules.block.list.exec(P);if(D){for(var X=D[0],V=D[2],xe=V.length>1,ve=V[V.length-1]===")",Oe={type:"list",raw:X,ordered:xe,start:xe?+V.slice(0,-1):"",loose:!1,items:[]},lt=D[0].match(this.rules.block.item),Ye=!1,je,pt,Ut,ut,$t,ot,Xt,Wt=lt.length,St=0;St<Wt;St++)je=lt[St],X=je,pt=je.length,je=je.replace(/^ *([*+-]|\d+[.)]) */,""),~je.indexOf(`
`)&&(pt-=je.length,je=this.options.pedantic?je.replace(/^ {1,4}/gm,""):je.replace(new RegExp("^ {1,"+pt+"}","gm"),"")),St!==Wt-1&&(Ut=this.rules.block.bullet.exec(lt[St+1])[0],(xe?Ut.length===1||!ve&&Ut[Ut.length-1]===")":Ut.length>1||this.options.smartLists&&Ut!==V)&&(ut=lt.slice(St+1).join(`
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-ut.length),St=Wt-1)),$t=Ye||/\n\n(?!\s*$)/.test(je),St!==Wt-1&&(Ye=je.charAt(je.length-1)===`
`,$t||($t=Ye)),$t&&(Oe.loose=!0),ot=/^\[[ xX]\] /.test(je),Xt=void 0,ot&&(Xt=je[1]!==" ",je=je.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:X,task:ot,checked:Xt,loose:$t,text:je});return Oe}},ne.html=function(P){var D=this.rules.block.html.exec(P);if(D)return{type:this.options.sanitize?"paragraph":"html",raw:D[0],pre:!this.options.sanitizer&&(D[1]==="pre"||D[1]==="script"||D[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(D[0]):Ue(D[0]):D[0]}},ne.def=function(P){var D=this.rules.block.def.exec(P);if(D){D[3]&&(D[3]=D[3].substring(1,D[3].length-1));var X=D[1].toLowerCase().replace(/\s+/g," ");return{tag:X,raw:D[0],href:D[2],title:D[3]}}},ne.table=function(P){var D=this.rules.block.table.exec(P);if(D){var X={type:"table",header:pe(D[1].replace(/^ *| *\| *$/g,"")),align:D[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:D[3]?D[3].replace(/\n$/,"").split(`
`):[]};if(X.header.length===X.align.length){X.raw=D[0];var V=X.align.length,xe;for(xe=0;xe<V;xe++)/^ *-+: *$/.test(X.align[xe])?X.align[xe]="right":/^ *:-+: *$/.test(X.align[xe])?X.align[xe]="center":/^ *:-+ *$/.test(X.align[xe])?X.align[xe]="left":X.align[xe]=null;for(V=X.cells.length,xe=0;xe<V;xe++)X.cells[xe]=pe(X.cells[xe].replace(/^ *\| *| *\| *$/g,""),X.header.length);return X}}},ne.lheading=function(P){var D=this.rules.block.lheading.exec(P);if(D)return{type:"heading",raw:D[0],depth:D[2].charAt(0)==="="?1:2,text:D[1]}},ne.paragraph=function(P){var D=this.rules.block.paragraph.exec(P);if(D)return{type:"paragraph",raw:D[0],text:D[1].charAt(D[1].length-1)===`
`?D[1].slice(0,-1):D[1]}},ne.text=function(P,D){var X=this.rules.block.text.exec(P);if(X){var V=D[D.length-1];return V&&V.type==="text"?{raw:X[0],text:X[0]}:{type:"text",raw:X[0],text:X[0]}}},ne.escape=function(P){var D=this.rules.inline.escape.exec(P);if(D)return{type:"escape",raw:D[0],text:Ue(D[1])}},ne.tag=function(P,D,X){var V=this.rules.inline.tag.exec(P);if(V)return!D&&/^<a /i.test(V[0])?D=!0:D&&/^<\/a>/i.test(V[0])&&(D=!1),!X&&/^<(pre|code|kbd|script)(\s|>)/i.test(V[0])?X=!0:X&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(V[0])&&(X=!1),{type:this.options.sanitize?"text":"html",raw:V[0],inLink:D,inRawBlock:X,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(V[0]):Ue(V[0]):V[0]}},ne.link=function(P){var D=this.rules.inline.link.exec(P);if(D){var X=De(D[2],"()");if(X>-1){var V=D[0].indexOf("!")===0?5:4,xe=V+D[1].length+X;D[2]=D[2].substring(0,X),D[0]=D[0].substring(0,xe).trim(),D[3]=""}var ve=D[2],Oe="";if(this.options.pedantic){var lt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ve);lt?(ve=lt[1],Oe=lt[3]):Oe=""}else Oe=D[3]?D[3].slice(1,-1):"";ve=ve.trim().replace(/^<([\s\S]*)>$/,"$1");var Ye=nt(D,{href:ve&&ve.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},D[0]);return Ye}},ne.reflink=function(P,D){var X;if((X=this.rules.inline.reflink.exec(P))||(X=this.rules.inline.nolink.exec(P))){var V=(X[2]||X[1]).replace(/\s+/g," ");if(V=D[V.toLowerCase()],!V||!V.href){var xe=X[0].charAt(0);return{type:"text",raw:xe,text:xe}}var ve=nt(X,V,X[0]);return ve}},ne.strong=function(P,D,X){X===void 0&&(X="");var V=this.rules.inline.strong.start.exec(P);if(V&&(!V[1]||V[1]&&(X===""||this.rules.inline.punctuation.exec(X)))){D=D.slice(-1*P.length);var xe=V[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;xe.lastIndex=0;for(var ve;(V=xe.exec(D))!=null;)if(ve=this.rules.inline.strong.middle.exec(D.slice(0,V.index+3)),ve)return{type:"strong",raw:P.slice(0,ve[0].length),text:P.slice(2,ve[0].length-2)}}},ne.em=function(P,D,X){X===void 0&&(X="");var V=this.rules.inline.em.start.exec(P);if(V&&(!V[1]||V[1]&&(X===""||this.rules.inline.punctuation.exec(X)))){D=D.slice(-1*P.length);var xe=V[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;xe.lastIndex=0;for(var ve;(V=xe.exec(D))!=null;)if(ve=this.rules.inline.em.middle.exec(D.slice(0,V.index+2)),ve)return{type:"em",raw:P.slice(0,ve[0].length),text:P.slice(1,ve[0].length-1)}}},ne.codespan=function(P){var D=this.rules.inline.code.exec(P);if(D){var X=D[2].replace(/\n/g," "),V=/[^ ]/.test(X),xe=X.startsWith(" ")&&X.endsWith(" ");return V&&xe&&(X=X.substring(1,X.length-1)),X=Ue(X,!0),{type:"codespan",raw:D[0],text:X}}},ne.br=function(P){var D=this.rules.inline.br.exec(P);if(D)return{type:"br",raw:D[0]}},ne.del=function(P){var D=this.rules.inline.del.exec(P);if(D)return{type:"del",raw:D[0],text:D[1]}},ne.autolink=function(P,D){var X=this.rules.inline.autolink.exec(P);if(X){var V,xe;return X[2]==="@"?(V=Ue(this.options.mangle?D(X[1]):X[1]),xe="mailto:"+V):(V=Ue(X[1]),xe=V),{type:"link",raw:X[0],text:V,href:xe,tokens:[{type:"text",raw:V,text:V}]}}},ne.url=function(P,D){var X;if(X=this.rules.inline.url.exec(P)){var V,xe;if(X[2]==="@")V=Ue(this.options.mangle?D(X[0]):X[0]),xe="mailto:"+V;else{var ve;do ve=X[0],X[0]=this.rules.inline._backpedal.exec(X[0])[0];while(ve!==X[0]);V=Ue(X[0]),X[1]==="www."?xe="http://"+V:xe=V}return{type:"link",raw:X[0],text:V,href:xe,tokens:[{type:"text",raw:V,text:V}]}}},ne.inlineText=function(P,D,X){var V=this.rules.inline.text.exec(P);if(V){var xe;return D?xe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(V[0]):Ue(V[0]):V[0]:xe=Ue(this.options.smartypants?X(V[0]):V[0]),{type:"text",raw:V[0],text:xe}}},$}(),ae=be.noopTest,Z=be.edit,ye=be.merge,W={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:ae,table:ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};W._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,W._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,W.def=Z(W.def).replace("label",W._label).replace("title",W._title).getRegex(),W.bullet=/(?:[*+-]|\d{1,9}[.)])/,W.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,W.item=Z(W.item,"gm").replace(/bull/g,W.bullet).getRegex(),W.list=Z(W.list).replace(/bull/g,W.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+W.def.source+")").getRegex(),W._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",W._comment=/<!--(?!-?>)[\s\S]*?-->/,W.html=Z(W.html,"i").replace("comment",W._comment).replace("tag",W._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),W.paragraph=Z(W._paragraph).replace("hr",W.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",W._tag).getRegex(),W.blockquote=Z(W.blockquote).replace("paragraph",W.paragraph).getRegex(),W.normal=ye({},W),W.gfm=ye({},W.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*|$)"}),W.gfm.nptable=Z(W.gfm.nptable).replace("hr",W.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",W._tag).getRegex(),W.gfm.table=Z(W.gfm.table).replace("hr",W.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",W._tag).getRegex(),W.pedantic=ye({},W.normal,{html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",W._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:ae,paragraph:Z(W.normal._paragraph).replace("hr",W.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",W.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var T={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ae,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:ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};T._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",T.punctuation=Z(T.punctuation).replace(/punctuation/g,T._punctuation).getRegex(),T._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",T._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",T.em.start=Z(T.em.start).replace(/punctuation/g,T._punctuation).getRegex(),T.em.middle=Z(T.em.middle).replace(/punctuation/g,T._punctuation).replace(/overlapSkip/g,T._overlapSkip).getRegex(),T.em.endAst=Z(T.em.endAst,"g").replace(/punctuation/g,T._punctuation).getRegex(),T.em.endUnd=Z(T.em.endUnd,"g").replace(/punctuation/g,T._punctuation).getRegex(),T.strong.start=Z(T.strong.start).replace(/punctuation/g,T._punctuation).getRegex(),T.strong.middle=Z(T.strong.middle).replace(/punctuation/g,T._punctuation).replace(/blockSkip/g,T._blockSkip).getRegex(),T.strong.endAst=Z(T.strong.endAst,"g").replace(/punctuation/g,T._punctuation).getRegex(),T.strong.endUnd=Z(T.strong.endUnd,"g").replace(/punctuation/g,T._punctuation).getRegex(),T.blockSkip=Z(T._blockSkip,"g").getRegex(),T.overlapSkip=Z(T._overlapSkip,"g").getRegex(),T._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,T._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,T._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])?)+(?![-_])/,T.autolink=Z(T.autolink).replace("scheme",T._scheme).replace("email",T._email).getRegex(),T._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,T.tag=Z(T.tag).replace("comment",W._comment).replace("attribute",T._attribute).getRegex(),T._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,T._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,T._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,T.link=Z(T.link).replace("label",T._label).replace("href",T._href).replace("title",T._title).getRegex(),T.reflink=Z(T.reflink).replace("label",T._label).getRegex(),T.reflinkSearch=Z(T.reflinkSearch,"g").replace("reflink",T.reflink).replace("nolink",T.nolink).getRegex(),T.normal=ye({},T),T.pedantic=ye({},T.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:Z(/^!?\[(label)\]\((.*?)\)/).replace("label",T._label).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",T._label).getRegex()}),T.gfm=ye({},T.normal,{escape:Z(T.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),T.gfm.url=Z(T.gfm.url,"i").replace("email",T.gfm._extended_email).getRegex(),T.breaks=ye({},T.gfm,{br:Z(T.br).replace("{2,}","*").getRegex(),text:Z(T.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ce={block:W,inline:T},We=Y.defaults,Ze=Ce.block,Be=Ce.inline;function H($){return $.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function G($){var ne="",ie,P,D=$.length;for(ie=0;ie<D;ie++)P=$.charCodeAt(ie),Math.random()>.5&&(P="x"+P.toString(16)),ne+="&#"+P+";";return ne}var he=function(){function $(ie){this.tokens=[],this.tokens.links=Object.create(null),this.options=ie||We,this.options.tokenizer=this.options.tokenizer||new Pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var P={block:Ze.normal,inline:Be.normal};this.options.pedantic?(P.block=Ze.pedantic,P.inline=Be.pedantic):this.options.gfm&&(P.block=Ze.gfm,this.options.breaks?P.inline=Be.breaks:P.inline=Be.gfm),this.tokenizer.rules=P}$.lex=function(P,D){var X=new $(D);return X.lex(P)};var ne=$.prototype;return ne.lex=function(P){return P=P.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(P,this.tokens,!0),this.inline(this.tokens),this.tokens},ne.blockTokens=function(P,D,X){D===void 0&&(D=[]),X===void 0&&(X=!0),P=P.replace(/^ +$/gm,"");for(var V,xe,ve,Oe;P;){if(V=this.tokenizer.space(P)){P=P.substring(V.raw.length),V.type&&D.push(V);continue}if(V=this.tokenizer.code(P,D)){P=P.substring(V.raw.length),V.type?D.push(V):(Oe=D[D.length-1],Oe.raw+=`
`+V.raw,Oe.text+=`
`+V.text);continue}if(V=this.tokenizer.fences(P)){P=P.substring(V.raw.length),D.push(V);continue}if(V=this.tokenizer.heading(P)){P=P.substring(V.raw.length),D.push(V);continue}if(V=this.tokenizer.nptable(P)){P=P.substring(V.raw.length),D.push(V);continue}if(V=this.tokenizer.hr(P)){P=P.substring(V.raw.length),D.push(V);continue}if(V=this.tokenizer.blockquote(P)){P=P.substring(V.raw.length),V.tokens=this.blockTokens(V.text,[],X),D.push(V);continue}if(V=this.tokenizer.list(P)){for(P=P.substring(V.raw.length),ve=V.items.length,xe=0;xe<ve;xe++)V.items[xe].tokens=this.blockTokens(V.items[xe].text,[],!1);D.push(V);continue}if(V=this.tokenizer.html(P)){P=P.substring(V.raw.length),D.push(V);continue}if(X&&(V=this.tokenizer.def(P))){P=P.substring(V.raw.length),this.tokens.links[V.tag]||(this.tokens.links[V.tag]={href:V.href,title:V.title});continue}if(V=this.tokenizer.table(P)){P=P.substring(V.raw.length),D.push(V);continue}if(V=this.tokenizer.lheading(P)){P=P.substring(V.raw.length),D.push(V);continue}if(X&&(V=this.tokenizer.paragraph(P))){P=P.substring(V.raw.length),D.push(V);continue}if(V=this.tokenizer.text(P,D)){P=P.substring(V.raw.length),V.type?D.push(V):(Oe=D[D.length-1],Oe.raw+=`
`+V.raw,Oe.text+=`
`+V.text);continue}if(P){var lt="Infinite loop on byte: "+P.charCodeAt(0);if(this.options.silent){console.error(lt);break}else throw new Error(lt)}}return D},ne.inline=function(P){var D,X,V,xe,ve,Oe,lt=P.length;for(D=0;D<lt;D++){Oe=P[D];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},xe=Oe.header.length,X=0;X<xe;X++)Oe.tokens.header[X]=[],this.inlineTokens(Oe.header[X],Oe.tokens.header[X]);for(xe=Oe.cells.length,X=0;X<xe;X++)for(ve=Oe.cells[X],Oe.tokens.cells[X]=[],V=0;V<ve.length;V++)Oe.tokens.cells[X][V]=[],this.inlineTokens(ve[V],Oe.tokens.cells[X][V]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(xe=Oe.items.length,X=0;X<xe;X++)this.inline(Oe.items[X].tokens);break}}}return P},ne.inlineTokens=function(P,D,X,V,xe){D===void 0&&(D=[]),X===void 0&&(X=!1),V===void 0&&(V=!1),xe===void 0&&(xe="");var ve,Oe=P,lt;if(this.tokens.links){var Ye=Object.keys(this.tokens.links);if(Ye.length>0)for(;(lt=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)Ye.includes(lt[0].slice(lt[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(lt=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,lt.index)+"["+"a".repeat(lt[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;P;){if(ve=this.tokenizer.escape(P)){P=P.substring(ve.raw.length),D.push(ve);continue}if(ve=this.tokenizer.tag(P,X,V)){P=P.substring(ve.raw.length),X=ve.inLink,V=ve.inRawBlock,D.push(ve);continue}if(ve=this.tokenizer.link(P)){P=P.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,V)),D.push(ve);continue}if(ve=this.tokenizer.reflink(P,this.tokens.links)){P=P.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,V)),D.push(ve);continue}if(ve=this.tokenizer.strong(P,Oe,xe)){P=P.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],X,V),D.push(ve);continue}if(ve=this.tokenizer.em(P,Oe,xe)){P=P.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],X,V),D.push(ve);continue}if(ve=this.tokenizer.codespan(P)){P=P.substring(ve.raw.length),D.push(ve);continue}if(ve=this.tokenizer.br(P)){P=P.substring(ve.raw.length),D.push(ve);continue}if(ve=this.tokenizer.del(P)){P=P.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],X,V),D.push(ve);continue}if(ve=this.tokenizer.autolink(P,G)){P=P.substring(ve.raw.length),D.push(ve);continue}if(!X&&(ve=this.tokenizer.url(P,G))){P=P.substring(ve.raw.length),D.push(ve);continue}if(ve=this.tokenizer.inlineText(P,V,H)){P=P.substring(ve.raw.length),xe=ve.raw.slice(-1),D.push(ve);continue}if(P){var je="Infinite loop on byte: "+P.charCodeAt(0);if(this.options.silent){console.error(je);break}else throw new Error(je)}}return D},_e($,null,[{key:"rules",get:function(){return{block:Ze,inline:Be}}}]),$}(),ke=Y.defaults,Me=be.cleanUrl,Ge=be.escape,et=function(){function $(ie){this.options=ie||ke}var ne=$.prototype;return ne.code=function(P,D,X){var V=(D||"").match(/\S*/)[0];if(this.options.highlight){var xe=this.options.highlight(P,V);xe!=null&&xe!==P&&(X=!0,P=xe)}return V?'<pre><code class="'+this.options.langPrefix+Ge(V,!0)+'">'+(X?P:Ge(P,!0))+`</code></pre>
`:"<pre><code>"+(X?P:Ge(P,!0))+`</code></pre>
`},ne.blockquote=function(P){return`<blockquote>
`+P+`</blockquote>
`},ne.html=function(P){return P},ne.heading=function(P,D,X,V){return this.options.headerIds?"<h"+D+' id="'+this.options.headerPrefix+V.slug(X)+'">'+P+"</h"+D+`>
`:"<h"+D+">"+P+"</h"+D+`>
`},ne.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ne.list=function(P,D,X){var V=D?"ol":"ul",xe=D&&X!==1?' start="'+X+'"':"";return"<"+V+xe+`>
`+P+"</"+V+`>
`},ne.listitem=function(P){return"<li>"+P+`</li>
`},ne.checkbox=function(P){return"<input "+(P?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ne.paragraph=function(P){return"<p>"+P+`</p>
`},ne.table=function(P,D){return D&&(D="<tbody>"+D+"</tbody>"),`<table>
<thead>
`+P+`</thead>
`+D+`</table>
`},ne.tablerow=function(P){return`<tr>
`+P+`</tr>
`},ne.tablecell=function(P,D){var X=D.header?"th":"td",V=D.align?"<"+X+' align="'+D.align+'">':"<"+X+">";return V+P+"</"+X+`>
`},ne.strong=function(P){return"<strong>"+P+"</strong>"},ne.em=function(P){return"<em>"+P+"</em>"},ne.codespan=function(P){return"<code>"+P+"</code>"},ne.br=function(){return this.options.xhtml?"<br/>":"<br>"},ne.del=function(P){return"<del>"+P+"</del>"},ne.link=function(P,D,X){if(P=Me(this.options.sanitize,this.options.baseUrl,P),P===null)return X;var V='<a href="'+Ge(P)+'"';return D&&(V+=' title="'+D+'"'),V+=">"+X+"</a>",V},ne.image=function(P,D,X){if(P=Me(this.options.sanitize,this.options.baseUrl,P),P===null)return X;var V='<img src="'+P+'" alt="'+X+'"';return D&&(V+=' title="'+D+'"'),V+=this.options.xhtml?"/>":">",V},ne.text=function(P){return P},$}(),Ke=function(){function $(){}var ne=$.prototype;return ne.strong=function(P){return P},ne.em=function(P){return P},ne.codespan=function(P){return P},ne.del=function(P){return P},ne.html=function(P){return P},ne.text=function(P){return P},ne.link=function(P,D,X){return""+X},ne.image=function(P,D,X){return""+X},ne.br=function(){return""},$}(),yt=function(){function $(){this.seen={}}var ne=$.prototype;return ne.slug=function(P){var D=P.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(D)){var X=D;do this.seen[X]++,D=X+"-"+this.seen[X];while(this.seen.hasOwnProperty(D))}return this.seen[D]=0,D},$}(),ct=Y.defaults,gt=be.unescape,st=function(){function $(ie){this.options=ie||ct,this.options.renderer=this.options.renderer||new et,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ke,this.slugger=new yt}$.parse=function(P,D){var X=new $(D);return X.parse(P)};var ne=$.prototype;return ne.parse=function(P,D){D===void 0&&(D=!0);var X="",V,xe,ve,Oe,lt,Ye,je,pt,Ut,ut,$t,ot,Xt,Wt,St,Yt,zt,Je,ze=P.length;for(V=0;V<ze;V++){ut=P[V];switch(ut.type){case"space":continue;case"hr":{X+=this.renderer.hr();continue}case"heading":{X+=this.renderer.heading(this.parseInline(ut.tokens),ut.depth,gt(this.parseInline(ut.tokens,this.textRenderer)),this.slugger);continue}case"code":{X+=this.renderer.code(ut.text,ut.lang,ut.escaped);continue}case"table":{for(pt="",je="",Oe=ut.header.length,xe=0;xe<Oe;xe++)je+=this.renderer.tablecell(this.parseInline(ut.tokens.header[xe]),{header:!0,align:ut.align[xe]});for(pt+=this.renderer.tablerow(je),Ut="",Oe=ut.cells.length,xe=0;xe<Oe;xe++){for(Ye=ut.tokens.cells[xe],je="",lt=Ye.length,ve=0;ve<lt;ve++)je+=this.renderer.tablecell(this.parseInline(Ye[ve]),{header:!1,align:ut.align[ve]});Ut+=this.renderer.tablerow(je)}X+=this.renderer.table(pt,Ut);continue}case"blockquote":{Ut=this.parse(ut.tokens),X+=this.renderer.blockquote(Ut);continue}case"list":{for($t=ut.ordered,ot=ut.start,Xt=ut.loose,Oe=ut.items.length,Ut="",xe=0;xe<Oe;xe++)St=ut.items[xe],Yt=St.checked,zt=St.task,Wt="",St.task&&(Je=this.renderer.checkbox(Yt),Xt?St.tokens.length>0&&St.tokens[0].type==="text"?(St.tokens[0].text=Je+" "+St.tokens[0].text,St.tokens[0].tokens&&St.tokens[0].tokens.length>0&&St.tokens[0].tokens[0].type==="text"&&(St.tokens[0].tokens[0].text=Je+" "+St.tokens[0].tokens[0].text)):St.tokens.unshift({type:"text",text:Je}):Wt+=Je),Wt+=this.parse(St.tokens,Xt),Ut+=this.renderer.listitem(Wt,zt,Yt);X+=this.renderer.list(Ut,$t,ot);continue}case"html":{X+=this.renderer.html(ut.text);continue}case"paragraph":{X+=this.renderer.paragraph(this.parseInline(ut.tokens));continue}case"text":{for(Ut=ut.tokens?this.parseInline(ut.tokens):ut.text;V+1<ze&&P[V+1].type==="text";)ut=P[++V],Ut+=`
`+(ut.tokens?this.parseInline(ut.tokens):ut.text);X+=D?this.renderer.paragraph(Ut):Ut;continue}default:{var Ae='Token with "'+ut.type+'" type was not found.';if(this.options.silent){console.error(Ae);return}else throw new Error(Ae)}}}return X},ne.parseInline=function(P,D){D=D||this.renderer;var X="",V,xe,ve=P.length;for(V=0;V<ve;V++){xe=P[V];switch(xe.type){case"escape":{X+=D.text(xe.text);break}case"html":{X+=D.html(xe.text);break}case"link":{X+=D.link(xe.href,xe.title,this.parseInline(xe.tokens,D));break}case"image":{X+=D.image(xe.href,xe.title,xe.text);break}case"strong":{X+=D.strong(this.parseInline(xe.tokens,D));break}case"em":{X+=D.em(this.parseInline(xe.tokens,D));break}case"codespan":{X+=D.codespan(xe.text);break}case"br":{X+=D.br();break}case"del":{X+=D.del(this.parseInline(xe.tokens,D));break}case"text":{X+=D.text(xe.text);break}default:{var Oe='Token with "'+xe.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return X},$}(),Ot=be.merge,xt=be.checkSanitizeDeprecation,wt=be.escape,Le=Y.getDefaults,ft=Y.changeDefaults,At=Y.defaults;function He($,ne,ie){if(typeof $=="undefined"||$===null)throw new Error("marked(): input parameter is undefined or null");if(typeof $!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call($)+", string expected");if(typeof ne=="function"&&(ie=ne,ne=null),ne=Ot({},He.defaults,ne||{}),xt(ne),ie){var P=ne.highlight,D;try{D=he.lex($,ne)}catch(ve){return ie(ve)}var X=function(Oe){var lt;if(!Oe)try{lt=st.parse(D,ne)}catch(Ye){Oe=Ye}return ne.highlight=P,Oe?ie(Oe):ie(null,lt)};if(!P||P.length<3)return X();if(delete ne.highlight,!D.length)return X();var V=0;He.walkTokens(D,function(ve){ve.type==="code"&&(V++,setTimeout(function(){P(ve.text,ve.lang,function(Oe,lt){if(Oe)return X(Oe);lt!=null&&lt!==ve.text&&(ve.text=lt,ve.escaped=!0),V--,V===0&&X()})},0))}),V===0&&X();return}try{var xe=he.lex($,ne);return ne.walkTokens&&He.walkTokens(xe,ne.walkTokens),st.parse(xe,ne)}catch(ve){if(ve.message+=`
Please report this to https://github.com/markedjs/marked.`,ne.silent)return"<p>An error occurred:</p><pre>"+wt(ve.message+"",!0)+"</pre>";throw ve}}He.options=He.setOptions=function($){return Ot(He.defaults,$),ft(He.defaults),He},He.getDefaults=Le,He.defaults=At,He.use=function($){var ne=Ot({},$);if($.renderer&&function(){var P=He.defaults.renderer||new et,D=function(xe){var ve=P[xe];P[xe]=function(){for(var Oe=arguments.length,lt=new Array(Oe),Ye=0;Ye<Oe;Ye++)lt[Ye]=arguments[Ye];var je=$.renderer[xe].apply(P,lt);return je===!1&&(je=ve.apply(P,lt)),je}};for(var X in $.renderer)D(X);ne.renderer=P}(),$.tokenizer&&function(){var P=He.defaults.tokenizer||new Pe,D=function(xe){var ve=P[xe];P[xe]=function(){for(var Oe=arguments.length,lt=new Array(Oe),Ye=0;Ye<Oe;Ye++)lt[Ye]=arguments[Ye];var je=$.tokenizer[xe].apply(P,lt);return je===!1&&(je=ve.apply(P,lt)),je}};for(var X in $.tokenizer)D(X);ne.tokenizer=P}(),$.walkTokens){var ie=He.defaults.walkTokens;ne.walkTokens=function(P){$.walkTokens(P),ie&&ie(P)}}He.setOptions(ne)},He.walkTokens=function($,ne){for(var ie=Ee($),P;!(P=ie()).done;){var D=P.value;ne(D);switch(D.type){case"table":{for(var X=Ee(D.tokens.header),V;!(V=X()).done;){var xe=V.value;He.walkTokens(xe,ne)}for(var ve=Ee(D.tokens.cells),Oe;!(Oe=ve()).done;)for(var lt=Oe.value,Ye=Ee(lt),je;!(je=Ye()).done;){var pt=je.value;He.walkTokens(pt,ne)}break}case"list":{He.walkTokens(D.items,ne);break}default:D.tokens&&He.walkTokens(D.tokens,ne)}}},He.Parser=st,He.parser=st.parse,He.Renderer=et,He.TextRenderer=Ke,He.Lexer=he,He.lexer=he.lex,He.Tokenizer=Pe,He.Slugger=yt,He.parse=He;var Xe=He;return Xe})},"Dvv+":function(rt,ue,l){"use strict";l.r(ue);var q=l("cWXX"),_e=l("/ezw"),me=l("+L6B"),we=l("2/Rp"),Ee=l("7Kak"),fe=l("9yH6"),Y=l("giR+"),B=l("fyUT"),N=l("9og8"),A=l("k1fw"),_=l("y8nQ"),C=l("Vl3Y"),O=l("tJVT"),x=l("5NDa"),w=l("5rEg"),M=l("WmNS"),m=l.n(M),v=l("q1tI"),f=l.n(v),L=l("Ty5D"),ee=l("9kvl"),oe=l("m3fD"),F=l.n(oe),b=l("A+k2"),se=l.n(b),j=function(xe){var ve=xe.value,Oe=ve===void 0?[]:ve,lt=xe.onChange,Ye=xe.className,je=Ye===void 0?"":Ye;return f.a.createElement("div",{className:"".concat(se.a.tabs," ").concat(je," ")},f.a.createElement("div",{onClick:function(){return lt(0)},className:Oe===0?se.a.active:""},f.a.createElement("div",null,"1"),f.a.createElement("div",null,"\u5F55\u5165\u4FE1\u606F")," "),f.a.createElement("div",{onClick:function(){return lt(1)},className:Oe===1?se.a.active:""},f.a.createElement("div",null,"2"),f.a.createElement("div",null,"\u914D\u7F6E\u7EC4\u5377")))},re=j,k=l("2qtc"),S=l("kLXV"),Q=l("sRBo"),z=l("kaz8"),U=l("5Dmo"),K=l("3S7+"),de=l("miYZ"),J=l("tsqr"),be=l("oBTY"),I=l("IlMy"),y=l.n(I),pe=l("WCUW"),Ue=l("QSKd"),De=l.n(Ue),nt=l("Hfvn"),Ne=l.n(nt),Pe=l("HPRh"),ae=l.n(Pe),Z=l("+RXH"),ye=l.n(Z),W=l("+yhJ"),T=l.n(W),Ce=l("RZ/O"),We=l.n(Ce),Ze=l("exQ7"),Be=l.n(Ze),H=l("HG2Q"),G=l.n(H),he=l("k4n4"),ke=l("eS0+"),Me=l("PpiC"),Ge=l("K5AI"),et=l.n(Ge),Ke=l("LvDl"),yt=z.a.Group,ct=function(xe){var ve=xe.value,Oe=ve===void 0?[]:ve,lt=xe.onChange,Ye=xe.options,je=xe.search,pt=Object(Me.a)(xe,["value","onChange","options","search"]),Ut=f.a.useState(!1),ut=Object(O.a)(Ut,2),$t=ut[0],ot=ut[1];Object(v.useEffect)(function(){var zt,Je=Ye==null||((zt=Ye.tag_disciplines)===null||zt===void 0)?void 0:zt.map(function(Ae){return Ae.id}),ze=Oe==null?void 0:Oe.filter(function(Ae){return Je.includes(Ae)});ot(ze.length===(Je==null?void 0:Je.length))},[Oe]);var Xt=function(Je){var ze,Ae,$e=Ye==null||((ze=Ye.tag_disciplines)===null||ze===void 0)?void 0:ze.map(function(Ft){return Ft.id}),Dt=Oe==null?void 0:Oe.filter(function(Ft){return $e.includes(Ft)}),Nt=Object(Ke.uniq)([].concat(Object(be.a)(Oe),Object(be.a)(Je)));if(Dt.length>Je.length){var Jt=Object(Ke.xor)(Dt,Je);console.log(Jt,"newLevel"),Nt=Nt.filter(function(Ft){return!Jt.includes(Ft)})}lt(Nt),ot(Je.length===(Ye==null||((Ae=Ye.tag_disciplines)===null||Ae===void 0)?void 0:Ae.length))},Wt=function(Je){var ze,Ae=Ye==null||((ze=Ye.tag_disciplines)===null||ze===void 0)?void 0:ze.map(function($e){return $e.id});lt(Je.target.checked?Object(Ke.uniq)([].concat(Object(be.a)(Oe),Object(be.a)(Ae))):Oe==null?void 0:Oe.filter(function($e){return!Ae.includes($e)})),ot(Je.target.checked)};console.log(Ye,"options");var St=function(){var Je,ze,Ae=(Ye==null?void 0:Ye.tag_disciplines)||[];if(je){var $e;Ae=($e=Ae)===null||$e===void 0?void 0:$e.filter(function(Dt){var Nt;return Dt==null||((Nt=Dt.name)===null||Nt===void 0)?void 0:Nt.includes(je)})}return Ae=(Je=Ae)===null||Je===void 0?void 0:Je.map(function(Dt){return Object(A.a)(Object(A.a)({},Dt),{},{label:"".concat(Dt.name,"(".concat(Dt==null?void 0:Dt.item_count,")")),value:Dt.id})}),Ae=(ze=Ae)===null||ze===void 0?void 0:ze.filter(function(Dt){return Dt.item_count!==0}),Ae},Yt=function(){var Je=!1;if(!je)Je=!0;else{var ze;(ze=Ye.tag_disciplines)===null||ze===void 0||ze.forEach(function(Ae){if(!Je){var $e;Je=(($e=Ae.name)===null||$e===void 0?void 0:$e.includes(je))&&Ae.item_count!==0}})}return Je};return(Ye==null?void 0:Ye.item_count)===0||!Yt()?f.a.createElement(f.a.Fragment,null):f.a.createElement("div",{className:et.a.cInput},f.a.createElement("div",{className:et.a.cl},f.a.createElement(z.a,{checked:$t,onChange:Wt},f.a.createElement("span",{className:et.a.box},f.a.createElement("span",{className:"font14 c-light-primary"},f.a.createElement("span",{title:Ye==null?void 0:Ye.name,className:et.a.box1}," ",Ye==null?void 0:Ye.name),f.a.createElement("span",null," ","(".concat(Ye==null?void 0:Ye.item_count,")"))),f.a.createElement("i",{className:"iconfont icon-lujing font12 ml5"})))),f.a.createElement("div",{className:et.a.cr},f.a.createElement(yt,{options:St(),value:Oe,onChange:Xt})))},gt=ct,st=l("ErOA"),Ot=l("ozfa"),xt=l("MJZm"),wt=l("0Owb"),Le=l("tmPe"),ft=l.n(Le),At=function(xe){var ve=xe.value,Oe=xe.onChange,lt=xe.defaultValue,Ye=xe.treeData,je=Ye===void 0?[]:Ye,pt=Object(Me.a)(xe,["value","onChange","defaultValue","treeData"]);return f.a.createElement("div",{className:ft.a.customTree},f.a.createElement(xt.a,Object(wt.a)({multiple:!0,showIcon:!0,selectedKeys:ve,defaultExpandedKeys:lt,treeData:je,onSelect:Oe},pt)))},He=At,Xe=l("sbIO"),$=w.a.Search,ne=function(xe){var ve,Oe=xe.formValue,lt=xe.setFatherTabs,Ye=xe.tabs,je=xe.editData,pt=xe.dispatch,Ut=Object(L.i)().id,ut=Object(v.useState)(["mine"]),$t=Object(O.a)(ut,2),ot=$t[0],Xt=$t[1],Wt=Object(v.useState)(!0),St=Object(O.a)(Wt,2),Yt=St[0],zt=St[1],Je=Object(v.useState)(!1),ze=Object(O.a)(Je,2),Ae=ze[0],$e=ze[1],Dt=Object(v.useState)(!1),Nt=Object(O.a)(Dt,2),Jt=Nt[0],Ft=Nt[1],_t=Object(v.useState)(""),an=Object(O.a)(_t,2),jt=an[0],cn=an[1],Kt=Object(v.useState)(!1),dn=Object(O.a)(Kt,2),Nn=dn[0],sn=dn[1],Fe=Object(v.useState)(!1),it=Object(O.a)(Fe,2),Gt=it[0],qt=it[1],nn=Object(v.useState)({}),ln=Object(O.a)(nn,2),u=ln[0],o=ln[1],a=Object(v.useState)([]),c=Object(O.a)(a,2),p=c[0],h=c[1],ce=Object(v.useState)([]),tt=Object(O.a)(ce,2),ht=tt[0],It=tt[1],Re=Object(v.useState)([]),ge=Object(O.a)(Re,2),qe=ge[0],Lt=ge[1],Pt=Object(v.useState)([]),Tt=Object(O.a)(Pt,2),Mt=Tt[0],mn=Tt[1],jn=Object(v.useState)(null),kn=Object(O.a)(jn,2),_n=kn[0],Ln=kn[1],Un=Object(v.useRef)([]),ti=Object(v.useState)(!1),wi=Object(O.a)(ti,2),Xn=wi[0],$n=wi[1],$i=Object(v.useState)([]),_i=Object(O.a)($i,2),An=_i[0],Fi=_i[1],ar=Object(v.useState)([0]),fr=Object(O.a)(ar,2),zn=fr[0],En=fr[1],li=Object(v.useState)([]),gn=Object(O.a)(li,2),Hn=gn[0],wn=gn[1],di=Object(v.useRef)([]),Yn=Object(v.useState)(!1),Ci=Object(O.a)(Yn,2),pr=Ci[0],nr=Ci[1],ir=Object(v.useState)([]),Sr=Object(O.a)(ir,2),Cn=Sr[0],Ji=Sr[1],Gi=Object(v.useState)([]),sr=Object(O.a)(Gi,2),Zi=sr[0],lr=sr[1],ur=Object(v.useRef)([]),no=Object(v.useState)([]),Vt=Object(O.a)(no,2),rn=Vt[0],Zt=Vt[1],hn=Object(v.useState)(!1),bn=Object(O.a)(hn,2),Rn=bn[0],yn=bn[1],Kn=Object(v.useRef)([]),Si=Object(v.useState)(0),fn=Object(O.a)(Si,2),rr=fn[0],vn=fn[1],Jn=Hn==null?void 0:Hn.filter(function(bt){return An==null?void 0:An.includes(bt.id)}),Wi=Zi==null?void 0:Zi.filter(function(bt){return Cn==null?void 0:Cn.includes(bt.id)});Object(v.useEffect)(function(){kr()},[]),Object(v.useEffect)(function(){return Ye===1&&(pt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),pt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){pt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),pt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[Ye]),Object(v.useEffect)(function(){Ut?je&&ui():(Fr(ot),mr(),zt(!1))},[je]),Object(v.useEffect)(function(){jt&&zi()},[jt]);var zi=function(){var dt=null;ht==null||ht.forEach(function(Ve){var Ie;(Ie=Ve.sub_disciplines)===null||Ie===void 0||Ie.forEach(function(Et){var vt;(vt=Et.tag_disciplines)===null||vt===void 0||vt.forEach(function(Ct){var en,un=((en=Ct.name)===null||en===void 0?void 0:en.includes(jt))&&Ct.item_count!==0;un&&!dt&&(dt=Ve.id)})})}),dt&&Ln(dt)},Br=function(dt){function Ve(Ie){var Et=Ie.children,vt=Array.isArray(Et)&&Et.length>0,Ct=Ie==null?void 0:Ie.group_id;return Kn.current.push({name:Ie==null?void 0:Ie.name,id:Ct,count:Ie==null?void 0:Ie.count}),{title:f.a.createElement("div",{title:Ie==null?void 0:Ie.name,className:y.a.name},Ie==null?void 0:Ie.name,"\uFF08".concat(Ie==null?void 0:Ie.count,"\uFF09")),value:Ct,name:Ie==null?void 0:Ie.name,key:Ct,count:Ie==null?void 0:Ie.count,id:Ct,icon:f.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:vt?Et==null?void 0:Et.map(function(en){return Ve(en)}):[]}}return dt==null?void 0:dt.map(function(Ie){return Ve(Ie)})},kr=function(){var bt=Object(N.a)(m.a.mark(function dt(){var Ve,Ie;return m.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return vt.next=2,Object(pe.y)({});case 2:Ve=vt.sent,Kn.current=[{id:0,name:"\u6839\u76EE\u5F55",count:Ve==null?void 0:Ve.root_count}],Ve!=null&&Ve.data&&(Ie=[{title:f.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:y.a.name},"\u6839\u76EE\u5F55","\uFF08".concat((Ve==null?void 0:Ve.root_count)||0,"\uFF09")),value:0,id:0,key:0,count:Ve==null?void 0:Ve.root_count,name:"\u6839\u76EE\u5F55",icon:f.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Br(Ve.data||[])}],wn(Kn.current),Zt(Ie));case 5:case"end":return vt.stop()}},dt)}));return function(){return bt.apply(this,arguments)}}(),ui=function(){var bt=Object(N.a)(m.a.mark(function dt(){var Ve,Ie,Et,vt,Ct,en,un,Pn,On,Mn,Sn,ni,Fn,Wn,hi,ri,qn,fi;return m.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:return Mn=je==null||((Ve=je.tag_disciplines)===null||Ve===void 0)?void 0:Ve.map(function(xn){return xn.tag_discipline_id}),Sn=je==null||((Ie=je.groups)===null||Ie===void 0)?void 0:Ie.map(function(xn){return xn.id}),ni={source:je==null||((Et=je.examination_bank)===null||Et===void 0)?void 0:Et.source,group_ids:Sn,tag_discipline_ids:Mn,teach_group_ids:je==null?void 0:je.teach_group_ids},on.next=5,Object(st.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:ni});case 5:if(Fn=on.sent,!((Fn==null?void 0:Fn.status)===-1)){on.next=8;break}return on.abrupt("return");case 8:Wn=Fn==null?void 0:Fn.filter(function(xn){var Zn;return!!(xn!=null&&(Zn=xn.item_banks)!==null&&Zn!==void 0&&Zn.length)}),Wn=Wn.map(function(xn){return Object(A.a)(Object(A.a)({},xn),{},{scoreTotal:0,score:0,questionTotal:0})}),Wn=(vt=Wn)===null||vt===void 0?void 0:vt.map(function(xn,Zn){var pi,oi,Ai;return Object(A.a)(Object(A.a)({},xn),{},{score:(je==null||((pi=je.score_settings)===null||pi===void 0||((oi=pi.find(function(Pi){return Pi.item_type===(xn==null?void 0:xn.item_type)}))===null||oi===void 0))?void 0:oi.score)||0,item_banks:xn==null||((Ai=xn.item_banks)===null||Ai===void 0)?void 0:Ai.map(function(Pi){var In;return Object(A.a)(Object(A.a)({},Pi),{},{tag_disciplines:Pi==null||((In=Pi.tag_disciplines)===null||In===void 0)?void 0:In.map(function(Gn){var mi;return Object(A.a)(Object(A.a)({},Gn),{},{difficulties:Gn==null||((mi=Gn.difficulties)===null||mi===void 0)?void 0:mi.map(function(ki){var vi=je==null?void 0:je.contents.find(function(Di){return Di.item_type===xn.item_type&&Di.sub_discipline_id===Pi.sub_discipline_id&&Di.tag_discipline_id===Gn.tag_discipline_id&&Di.difficulty===ki.difficulty});return vi?Object(A.a)(Object(A.a)({},ki),{},{num:vi==null?void 0:vi.quanlity}):Object(A.a)({},ki)})})})})})})}),hi=Rr(Wn),ri=hi.panel,qn=hi.score_num_item,Wn=(Ct=Wn)===null||Ct===void 0?void 0:Ct.map(function(xn,Zn){var pi,oi=(ri==null||((pi=ri[Zn])===null||pi===void 0)?void 0:pi.reduce(function(Ai,Pi){return Ai+Pi},0))||0;return Object(A.a)(Object(A.a)({},xn),{},{scoreTotal:oi*(qn[Zn]||0),questionTotal:oi})}),fi=[],je==null||((en=je.sort_by_item_type)===null||en===void 0)||en.forEach(function(xn){var Zn=Wn.find(function(pi){var oi,Ai=(oi=Or.find(function(Pi){return Pi.type===(pi==null?void 0:pi.item_type)}))===null||oi===void 0?void 0:oi.name;return Ai===xn});fi.push(Zn)}),fi=Object(Ke.compact)(fi),Fr(je==null||((un=je.examination_bank)===null||un===void 0)?void 0:un.source),mr(),Xt(je==null||((Pn=je.examination_bank)===null||Pn===void 0)?void 0:Pn.source),mn(Mn),Un.current=Mn,Fi(Sn),Ji((je==null?void 0:je.teach_group_ids)||[]),vn(je==null||((On=je.groups)===null||On===void 0)?void 0:On.map(function(xn){return xn.count}).reduce(function(xn,Zn){return xn+Zn},0)),di.current=Sn,En(Sn!=null&&Sn.length?Sn:[0]),h(Object(Ke.cloneDeep)(fi)),zt(!1);case 29:case"end":return on.stop()}},dt)}));return function(){return bt.apply(this,arguments)}}(),qo=function(){var bt=Object(N.a)(m.a.mark(function dt(){var Ve;return m.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:Ve={source:ot,group_ids:An,tag_discipline_ids:Mt,teach_group_ids:Cn},cr(Ve),Un.current=Mt,sn(!1);case 4:case"end":return Et.stop()}},dt)}));return function(){return bt.apply(this,arguments)}}(),Fr=function(){var bt=Object(N.a)(m.a.mark(function dt(Ve){var Ie,Et,vt,Ct,en,un;return m.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,Object(st.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:Ve}});case 2:vt=On.sent,Ct=[],vt==null||((Ie=vt.disciplines)===null||Ie===void 0)||Ie.forEach(function(Mn){var Sn;Mn==null||((Sn=Mn.sub_disciplines)===null||Sn===void 0)||Sn.forEach(function(ni){Ct=Ct.concat((ni==null?void 0:ni.tag_disciplines)||[])})}),en=null,un=vt==null||((Et=vt.disciplines)===null||Et===void 0)?void 0:Et.map(function(Mn){var Sn,ni=Mn==null||((Sn=Mn.sub_disciplines)===null||Sn===void 0)?void 0:Sn.reduce(function(Fn,Wn){return Fn+Wn.item_count},0);return!en&&ni!==0&&(en=Mn.id),Object(A.a)(Object(A.a)({},Mn),{},{item_count:ni})}),console.log(un,48767874),It(un),Lt(Ct),Ln(en);case 11:case"end":return On.stop()}},dt)}));return function(Ve){return bt.apply(this,arguments)}}(),mr=function(){var bt=Object(N.a)(m.a.mark(function dt(){var Ve;return m.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(st.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:Ve=Et.sent,lr((Ve==null?void 0:Ve.groups)||[]);case 4:case"end":return Et.stop()}},dt)}));return function(){return bt.apply(this,arguments)}}(),cr=function(){var bt=Object(N.a)(m.a.mark(function dt(Ve){var Ie,Et;return m.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return zt(!0),Ct.next=3,Object(st.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:Ve});case 3:Ie=Ct.sent,Et=Ie==null?void 0:Ie.filter(function(en){var un;return!!(en!=null&&(un=en.item_banks)!==null&&un!==void 0&&un.length)}),Et=Et.map(function(en){return Object(A.a)(Object(A.a)({},en),{},{scoreTotal:0,score:0,questionTotal:0})}),h(Et),zt(!1);case 8:case"end":return Ct.stop()}},dt)}));return function(Ve){return bt.apply(this,arguments)}}(),To=function(){mn(Un.current),sn(!1),cn("")},ea=function(dt){mn(dt)},io=function(){for(var dt=qe==null?void 0:qe.filter(function(Pn){return Mt==null?void 0:Mt.includes(Pn.id)}),Ve=Object(be.a)(dt),Ie=0,Et=[],vt=0;vt<Ve.length;vt++){for(var Ct="",en=0;en<Et.length;en++)if(Et[en][0].parent_name==Ve[vt].parent_name){Ie=1,Ct=en;break}if(Ie==1)Et[Ct].push(Ve[vt]),Ie=0;else if(Ie==0){var un=new Array;un.push(Ve[vt]),Et.push(un)}}return Et},Ao=function(dt,Ve){var Ie,Et,vt=Object(Ke.cloneDeep)(p);vt[Ve]=dt;var Ct=Rr([vt[Ve]]),en=Ct==null||((Ie=Ct.panel)===null||Ie===void 0||((Et=Ie[0])===null||Et===void 0))?void 0:Et.reduce(function(Pn,On){return Pn+On},0);vt[Ve].questionTotal=en,h(vt);var un=document.getElementsByClassName("customError");un==null||un.forEach(function(Pn){var On;Pn==null||((On=Pn.classList)===null||On===void 0)||On.remove("customError")})},Rr=function(dt){var Ve={contents:[],panel:[],score_num_item:[],score_total:[],error_tips:[]};return dt==null||dt.forEach(function(Ie,Et){var vt,Ct,en;Ve.panel.push([]),Ve.score_num_item.push(Ie==null?void 0:Ie.score),Ve.score_total.push(Ie==null?void 0:Ie.scoreTotal),(vt=Ve.error_tips)===null||vt===void 0||vt.push({name:(Ct=Or.find(function(un){return un.type===(Ie==null?void 0:Ie.item_type)}))===null||Ct===void 0?void 0:Ct.name,score:(Ie==null?void 0:Ie.score)||0,scoreTotal:Ie==null?void 0:Ie.scoreTotal,item_type:Ie==null?void 0:Ie.item_type}),Ie==null||((en=Ie.item_banks)===null||en===void 0)||en.forEach(function(un){var Pn;un==null||((Pn=un.tag_disciplines)===null||Pn===void 0)||Pn.forEach(function(On){var Mn;On==null||((Mn=On.difficulties)===null||Mn===void 0)||Mn.forEach(function(Sn){Sn.num&&(Ve.panel[Et].push(Sn.num),Ve.contents.push({difficulty:Sn.difficulty,item_type:Ie.item_type,items_count:Sn.num,sub_discipline_id:un.sub_discipline_id,tag_discipline_id:On.tag_discipline_id}))})})})}),Ve},Po=function(){var bt=Object(N.a)(m.a.mark(function dt(Ve){var Ie,Et,vt,Ct,en,un,Pn,On,Mn,Sn,ni,Fn,Wn,hi,ri,qn,fi;return m.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(!(!An.length&&!Mt.length&&!Cn.length)){on.next=3;break}return J.b.warn("\u5FC5\u987B\u9009\u62E9\u8003\u5BDF\u8303\u56F4\u6216\u8BD5\u9898\u6587\u4EF6\u5939\u6216\u6559\u7814\u56E2\u961F\u7684\u5176\u4E2D\u4E00\u9879"),on.abrupt("return");case 3:Ie=[],Et=[],vt=Rr(p),Ct=0;case 7:if(!(Ct<vt.error_tips.length)){on.next=23;break}if(Pn=vt==null||((en=vt.panel)===null||en===void 0||((un=en[Ct])===null||un===void 0))?void 0:un.reduce(function(xn,Zn){return xn+Zn},0),!(vt.error_tips[Ct].score===0&&Pn!==0)){on.next=14;break}return Mn=document.getElementById("".concat((On=vt.error_tips[Ct])===null||On===void 0?void 0:On.item_type,"_score")),Mn.classList.add("customError"),Mn.scrollIntoView({block:"start",behavior:"smooth"}),on.abrupt("return");case 14:if(!(vt.error_tips[Ct].score!==0&&Pn===0)){on.next=19;break}return ni=document.getElementById("".concat((Sn=vt.error_tips[Ct])===null||Sn===void 0?void 0:Sn.item_type,"_sum")),ni.classList.add("customError"),ni.scrollIntoView({block:"start",behavior:"smooth"}),on.abrupt("return");case 19:vt.error_tips[Ct].score!==0&&Pn!==0&&(Ie==null||Ie.push({item_type:(Fn=vt.error_tips[Ct])===null||Fn===void 0?void 0:Fn.item_type,score:((Wn=vt.error_tips[Ct])===null||Wn===void 0?void 0:Wn.score)||0}),Et.push(vt.error_tips[Ct].name));case 20:Ct++,on.next=7;break;case 23:if(!(Ie.length===0)){on.next=26;break}return J.b.warn("\u4E0D\u5141\u8BB8\u6BCF\u4E2A\u9898\u578B\u7684\u603B\u5206\u548C\u62BD\u9898\u6570\u91CF\u90FD\u4E3A0"),on.abrupt("return");case 26:if($e(!0),hi=Object(A.a)({contents:vt.contents,group_ids:An,teach_group_ids:Cn,score_settings:Ie,source:ot,sub_discipline_id:0,sort_by_item_type:Et,tag_discipline_ids:Mt},Oe),!Ve){on.next=36;break}return ri=Object(A.a)(Object(A.a)({},hi),Ve),on.next=32,Object(st.a)("/api/examination_banks/save_question_list.json",{method:"post",body:ri});case 32:return qn=on.sent,qn.status===0&&J.b.success("\u4FDD\u5B58\u6210\u529F"),$e(!1),on.abrupt("return");case 36:if(fi={},!je){on.next=43;break}return on.next=40,Object(st.a)("/api/examination_banks/".concat(je==null?void 0:je.id,"/update_random_exam.json"),{method:"post",body:hi});case 40:fi=on.sent,on.next=46;break;case 43:return on.next=45,Object(st.a)("/api/examination_banks/create_random_exam.json",{method:"post",body:hi});case 45:fi=on.sent;case 46:fi.status===0&&(J.b.success("\u64CD\u4F5C\u6210\u529F"),ee.d.push("/paperlibrary?defaultActiveKey=0")),$e(!1);case 48:case"end":return on.stop()}},dt)}));return function(Ve){return bt.apply(this,arguments)}}(),ro=function(){var bt=Object(N.a)(m.a.mark(function dt(Ve,Ie){var Et,vt,Ct,en,un,Pn,On,Mn,Sn,ni,Fn,Wn,hi,ri,qn,fi,Ti,on,xn,Zn,pi,oi,Ai;return m.a.wrap(function(In){for(;;)switch(In.prev=In.next){case 0:if(!(!An.length&&!Mt.length&&!Cn.length)){In.next=3;break}return J.b.warn("\u5FC5\u987B\u9009\u62E9\u8003\u5BDF\u8303\u56F4\u6216\u8BD5\u9898\u6587\u4EF6\u5939\u6216\u6559\u7814\u56E2\u961F\u7684\u5176\u4E2D\u4E00\u9879"),In.abrupt("return");case 3:Et=[],vt=[],Ct=Rr(p),en=0;case 7:if(!(en<Ct.error_tips.length)){In.next=23;break}if(On=Ct==null||((un=Ct.panel)===null||un===void 0||((Pn=un[en])===null||Pn===void 0))?void 0:Pn.reduce(function(Gn,mi){return Gn+mi},0),!(Ct.error_tips[en].score===0&&On!==0)){In.next=14;break}return Sn=document.getElementById("".concat((Mn=Ct.error_tips[en])===null||Mn===void 0?void 0:Mn.item_type,"_score")),Sn.classList.add("customError"),Sn.scrollIntoView({block:"start",behavior:"smooth"}),In.abrupt("return");case 14:if(!(Ct.error_tips[en].score!==0&&On===0)){In.next=19;break}return Fn=document.getElementById("".concat((ni=Ct.error_tips[en])===null||ni===void 0?void 0:ni.item_type,"_sum")),Fn.classList.add("customError"),Fn.scrollIntoView({block:"start",behavior:"smooth"}),In.abrupt("return");case 19:Ct.error_tips[en].score!==0&&On!==0&&(Et==null||Et.push({item_type:(Wn=Ct.error_tips[en])===null||Wn===void 0?void 0:Wn.item_type,score:((hi=Ct.error_tips[en])===null||hi===void 0?void 0:hi.score)||0}),vt.push(Ct.error_tips[en].name));case 20:en++,In.next=7;break;case 23:if(!(Et.length===0)){In.next=26;break}return J.b.warn("\u4E0D\u5141\u8BB8\u6BCF\u4E2A\u9898\u578B\u7684\u603B\u5206\u548C\u62BD\u9898\u6570\u91CF\u90FD\u4E3A0"),In.abrupt("return");case 26:if(Ft(!0),ri=Object(A.a)({contents:Ct.contents,group_ids:An,teach_group_ids:Cn,score_settings:Et,sort_by_item_type:vt,tag_discipline_ids:Mt,source:ot,sub_discipline_id:0},Oe),!(Ve!==void 0&&!(Ve!=null&&Ve.single_question_id))){In.next=36;break}return ri.seleted_item_bank_ids=Ve==null?void 0:Ve.seleted_item_bank_ids,In.next=32,Object(st.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:ri});case 32:return qn=In.sent,qn!=null&&qn.questions&&(Ti=Object(Ke.cloneDeep)(u),Ti.questionList=Ti==null||((fi=Ti.questionList)===null||fi===void 0)?void 0:fi.map(function(Gn){if(Gn.type===Ie.type){var mi;return Object(A.a)(Object(A.a)({},Gn),{},{questions:(qn==null||((mi=qn.questions)===null||mi===void 0)?void 0:mi.questions)||[]})}return Gn}),o(Ti)),Ft(!1),In.abrupt("return");case 36:if(!(Ve!=null&&Ve!==void 0&&Ve.single_question_id)){In.next=45;break}return ri.seleted_item_bank_ids=Ve==null?void 0:Ve.seleted_item_bank_ids,ri.single_question_id=Ve==null?void 0:Ve.single_question_id,In.next=41,Object(st.a)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:ri});case 41:return on=In.sent,on&&(Zn=Object(Ke.cloneDeep)(u),Zn.questionList=Zn==null||((xn=Zn.questionList)===null||xn===void 0)?void 0:xn.map(function(Gn){if(Gn.type===Ie.type){var mi,ki,vi=Object(Ke.cloneDeep)(Gn==null?void 0:Gn.questions);return vi.splice(Ie.index,1,on==null||((mi=on.questions)===null||mi===void 0||((ki=mi.questions)===null||ki===void 0))?void 0:ki[0]),console.log(Gn==null?void 0:Gn.questions,vi,Ie.index,"new_questions"),Object(A.a)(Object(A.a)({},Gn),{},{questions:vi})}return Gn}),o(Zn)),Ft(!1),In.abrupt("return");case 45:return In.next=47,Object(st.a)("/api/examination_banks/preview_random_questions.json",{method:"post",body:ri});case 47:pi=In.sent,pi.exam&&(oi=Lo(pi),Ai=[],vt==null||vt.forEach(function(Gn){var mi,ki=oi==null||((mi=oi.questionList)===null||mi===void 0)?void 0:mi.find(function(vi){var Di,oo=(Di=Or.find(function(ao){return ao.type===(vi==null?void 0:vi.type)}))===null||Di===void 0?void 0:Di.name;return oo===Gn});Ai.push(ki)}),Ai=Object(Ke.compact)(Ai),oi.questionList=Ai,o(Object(A.a)({},oi)),console.log(JSON.stringify(oi)),qt(!0),document.body.scrollIntoView()),Ft(!1);case 50:case"end":return In.stop()}},dt)}));return function(Ve,Ie){return bt.apply(this,arguments)}}(),Or=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],ta=function(){var dt=Rr(p),Ve=dt.panel,Ie=dt.score_total;return Ie=Ie.reduce(function(Et,vt){return Et+vt},0),Ve=Object(Ke.flatten)(Ve).reduce(function(Et,vt){return Et+vt},0),f.a.createElement("div",{className:y.a.total},f.a.createElement("div",null,f.a.createElement("img",{src:T.a}),f.a.createElement("span",null,"\u9898\u6570(\u9053)"),f.a.createElement("aside",null,Ve)),f.a.createElement("aside",null),f.a.createElement("div",null,f.a.createElement("img",{src:We.a}),f.a.createElement("span",null,"\u603B\u5206(\u5206)"),f.a.createElement("aside",null,Ie)))},vr=function(dt,Ve,Ie){return dt[Ve]=dt.splice(Ie,1,dt[Ve])[0],dt},Qi=function(dt){var Ve=[],Ie=Object(Ke.cloneDeep)(p);Ie.length>1&&dt!==0&&(Ve=vr(Ie,dt,dt-1)),h(Ve)},Wr=function(dt){var Ve=[],Ie=Object(Ke.cloneDeep)(p);Ie.length>1&&dt!==Ie.length-1&&(Ve=vr(Ie,dt,dt+1)),h(Ve)},Tr=function(){var bt=Object(N.a)(m.a.mark(function dt(Ve){var Ie,Et,vt,Ct;return m.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(vt=Object(be.a)(ot),ot.includes(Ve)?vt=vt.filter(function(Pn){return Pn!==Ve}):vt.push(Ve),!(vt.length===0)){un.next=5;break}return J.b.warn("\u8BD5\u9898\u6765\u6E90\u4E3A\u5FC5\u9009\u9879"),un.abrupt("return");case 5:(Ie=vt)!==null&&Ie!==void 0&&Ie.includes("mine")||(Fi([]),di.current=[]),(Et=vt)!==null&&Et!==void 0&&Et.includes("teach_groups")||(Ji([]),ur.current=[]),Xt(vt),Fr(vt),mn([]),Un.current=[],Ct={source:vt,group_ids:di.current,tag_discipline_ids:[],teach_group_ids:ur.current},cr(Ct);case 13:case"end":return un.stop()}},dt)}));return function(Ve){return bt.apply(this,arguments)}}(),Lo=function(dt){var Ve={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!dt)return;var Ie=dt||{},Et=Ie.exam,vt=Ie.single_questions,Ct=Ie.multiple_questions,en=Ie.judgement_questions,un=Ie.program_questions,Pn=Ie.completion_questions,On=Ie.subjective_questions,Mn=Ie.practical_questions,Sn=Ie.combination_questions,ni=[Object(A.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},vt),Object(A.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},Ct),Object(A.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},Pn),Object(A.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},en),Object(A.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},On),Object(A.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},un),Object(A.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},Mn),Object(A.a)({type:"COMBINATION",name:"\u7EC4\u5408\u9898"},Sn)],Fn=[],Wn=0,hi=0,ri=ni.filter(function(qn){return qn.questions_count>0}).map(function(qn,fi){var Ti;return(Ti=qn.questions)===null||Ti===void 0||Ti.forEach(function(on){Fn.push(on.id),Wn=Wn+on.score,hi=hi+1}),Object(A.a)(Object(A.a)({},qn),{number:Ve[fi+1]})});return{all_questions_count:hi,all_score:Wn,questionList:ri,ids:Fn,exam:Et}},Yi=function(dt){var Ve,Ie,Et=Object(Ke.cloneDeep)(u),vt=Object(Ke.cloneDeep)(p);Et.questionList=Et==null||((Ve=Et.questionList)===null||Ve===void 0)?void 0:Ve.map(function(Ct){return Ct.type===dt.type?Object(A.a)(Object(A.a)({},Ct),{},{questions_score:dt.scoreTotal}):Ct}),vt=(Ie=vt)===null||Ie===void 0?void 0:Ie.map(function(Ct){return Ct.item_type===dt.type?Object(A.a)(Object(A.a)({},Ct),{},{score:dt.score,scoreTotal:dt.scoreTotal}):Ct}),h(vt),o(Et),console.log(dt,u,p)},qi=ht==null||((ve=ht.find(function(bt){return bt.id===_n}))===null||ve===void 0)?void 0:ve.sub_disciplines,Ar=io();return Gt?f.a.createElement(Xe.a,{loading:Ae,submit:Po,goBack:function(){return qt(!1)},data:u,onTypeScore:Yi,onExchange:ro}):f.a.createElement("section",{className:y.a.wrap,style:{display:Ye?"flex":"none"}},f.a.createElement("div",{id:"id_left",className:y.a.left,onMouseEnter:function(dt){var Ve=document.getElementById("id_left");Ve.style.overflowY="auto"},onMouseLeave:function(dt){var Ve=document.getElementById("id_left");Ve.style.overflowY="hidden"}},f.a.createElement(_e.a,{loading:Yt,active:!0,paragraph:{rows:5}},p.map(function(bt,dt){var Ve;return f.a.createElement("div",{className:y.a.list,key:dt},f.a.createElement("div",{className:y.a.name},f.a.createElement("b",null),f.a.createElement("span",null,(Ve=Or.find(function(Ie){return Ie.type===(bt==null?void 0:bt.item_type)}))===null||Ve===void 0?void 0:Ve.name)),f.a.createElement("aside",null,f.a.createElement("div",null,"\u5171",f.a.createElement("span",{className:y.a.b},bt.questionTotal),"\u9898",f.a.createElement("span",{className:y.a.l},"|"),"\u5171",f.a.createElement("span",{className:y.a.r},bt.scoreTotal),"\u5206"),f.a.createElement("div",null,dt>0?f.a.createElement(K.a,{getPopupContainer:function(Et){return document.getElementById("id_left")},title:"\u4E0A\u79FB"},f.a.createElement("span",{onClick:function(){return Qi(dt)},className:"mb20",style:{transform:"rotate(270deg)"}}," ",f.a.createElement("i",{className:"icon-jiantou1"}))):f.a.createElement("span",{className:"mb20",style:{transform:"rotate(270deg)",cursor:"not-allowed"}}," ",f.a.createElement("i",{className:"icon-jiantou1"})),dt<p.length-1?f.a.createElement(K.a,{getPopupContainer:function(Et){return document.getElementById("id_left")},title:"\u4E0B\u79FB"},f.a.createElement("span",{onClick:function(){return Wr(dt)},style:{transform:"rotate(90deg)"}}," ",f.a.createElement("i",{className:"icon-jiantou1"}))):f.a.createElement("span",{style:{transform:"rotate(90deg)",cursor:"not-allowed"}}," ",f.a.createElement("i",{className:"icon-jiantou1"})))))})),ta()),f.a.createElement("div",{className:y.a.right},f.a.createElement(re,{className:y.a.tabs,value:1,onChange:function(){return lt(0)}}),f.a.createElement("section",{className:y.a.topWarp},f.a.createElement("div",{className:y.a.title},f.a.createElement("b",null),f.a.createElement("span",null,"\u62BD\u9898\u7EC4\u5377"),f.a.createElement("div",null,"STEP2")," "),f.a.createElement("div",{className:y.a.source},f.a.createElement("b",null,"*"),f.a.createElement("span",null,"\u8BD5\u9898\u6765\u6E90"),f.a.createElement("aside",null,f.a.createElement("div",{onClick:function(){return Tr("mine")}}," ",f.a.createElement(z.a,{checked:ot==null?void 0:ot.includes("mine")}),f.a.createElement("span",{style:{color:ot!=null&&ot.includes("mine")?"#007DFE":"#666666"}},"\u4EC5\u6211\u521B\u5EFA\u7684")),f.a.createElement("div",{className:"mb20",onClick:function(){return Tr("teach_groups")}}," ",f.a.createElement(z.a,{checked:ot==null?void 0:ot.includes("teach_groups")}),f.a.createElement("span",{style:{color:ot!=null&&ot.includes("teach_groups")?"#007DFE":"#666666"}},"\u6559\u7814\u5171\u4EAB")),f.a.createElement("div",{onClick:function(){return Tr("public")}},f.a.createElement(z.a,{checked:ot==null?void 0:ot.includes("public")}),f.a.createElement("span",{style:{color:ot!=null&&ot.includes("public")?"#007DFE":"#666666"}},"\u516C\u5171\u9898\u5E93"))),f.a.createElement("aside",null,(ot==null?void 0:ot.includes("mine"))&&f.a.createElement("div",{style:{marginBottom:14},className:y.a.folder,onClick:function(){yn(!0),$n(!0),di.current=An,vn((Jn==null?void 0:Jn.map(function(dt){return dt.count}).reduce(function(dt,Ve){return dt+Ve},0))||0)}},f.a.createElement("img",{src:Ne.a}),f.a.createElement("span",null,"\u9009\u62E9\u8BD5\u9898\u6587\u4EF6\u5939"),f.a.createElement(K.a,{title:"\u9009\u4E2D\u9879\u4EC5\u5305\u62EC\u8BE5\u6587\u4EF6\u5939\u4E0B\u7684\u8BD5\u9898\uFF0C\u4E0D\u5305\u62EC\u5B50\u6587\u4EF6\u5939\uFF0C\u4E14\u7CFB\u7EDF\u53D6\u60A8\u9009\u4E2D\u7684\u6587\u4EF6\u5939\u548C\u8003\u67E5\u8303\u56F4\u4E2D\u7684\u8BD5\u9898\u7684\u5E76\u96C6\u4F5C\u4E3A\u968F\u673A\u5BF9\u8C61\u3002"},f.a.createElement("img",{src:De.a}))),(ot==null?void 0:ot.includes("teach_groups"))&&f.a.createElement("div",{className:y.a.folder,onClick:function(){nr(!0),ur.current=Cn}},f.a.createElement("img",{src:Be.a}),f.a.createElement("span",null,"\u9009\u62E9\u6559\u7814\u56E2\u961F")))),(ot==null?void 0:ot.includes("mine"))&&f.a.createElement("div",{className:y.a.choice},f.a.createElement("div",{className:y.a.name},f.a.createElement("b",null),f.a.createElement("span",null,"\u5DF2\u9009\u6587\u4EF6\u5939")),f.a.createElement(he.a,{type:2,value:Jn,onChange:function(dt){var Ve=An.filter(function(Et){return Et!==dt}),Ie={source:ot,group_ids:Ve,tag_discipline_ids:Mt,teach_group_ids:Cn};cr(Ie),Fi(Ve),di.current=Ve}})),(ot==null?void 0:ot.includes("teach_groups"))&&f.a.createElement("div",{className:y.a.choice},f.a.createElement("div",{className:y.a.name},f.a.createElement("b",null),f.a.createElement("span",null,"\u5DF2\u9009\u6559\u7814\u56E2\u961F")),f.a.createElement(he.a,{icon:G.a,type:2,value:Wi,onChange:function(dt){var Ve=Cn.filter(function(Et){return Et!==dt}),Ie={source:ot,group_ids:An,tag_discipline_ids:Mt,teach_group_ids:Ve};cr(Ie),Ji(Ve),ur.current=Ve}})),f.a.createElement("div",{className:y.a.range},f.a.createElement("div",{className:y.a.name},f.a.createElement("b",null),f.a.createElement("span",null,"\u8003\u5BDF\u8303\u56F4")),f.a.createElement("div",{onClick:function(){if(_n===null){J.b.warn("\u8003\u5BDF\u8303\u56F4\u6CA1\u6709\u77E5\u8BC6\u70B9\u53EF\u4EE5\u9009\u62E9");return}Un.current=Mt,sn(!0)},className:y.a.btn},f.a.createElement("img",{src:ae.a})," \u9009\u62E9\u8303\u56F4"),f.a.createElement("div",{className:y.a.name},f.a.createElement("b",{className:y.a.num}),f.a.createElement("span",null,"\u5DF2\u9009\u77E5\u8BC6\u70B9")),f.a.createElement("div",{className:y.a.knWarp},Ar==null?void 0:Ar.map(function(bt,dt){return f.a.createElement(f.a.Fragment,{key:dt},f.a.createElement("div",{className:y.a.kn},f.a.createElement("span",null,dt+1)," ",f.a.createElement("span",null,bt==null?void 0:bt[0].parent_name)),f.a.createElement(he.a,{type:1,value:bt==null?void 0:bt.filter(function(Ve){return!!Ve.item_count}),onChange:function(Ie){var Et=Mt.filter(function(Ct){return Ct!==Ie}),vt={source:ot,group_ids:An,tag_discipline_ids:Et,teach_group_ids:Cn};cr(vt),mn(Et),Un.current=Et}}))})))),console.log("-----",p),f.a.createElement(_e.a,{loading:Yt,active:!0,paragraph:{rows:5}},p.map(function(bt,dt){return f.a.createElement(ke.a,{key:dt,value:bt,onChange:function(Ie){return Ao(Ie,dt)}})}),f.a.createElement("div",{className:y.a.btns},f.a.createElement(we.a,{onClick:function(){lt(0),document.body.scrollIntoView()}},"\u4E0A\u4E00\u6B65"),f.a.createElement(we.a,{loading:Ae,onClick:function(){return Po()}},"\u63D0\u4EA4"),f.a.createElement(we.a,{loading:Jt,onClick:function(){return ro()},type:"primary"},"\u9884\u89C8")))),f.a.createElement(S.a,{centered:!0,closable:!1,destroyOnClose:!0,className:y.a.modal,visible:Nn,title:null,width:"1200px",onOk:qo,onCancel:To},f.a.createElement("div",{className:y.a.modalBody},f.a.createElement("div",{className:y.a.left},f.a.createElement("div",{className:y.a.title},f.a.createElement("img",{src:ye.a}),f.a.createElement("span",null,"\u8BD5\u9898\u8303\u56F4")),f.a.createElement("div",{className:y.a.l},ht==null?void 0:ht.map(function(bt){var dt=null,Ve=!1;if(!jt)Ve=!0;else{var Ie;(Ie=bt.sub_disciplines)===null||Ie===void 0||Ie.forEach(function(Et){var vt;(vt=Et.tag_disciplines)===null||vt===void 0||vt.forEach(function(Ct){if(!Ve){var en;Ve=((en=Ct.name)===null||en===void 0?void 0:en.includes(jt))&&Ct.item_count!==0}})})}return f.a.createElement(f.a.Fragment,{key:bt.id},!!bt.item_count&&Ve&&f.a.createElement("div",{onClick:function(){return Ln(bt.id)},className:"".concat(y.a.name," ").concat(bt.id===_n?y.a.active:"")},f.a.createElement("b",null),f.a.createElement("span",null,bt.name)))}))),f.a.createElement("div",{className:y.a.right},f.a.createElement("div",{className:y.a.inputWarp},f.a.createElement($,{onChange:function(dt){return cn(dt.target.value)},placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9",value:jt})),f.a.createElement("div",{className:y.a.l},qi==null?void 0:qi.map(function(bt,dt){var Ve,Ie=Object(A.a)(Object(A.a)({},bt),{},{tag_disciplines:bt==null||((Ve=bt.tag_disciplines)===null||Ve===void 0)?void 0:Ve.filter(function(Et){return Et.item_count!==0})});return f.a.createElement(gt,{search:jt,onChange:ea,key:bt.id,value:Mt,options:Ie})}))))),f.a.createElement(S.a,{centered:!0,title:"\u9009\u62E9\u6587\u4EF6\u5939",visible:Xn,width:718,destroyOnClose:!0,onCancel:function(){Fi(di.current),$n(!1),vn(0)},footer:f.a.createElement("div",{style:{display:"flex",alignItems:"center"}},f.a.createElement("span",{style:{flex:"1",textAlign:"left"}},"\u5DF2\u9009",An.length||0,"\u4E2A\u6587\u4EF6\u5939\uFF0C\u5171\uFF08",rr||0,"\uFF09\u9053\u9898"),f.a.createElement(we.a,{onClick:function(){Fi(di.current),vn(0),$n(!1)}},"\u53D6\u6D88"),f.a.createElement(we.a,{type:"primary",onClick:function(){var dt={source:ot,group_ids:An,tag_discipline_ids:Mt,teach_group_ids:Cn};cr(dt),di.current=An,$n(!1)}},"\u786E\u8BA4"))},f.a.createElement("aside",{className:y.a.exportModal},Rn&&f.a.createElement(He,{treeData:rn,defaultValue:zn,value:An,onChange:function(dt,Ve){var Ie;vn((Ie=Ve.selectedNodes)===null||Ie===void 0?void 0:Ie.map(function(Et){return Et.count}).reduce(function(Et,vt){return Et+vt},0)),Fi(dt)}}))),f.a.createElement(S.a,{centered:!0,title:"\u9009\u62E9\u6559\u7814\u56E2\u961F",visible:pr,width:718,destroyOnClose:!0,onCancel:function(){Ji(ur.current),nr(!1)},onOk:function(){var dt={source:ot,group_ids:An,tag_discipline_ids:Mt,teach_group_ids:Cn};cr(dt),ur.current=Cn,nr(!1)}},f.a.createElement("aside",{className:y.a.teachModal},f.a.createElement("div",{className:y.a.head},f.a.createElement("div",{className:y.a.li}),f.a.createElement("div",{className:y.a.li},"\u56E2\u961F\u540D\u79F0"),f.a.createElement("div",{className:y.a.li},"\u5171\u4EAB\u9898\u76EE\u6570\u91CF")),f.a.createElement("div",{className:y.a.wraps},Zi==null?void 0:Zi.map(function(bt){return f.a.createElement("div",{key:bt.id,className:y.a.body},f.a.createElement("div",{className:y.a.li},f.a.createElement(z.a,{onChange:function(){var Ve=bt.id,Ie=Object(be.a)(Cn);Cn.includes(Ve)?Ie=Ie.filter(function(Et){return Et!==Ve}):Ie.push(Ve),Ji(Ie)},checked:Cn==null?void 0:Cn.includes(bt.id)})),f.a.createElement("div",{title:bt.name,className:y.a.li},bt.name),f.a.createElement("div",{className:y.a.li},bt.item_bank_count))})))))},ie=ne,P=w.a.TextArea,D=function(xe){var ve=xe.paperlibrary,Oe=xe.user,lt=xe.globalSetting,Ye=xe.dispatch,je=Object(v.useState)(0),pt=Object(O.a)(je,2),Ut=pt[0],ut=pt[1],$t=C.a.useForm(),ot=Object(O.a)($t,1),Xt=ot[0],Wt=Object(v.useState)({}),St=Object(O.a)(Wt,2),Yt=St[0],zt=St[1],Je=Object(v.useState)(!0),ze=Object(O.a)(Je,2),Ae=ze[0],$e=ze[1],Dt=Object(v.useState)(null),Nt=Object(O.a)(Dt,2),Jt=Nt[0],Ft=Nt[1],_t=Object(L.i)().id;console.log(_t,"editId"),Object(v.useEffect)(function(){return Ye({type:"globalSetting/footerToggle",payload:!1}),function(){Ye({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(v.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]);var an=function(Nn){zt(Object(A.a)({},Xt.getFieldsValue()))};Object(v.useEffect)(function(){if(_t){jt();return}$e(!1)},[_t]);var jt=function(){var dn=Object(N.a)(m.a.mark(function Nn(){var sn,Fe,it,Gt,qt,nn;return m.a.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,Object(st.a)("/api/examination_banks/".concat(_t,"/edit_random_exam.json"),{method:"get",params:{}});case 2:sn=u.sent,sn!=null&&sn.examination_bank&&(nn={difficulty:sn==null||((Fe=sn.examination_bank)===null||Fe===void 0)?void 0:Fe.difficulty,exam_notes:sn==null||((it=sn.examination_bank)===null||it===void 0)?void 0:it.exam_notes,name:sn==null||((Gt=sn.examination_bank)===null||Gt===void 0)?void 0:Gt.name,time:sn==null||((qt=sn.examination_bank)===null||qt===void 0)?void 0:qt.time},$e(!1),zt(Object(A.a)({},nn)),Xt.setFieldsValue(Object(A.a)({},nn)),Ft(Object(A.a)(Object(A.a)({},sn),{},{id:_t})));case 4:case"end":return u.stop()}},Nn)}));return function(){return dn.apply(this,arguments)}}(),cn=function(){var dn=Object(N.a)(m.a.mark(function Nn(sn){return m.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:if(!(sn===0)){it.next=3;break}return ut(sn),it.abrupt("return");case 3:return it.next=5,Xt.validateFields();case 5:ut(sn);case 6:case"end":return it.stop()}},Nn)}));return function(sn){return dn.apply(this,arguments)}}(),Kt=function(Nn){var sn=parseInt(Nn);return Object(Ke.isNaN)(sn)?"":sn};return f.a.createElement("section",{className:F.a.wrap},f.a.createElement(_e.a,{loading:Ae,active:!0,paragraph:{rows:5}},f.a.createElement("div",{className:F.a.crumbs},f.a.createElement("b",null),f.a.createElement("span",{className:"current",onClick:function(){return ee.d.push("/")}},"\u9996\u9875>"),f.a.createElement("span",{className:"current",onClick:function(){return ee.d.push("/paperlibrary")}},"\u8BD5\u5377\u5E93>"),f.a.createElement("span",{style:{color:"#bebebe"}},"\u968F\u673A\u7EC4\u5377")),Ut===0&&f.a.createElement(re,{value:Ut,onChange:cn}),Ut===0&&f.a.createElement("section",{className:F.a.oneWrap},f.a.createElement("div",{className:F.a.title},f.a.createElement("b",null),f.a.createElement("span",null,"\u57FA\u672C\u4FE1\u606F"),f.a.createElement("div",null,"STEP1")," "),f.a.createElement(C.a,{className:F.a.formWrap,form:Xt,layout:"horizontal",onValuesChange:an},f.a.createElement(C.a.Item,{label:"\u8BD5\u5377\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^(?!(\s+$))/,message:"\u8F93\u5165\u6846\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C"}]},f.a.createElement(w.a,{className:F.a.in,bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0\uFF0C\u6700\u591A60\u4E2A\u5B57",maxLength:60})),f.a.createElement("div",{style:{position:"relative"}},f.a.createElement(C.a.Item,{label:"\u7B54\u9898\u65F6\u957F:",name:"time",rules:[{required:!0,message:"\u7B54\u9898\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},f.a.createElement(B.a,{min:1,parser:Kt,max:9999,placeholder:"\u8BF7\u8F93\u5165\u7B54\u9898\u65F6\u957F",style:{width:190}})),f.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"\u5206\u949F")),f.a.createElement(C.a.Item,{label:"\u8BD5\u9898\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},f.a.createElement(fe.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},f.a.createElement(fe.a.Button,{className:F.a.rb,value:1},"\u7B80\u5355"),f.a.createElement(fe.a.Button,{className:F.a.rb,value:2},"\u9002\u4E2D"),f.a.createElement(fe.a.Button,{className:F.a.rb,value:3},"\u56F0\u96BE"))),f.a.createElement(C.a.Item,{label:"\u8003\u8BD5\u987B\u77E5",name:"exam_notes"},f.a.createElement(P,{placeholder:"\u8003\u751F\u5FC5\u987B\u4E25\u683C\u9075\u5B88\u8003\u573A\u7EAA\u5F8B\uFF0C\u4E0D\u51C6\u5192\u540D\u9876\u66FF\uFF0C\u4E0D\u51C6\u6709\u4EFB\u4F55\u4F5C\u5F0A\u884C\u4E3A\u3002\u5982\u53D1\u73B0\u8FDD\u7EAA\uFF0C\u5E76\u7ED9\u4E88\u4E25\u5389\u5904\u5206\u3002",rows:4,maxLength:300}))),f.a.createElement("div",{className:F.a.btns},f.a.createElement(we.a,{className:"mr40",onClick:function(){return ee.d.push("/paperlibrary")}},"\u8FD4\u56DE"),f.a.createElement(we.a,{type:"primary",onClick:Object(N.a)(m.a.mark(function dn(){return m.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Xt.validateFields();case 2:ut(1);case 3:case"end":return sn.stop()}},dn)}))},"\u4E0B\u4E00\u6B65"))),f.a.createElement(ie,{tabs:Ut,dispatch:Ye,editData:Jt,setFatherTabs:ut,formValue:Yt})))},X=ue.default=Object(ee.a)(function(V){var xe=V.paperlibrary,ve=V.user,Oe=V.globalSetting;return{paperlibrary:xe,user:ve,globalSetting:Oe}})(D)},"E/GV":function(rt,ue,l){rt.exports=l.p+"static/swenjianjia.1640bf70.svg"},ELLl:function(rt,ue,l){(function(q){q(l("VrN/"))})(function(q){var _e={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},me=q.Pos;q.defineOption("autoCloseBrackets",!1,function(w,M,m){m&&m!=q.Init&&(w.removeKeyMap(Ee),w.state.closeBrackets=null),M&&(fe(we(M,"pairs")),w.state.closeBrackets=M,w.addKeyMap(Ee))});function we(w,M){return M=="pairs"&&typeof w=="string"?w:typeof w=="object"&&w[M]!=null?w[M]:_e[M]}var Ee={Backspace:N,Enter:A};function fe(w){for(var M=0;M<w.length;M++){var m=w.charAt(M),v="'"+m+"'";Ee[v]||(Ee[v]=Y(m))}}fe(_e.pairs+"`");function Y(w){return function(M){return C(M,w)}}function B(w){var M=w.state.closeBrackets;if(!M||M.override)return M;var m=w.getModeAt(w.getCursor());return m.closeBrackets||M}function N(w){var M=B(w);if(!M||w.getOption("disableInput"))return q.Pass;for(var m=we(M,"pairs"),v=w.listSelections(),f=0;f<v.length;f++){if(!v[f].empty())return q.Pass;var L=O(w,v[f].head);if(!L||m.indexOf(L)%2!=0)return q.Pass}for(var f=v.length-1;f>=0;f--){var ee=v[f].head;w.replaceRange("",me(ee.line,ee.ch-1),me(ee.line,ee.ch+1),"+delete")}}function A(w){var M=B(w),m=M&&we(M,"explode");if(!m||w.getOption("disableInput"))return q.Pass;for(var v=w.listSelections(),f=0;f<v.length;f++){if(!v[f].empty())return q.Pass;var L=O(w,v[f].head);if(!L||m.indexOf(L)%2!=0)return q.Pass}w.operation(function(){var ee=w.lineSeparator()||`
`;w.replaceSelection(ee+ee,null),w.execCommand("goCharLeft"),v=w.listSelections();for(var oe=0;oe<v.length;oe++){var F=v[oe].head.line;w.indentLine(F,null,!0),w.indentLine(F+1,null,!0)}})}function _(w){var M=q.cmpPos(w.anchor,w.head)>0;return{anchor:new me(w.anchor.line,w.anchor.ch+(M?-1:1)),head:new me(w.head.line,w.head.ch+(M?1:-1))}}function C(w,M){var m=B(w);if(!m||w.getOption("disableInput"))return q.Pass;var v=we(m,"pairs"),f=v.indexOf(M);if(f==-1)return q.Pass;for(var L=we(m,"closeBefore"),ee=we(m,"triples"),oe=v.charAt(f+1)==M,F=w.listSelections(),b=f%2==0,se,j=0;j<F.length;j++){var re=F[j],k=re.head,S,Q=w.getRange(k,me(k.line,k.ch+1));if(b&&!re.empty())S="surround";else if((oe||!b)&&Q==M)oe&&x(w,k)?S="both":ee.indexOf(M)>=0&&w.getRange(k,me(k.line,k.ch+3))==M+M+M?S="skipThree":S="skip";else if(oe&&k.ch>1&&ee.indexOf(M)>=0&&w.getRange(me(k.line,k.ch-2),k)==M+M){if(k.ch>2&&/\bstring/.test(w.getTokenTypeAt(me(k.line,k.ch-2))))return q.Pass;S="addFour"}else if(oe){var z=k.ch==0?" ":w.getRange(me(k.line,k.ch-1),k);if(!q.isWordChar(Q)&&z!=M&&!q.isWordChar(z))S="both";else return q.Pass}else if(b&&(Q.length===0||/\s/.test(Q)||L.indexOf(Q)>-1))S="both";else return q.Pass;if(!se)se=S;else if(se!=S)return q.Pass}var U=f%2?v.charAt(f-1):M,K=f%2?M:v.charAt(f+1);w.operation(function(){if(se=="skip")w.execCommand("goCharRight");else if(se=="skipThree")for(var de=0;de<3;de++)w.execCommand("goCharRight");else if(se=="surround"){for(var J=w.getSelections(),de=0;de<J.length;de++)J[de]=U+J[de]+K;w.replaceSelections(J,"around"),J=w.listSelections().slice();for(var de=0;de<J.length;de++)J[de]=_(J[de]);w.setSelections(J)}else se=="both"?(w.replaceSelection(U+K,null),w.triggerElectric(U+K),w.execCommand("goCharLeft")):se=="addFour"&&(w.replaceSelection(U+U+U+U,"before"),w.execCommand("goCharRight"))})}function O(w,M){var m=w.getRange(me(M.line,M.ch-1),me(M.line,M.ch+1));return m.length==2?m:null}function x(w,M){var m=w.getTokenAt(me(M.line,M.ch+1));return/\bstring/.test(m.type)&&m.start==M.ch&&(M.ch==0||!/\bstring/.test(w.getTokenTypeAt(M)))}})},FTkQ:function(rt,ue){rt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg=="},Gytx:function(rt,ue){rt.exports=function(q,_e,me,we){var Ee=me?me.call(we,q,_e):void 0;if(Ee!==void 0)return!!Ee;if(q===_e)return!0;if(typeof q!="object"||!q||typeof _e!="object"||!_e)return!1;var fe=Object.keys(q),Y=Object.keys(_e);if(fe.length!==Y.length)return!1;for(var B=Object.prototype.hasOwnProperty.bind(_e),N=0;N<fe.length;N++){var A=fe[N];if(!B(A))return!1;var _=q[A],C=_e[A];if(Ee=me?me.call(we,_,C,A):void 0,Ee===!1||Ee===void 0&&_!==C)return!1}return!0}},HG2Q:function(rt,ue,l){rt.exports=l.p+"static/sren.1cbce50b.svg"},HPRh:function(rt,ue,l){rt.exports=l.p+"static/median.766cb706.svg"},Hfvn:function(rt,ue,l){rt.exports=l.p+"static/wenjian.ea3b4170.svg"},HmJG:function(rt,ue,l){},IlMy:function(rt,ue,l){rt.exports={flex_box_center:"flex_box_center___1Rd7-",flex_space_between:"flex_space_between___1qdJI",flex_box_vertical_center:"flex_box_vertical_center___3PScB",flex_box_center_end:"flex_box_center_end___gmzWk",flex_box_column:"flex_box_column___qhFY7",wrap:"wrap___2CDxR",left:"left___21M_k",list:"list___ahv58",name:"name___3cBep",b:"b___1CRFh",r:"r___2F_9I",l:"l___3XCXI",total:"total___2VTdV",topWarp:"topWarp___y9feY",right:"right___U2Z5M",tabs:"tabs___3eZK5",title:"title___3iKxF",source:"source___3rkh5",folder:"folder___AxGOK",choice:"choice___1AdWh",range:"range___23nFr",btn:"btn___1QiCj",knWarp:"knWarp___3eQQ5",kn:"kn___1OLj0",btns:"btns___26z5C",modalBody:"modalBody___1b2lK",active:"active___kELz6",inputWarp:"inputWarp___1leis",modal:"modal___1Ehn0",exportModal:"exportModal___1Vsj-",teachModal:"teachModal___CwfeZ",head:"head___2_Y6a",wraps:"wraps___3-f7m",body:"body___2Jb5Z"}},JYp7:function(rt,ue,l){"use strict";l.d(ue,"c",function(){return _e}),l.d(ue,"d",function(){return me}),l.d(ue,"f",function(){return Ee}),l.d(ue,"a",function(){return fe}),l.d(ue,"b",function(){return Y}),l.d(ue,"e",function(){return B});var q=function(){var N=function(A,_){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(C,O){C.__proto__=O}||function(C,O){for(var x in O)O.hasOwnProperty(x)&&(C[x]=O[x])},N(A,_)};return function(A,_){N(A,_);function C(){this.constructor=A}A.prototype=_===null?Object.create(_):(C.prototype=_.prototype,new C)}}(),_e={done:!0,value:void 0},me;(function(N){var A={next:function(){return _e}};function _(){return A}N.empty=_;function C(oe){var F=!1;return{next:function(){return F?_e:(F=!0,{done:!1,value:oe})}}}N.single=C;function O(oe,F,b){return F===void 0&&(F=0),b===void 0&&(b=oe.length),{next:function(){return F>=b?_e:{done:!1,value:oe[F++]}}}}N.fromArray=O;function x(oe){return{next:function(){var F=oe.next();return F.done?_e:{done:!1,value:F.value}}}}N.fromNativeIterator=x;function w(oe){return oe?Array.isArray(oe)?N.fromArray(oe):oe:N.empty()}N.from=w;function M(oe,F){return{next:function(){var b=oe.next();return b.done?_e:{done:!1,value:F(b.value)}}}}N.map=M;function m(oe,F){return{next:function(){for(;;){var b=oe.next();if(b.done)return _e;if(F(b.value))return{done:!1,value:b.value}}}}}N.filter=m;function v(oe,F){for(var b=oe.next();!b.done;b=oe.next())F(b.value)}N.forEach=v;function f(oe,F){F===void 0&&(F=Number.POSITIVE_INFINITY);var b=[];if(F===0)return b;for(var se=0,j=oe.next();!j.done&&!(b.push(j.value),++se>=F);j=oe.next());return b}N.collect=f;function L(){for(var oe=[],F=0;F<arguments.length;F++)oe[F]=arguments[F];var b=0;return{next:function(){if(b>=oe.length)return _e;var se=oe[b],j=se.next();return j.done?(b++,this.next()):j}}}N.concat=L;function ee(oe){return new we(oe)}N.chain=ee})(me||(me={}));var we=function(){function N(A){this.it=A}return N.prototype.next=function(){return this.it.next()},N}();function Ee(N){return Array.isArray(N)?me.fromArray(N):N||me.empty()}var fe=function(){function N(A,_,C,O){_===void 0&&(_=0),C===void 0&&(C=A.length),O===void 0&&(O=_-1),this.items=A,this.start=_,this.end=C,this.index=O}return N.prototype.first=function(){return this.index=this.start,this.current()},N.prototype.next=function(){return this.index=Math.min(this.index+1,this.end),this.current()},N.prototype.current=function(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]},N}(),Y=function(N){q(A,N);function A(_,C,O,x){return C===void 0&&(C=0),O===void 0&&(O=_.length),x===void 0&&(x=C-1),N.call(this,_,C,O,x)||this}return A.prototype.current=function(){return N.prototype.current.call(this)},A.prototype.previous=function(){return this.index=Math.max(this.index-1,this.start-1),this.current()},A.prototype.first=function(){return this.index=this.start,this.current()},A.prototype.last=function(){return this.index=this.end-1,this.current()},A.prototype.parent=function(){return null},A}(fe),B=function(){function N(A,_){this.iterator=A,this.fn=_}return N.prototype.next=function(){return this.fn(this.iterator.next())},N}()},K5AI:function(rt,ue,l){rt.exports={cInput:"cInput___2BJRi",cl:"cl___AbKoK",box:"box___3gRA9",box1:"box1___S3u_s",cr:"cr___16yEi"}},LdHM:function(rt,ue,l){"use strict";l.d(ue,"b",function(){return L}),l.d(ue,"a",function(){return oe});var q=l("1OyB"),_e=l("vuIU"),me=l("Ji7U"),we=l("LK+K"),Ee=l("q1tI"),fe=l("rePB"),Y=l("Ff2n"),B=l("ODXe"),N=l("4IlW"),A=l("bX4T"),_=l("YrtM"),C=l("TSYQ"),O=l.n(C),x=l("+nKL"),w=l("8OUc"),M=function(pe,Ue){var De=pe.prefixCls,nt=pe.id,Ne=pe.flattenOptions,Pe=pe.childrenAsData,ae=pe.values,Z=pe.searchValue,ye=pe.multiple,W=pe.defaultActiveFirstOption,T=pe.height,Ce=pe.itemHeight,We=pe.notFoundContent,Ze=pe.open,Be=pe.menuItemSelectedIcon,H=pe.virtual,G=pe.onSelect,he=pe.onToggleOpen,ke=pe.onActiveValue,Me=pe.onScroll,Ge=pe.onMouseEnter,et="".concat(De,"-item"),Ke=Object(_.a)(function(){return Ne},[Ze,Ne],function(Xe,$){return $[0]&&Xe[1]!==$[1]}),yt=Ee.useRef(null),ct=function($){$.preventDefault()},gt=function($){yt.current&&yt.current.scrollTo({index:$})},st=function($){for(var ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ie=Ke.length,P=0;P<ie;P+=1){var D=($+P*ne+ie)%ie,X=Ke[D],V=X.group,xe=X.data;if(!V&&!xe.disabled)return D}return-1},Ot=Ee.useState(function(){return st(0)}),xt=Object(B.a)(Ot,2),wt=xt[0],Le=xt[1],ft=function($){Le($);var ne=Ke[$];if(!ne){ke(null,-1);return}ke(ne.data.value,$)};Ee.useEffect(function(){ft(W!==!1?st(0):-1)},[Ke.length,Z]),Ee.useEffect(function(){var Xe=setTimeout(function(){if(!ye&&Ze&&ae.size===1){var $=Array.from(ae)[0],ne=Ke.findIndex(function(ie){var P=ie.data;return P.value===$});ft(ne),gt(ne)}});return function(){return clearTimeout(Xe)}},[Ze]);var At=function($){$!==void 0&&G($,{selected:!ae.has($)}),ye||he(!1)};if(Ee.useImperativeHandle(Ue,function(){return{onKeyDown:function($){var ne=$.which;switch(ne){case N.a.UP:case N.a.DOWN:{var ie=0;if(ne===N.a.UP?ie=-1:ne===N.a.DOWN&&(ie=1),ie!==0){var P=st(wt+ie,ie);gt(P),ft(P)}break}case N.a.ENTER:{var D=Ke[wt];D&&!D.data.disabled?At(D.data.value):At(void 0),Ze&&$.preventDefault();break}case N.a.ESC:he(!1)}},onKeyUp:function(){},scrollTo:function($){gt($)}}}),Ke.length===0)return Ee.createElement("div",{role:"listbox",id:"".concat(nt,"_list"),className:"".concat(et,"-empty"),onMouseDown:ct},We);function He(Xe){var $=Ke[Xe];if(!$)return null;var ne=$.data||{},ie=ne.value,P=ne.label,D=ne.children,X=Object(A.a)(ne,!0),V=Pe?D:P;return $?Ee.createElement("div",Object.assign({"aria-label":typeof V=="string"?V:null},X,{key:Xe,role:"option",id:"".concat(nt,"_list_").concat(Xe),"aria-selected":ae.has(ie)}),ie):null}return Ee.createElement(Ee.Fragment,null,Ee.createElement("div",{role:"listbox",id:"".concat(nt,"_list"),style:{height:0,width:0,overflow:"hidden"}},He(wt-1),He(wt),He(wt+1)),Ee.createElement(x.a,{itemKey:"key",ref:yt,data:Ke,height:T,itemHeight:Ce,fullHeight:!1,onMouseDown:ct,onScroll:Me,virtual:H,onMouseEnter:Ge},function(Xe,$){var ne,ie=Xe.group,P=Xe.groupOption,D=Xe.data,X=D.label,V=D.key;if(ie)return Ee.createElement("div",{className:O()(et,"".concat(et,"-group"))},X!==void 0?X:V);var xe=D.disabled,ve=D.value,Oe=D.title,lt=D.children,Ye=D.style,je=D.className,pt=Object(Y.a)(D,["disabled","value","title","children","style","className"]),Ut=ae.has(ve),ut="".concat(et,"-option"),$t=O()(et,ut,je,(ne={},Object(fe.a)(ne,"".concat(ut,"-grouped"),P),Object(fe.a)(ne,"".concat(ut,"-active"),wt===$&&!xe),Object(fe.a)(ne,"".concat(ut,"-disabled"),xe),Object(fe.a)(ne,"".concat(ut,"-selected"),Ut),ne)),ot=Pe?lt:X,Xt=!Be||typeof Be=="function"||Ut;return Ee.createElement("div",Object.assign({},pt,{"aria-selected":Ut,className:$t,title:Oe,onMouseMove:function(){if(wt===$||xe)return;ft($)},onClick:function(){xe||At(ve)},style:Ye}),Ee.createElement("div",{className:"".concat(ut,"-content")},ot||ve),Ee.isValidElement(Be)||Ut,Xt&&Ee.createElement(w.a,{className:"".concat(et,"-option-state"),customizeIcon:Be,customizeIconProps:{isSelected:Ut}},Ut?"\u2713":null))}))},m=Ee.forwardRef(M);m.displayName="OptionList";var v=m,f=function(){return null};f.isSelectOption=!0;var L=f,ee=function(){return null};ee.isSelectOptGroup=!0;var oe=ee,F=l("VTBJ"),b=l("Zm9Q");function se(y){var pe=y.key,Ue=y.props,De=Ue.children,nt=Ue.value,Ne=Object(Y.a)(Ue,["children","value"]);return Object(F.a)({key:pe,value:nt!==void 0?nt:pe,children:De},Ne)}function j(y){var pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(b.a)(y).map(function(Ue,De){if(!Ee.isValidElement(Ue)||!Ue.type)return null;var nt=Ue.type.isSelectOptGroup,Ne=Ue.key,Pe=Ue.props,ae=Pe.children,Z=Object(Y.a)(Pe,["children"]);return pe||!nt?se(Ue):Object(F.a)(Object(F.a)({key:"__RC_SELECT_GRP__".concat(Ne===null?De:Ne,"__"),label:Ne},Z),{},{options:j(ae)})}).filter(function(Ue){return Ue})}var re=l("2Qr1"),k=l("qNPg"),S=l("U8pU"),Q=l("Kwbf"),z=l("WKfj");function U(y){var pe=y.mode,Ue=y.options,De=y.children,nt=y.backfill,Ne=y.allowClear,Pe=y.placeholder,ae=y.getInputElement,Z=y.showSearch,ye=y.onSearch,W=y.defaultOpen,T=y.autoFocus,Ce=y.labelInValue,We=y.value,Ze=y.inputValue,Be=y.optionLabelProp,H=pe==="multiple"||pe==="tags",G=Z!==void 0?Z:H||pe==="combobox",he=Ue||j(De);if(Object(Q.a)(pe!=="tags"||he.every(function(et){return!et.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),pe==="tags"||pe==="combobox"){var ke=he.some(function(et){return et.options?et.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in et?et.value:et.key)=="number"});Object(Q.a)(!ke,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(Q.a)(pe!=="combobox"||!Be,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(Q.a)(pe==="combobox"||!nt,"`backfill` only works with `combobox` mode."),Object(Q.a)(pe==="combobox"||!ae,"`getInputElement` only work with `combobox` mode."),Object(Q.b)(pe!=="combobox"||!ae||!Ne||!Pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ye&&!G&&pe!=="combobox"&&pe!=="tags"&&Object(Q.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(Q.b)(!W||T,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),We!=null){var Me=Object(z.d)(We);Object(Q.a)(!Ce||Me.every(function(et){return Object(S.a)(et)==="object"&&("key"in et||"value"in et)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(Q.a)(!H||Array.isArray(We),"`value` should be array when `mode` is `multiple` or `tags`")}if(De){var Ge=null;Object(b.a)(De).some(function(et){if(!Ee.isValidElement(et)||!et.type)return!1;var Ke=et.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var yt=Object(b.a)(et.props.children).every(function(ct){return!Ee.isValidElement(ct)||!et.type||ct.type.isSelectOption?!0:(Ge=ct.type,!1)});return!yt}return Ge=Ke,!0}),Ge&&Object(Q.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ge.displayName||Ge.name||Ge,"`.")),Object(Q.a)(Ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var K=U,de=Object(k.a)({prefixCls:"rc-select",components:{optionList:v},convertChildrenToData:j,flattenOptions:re.d,getLabeledValue:re.e,filterOptions:re.b,isValueDisabled:re.g,findValueOption:re.c,warningProps:K,fillOptionsWithMissingValue:re.a}),J=function(y){Object(me.a)(Ue,y);var pe=Object(we.a)(Ue);function Ue(){var De;return Object(q.a)(this,Ue),De=pe.apply(this,arguments),De.selectRef=Ee.createRef(),De.focus=function(){De.selectRef.current.focus()},De.blur=function(){De.selectRef.current.blur()},De}return Object(_e.a)(Ue,[{key:"render",value:function(){return Ee.createElement(de,Object.assign({ref:this.selectRef},this.props))}}]),Ue}(Ee.Component);J.Option=L,J.OptGroup=oe;var be=J,I=ue.c=be},M8RZ:function(rt,ue,l){"use strict";l.d(ue,"a",function(){return N});var q=l("fWQN"),_e=l("mtLc"),me=l("yKVA"),we=l("879j"),Ee=l("q1tI"),fe=l.n(Ee),Y=l("i8i4"),B=l.n(Y),N=function(A){Object(me.a)(C,A);var _=Object(we.a)(C);function C(O){var x;Object(q.a)(this,C),x=_.call(this,O);var w=window.document;return x.node=w.createElement("div"),w.body.appendChild(x.node),x}return Object(_e.a)(C,[{key:"render",value:function(){var x=this.props.children;return Object(Y.createPortal)(x,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),C}(fe.a.Component)},MI8n:function(rt,ue,l){"use strict";l.d(ue,"b",function(){return fe}),l.d(ue,"a",function(){return N}),l.d(ue,"e",function(){return A}),l.d(ue,"d",function(){return _}),l.d(ue,"c",function(){return C}),l.d(ue,"f",function(){return O});var q=l("/cxE"),_e=l("C/vA"),me=l("pmY6"),we=l("24hK"),Ee=function(){var x=function(w,M){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,v){m.__proto__=v}||function(m,v){for(var f in v)v.hasOwnProperty(f)&&(m[f]=v[f])},x(w,M)};return function(w,M){x(w,M);function m(){this.constructor=w}w.prototype=M===null?Object.create(M):(m.prototype=M.prototype,new m)}}(),fe;(function(x){x.None=function(){return me.a.None};function w(K){return function(de,J,be){J===void 0&&(J=null);var I=!1,y;return y=K(function(pe){return I?void 0:(y?y.dispose():I=!0,de.call(J,pe))},null,be),I&&y.dispose(),y}}x.once=w;function M(K,de){return oe(function(J,be,I){return be===void 0&&(be=null),K(function(y){return J.call(be,de(y))},null,I)})}x.map=M;function m(K,de){return oe(function(J,be,I){return be===void 0&&(be=null),K(function(y){de(y),J.call(be,y)},null,I)})}x.forEach=m;function v(K,de){return oe(function(J,be,I){return be===void 0&&(be=null),K(function(y){return de(y)&&J.call(be,y)},null,I)})}x.filter=v;function f(K){return K}x.signal=f;function L(){for(var K=[],de=0;de<arguments.length;de++)K[de]=arguments[de];return function(J,be,I){return be===void 0&&(be=null),me.e.apply(void 0,K.map(function(y){return y(function(pe){return J.call(be,pe)},null,I)}))}}x.any=L;function ee(K,de,J){var be=J;return M(K,function(I){return be=de(be,I),be})}x.reduce=ee;function oe(K){var de,J=new N({onFirstListenerAdd:function(){de=K(J.fire,J)},onLastListenerRemove:function(){de.dispose()}});return J.event}x.snapshot=oe;function F(K,de,J,be,I){J===void 0&&(J=100),be===void 0&&(be=!1);var y,pe=void 0,Ue=void 0,De=0,nt=new N({leakWarningThreshold:I,onFirstListenerAdd:function(){y=K(function(Ne){De++,pe=de(pe,Ne),be&&!Ue&&(nt.fire(pe),pe=void 0),clearTimeout(Ue),Ue=setTimeout(function(){var Pe=pe;pe=void 0,Ue=void 0,(!be||De>1)&&nt.fire(Pe),De=0},J)})},onLastListenerRemove:function(){y.dispose()}});return nt.event}x.debounce=F;function b(K){var de=new Date().getTime();return M(w(K),function(J){return new Date().getTime()-de})}x.stopwatch=b;function se(K){var de=!0,J;return v(K,function(be){var I=de||be!==J;return de=!1,J=be,I})}x.latch=se;function j(K,de,J){de===void 0&&(de=!1),J===void 0&&(J=[]);var be=J.slice(),I=K(function(Ue){be?be.push(Ue):pe.fire(Ue)}),y=function(){be&&be.forEach(function(Ue){return pe.fire(Ue)}),be=null},pe=new N({onFirstListenerAdd:function(){I||(I=K(function(Ue){return pe.fire(Ue)}))},onFirstListenerDidAdd:function(){be&&(de?setTimeout(y):y())},onLastListenerRemove:function(){I&&I.dispose(),I=null}});return pe.event}x.buffer=j;var re=function(){function K(de){this.event=de}return K.prototype.map=function(de){return new K(M(this.event,de))},K.prototype.forEach=function(de){return new K(m(this.event,de))},K.prototype.filter=function(de){return new K(v(this.event,de))},K.prototype.reduce=function(de,J){return new K(ee(this.event,de,J))},K.prototype.latch=function(){return new K(se(this.event))},K.prototype.debounce=function(de,J,be,I){return J===void 0&&(J=100),be===void 0&&(be=!1),new K(F(this.event,de,J,be,I))},K.prototype.on=function(de,J,be){return this.event(de,J,be)},K.prototype.once=function(de,J,be){return w(this.event)(de,J,be)},K}();function k(K){return new re(K)}x.chain=k;function S(K,de,J){J===void 0&&(J=function(Ue){return Ue});var be=function(){for(var Ue=[],De=0;De<arguments.length;De++)Ue[De]=arguments[De];return pe.fire(J.apply(void 0,Ue))},I=function(){return K.on(de,be)},y=function(){return K.removeListener(de,be)},pe=new N({onFirstListenerAdd:I,onLastListenerRemove:y});return pe.event}x.fromNodeEventEmitter=S;function Q(K,de,J){J===void 0&&(J=function(Ue){return Ue});var be=function(){for(var Ue=[],De=0;De<arguments.length;De++)Ue[De]=arguments[De];return pe.fire(J.apply(void 0,Ue))},I=function(){return K.addEventListener(de,be)},y=function(){return K.removeEventListener(de,be)},pe=new N({onFirstListenerAdd:I,onLastListenerRemove:y});return pe.event}x.fromDOMEventEmitter=Q;function z(K){var de=new N,J=!1;return K.then(void 0,function(){return null}).then(function(){J?de.fire(void 0):setTimeout(function(){return de.fire(void 0)},0)}),J=!0,de.event}x.fromPromise=z;function U(K){return new Promise(function(de){return w(K)(de)})}x.toPromise=U})(fe||(fe={}));var Y=-1,B=function(){function x(w,M){M===void 0&&(M=Math.random().toString(18).slice(2,5)),this.customThreshold=w,this.name=M,this._warnCountdown=0}return x.prototype.dispose=function(){this._stacks&&this._stacks.clear()},x.prototype.check=function(w){var M=this,m=Y;if(typeof this.customThreshold=="number"&&(m=this.customThreshold),m<=0||w<m)return;this._stacks||(this._stacks=new Map);var v=new Error().stack.split(`
`).slice(3).join(`
`),f=this._stacks.get(v)||0;if(this._stacks.set(v,f+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=m*.5;var L,ee=0;this._stacks.forEach(function(oe,F){(!L||ee<oe)&&(L=F,ee=oe)}),console.warn("["+this.name+"] potential listener LEAK detected, having "+w+" listeners already. MOST frequent listener ("+ee+"):"),console.warn(L)}return function(){var oe=M._stacks.get(v)||0;M._stacks.set(v,oe-1)}},x}(),N=function(){function x(w){this._disposed=!1,this._options=w,this._leakageMon=Y>0?new B(this._options&&this._options.leakWarningThreshold):void 0}return Object.defineProperty(x.prototype,"event",{get:function(){var w=this;return this._event||(this._event=function(M,m,v){w._listeners||(w._listeners=new we.a);var f=w._listeners.isEmpty();f&&w._options&&w._options.onFirstListenerAdd&&w._options.onFirstListenerAdd(w);var L=w._listeners.push(m?[M,m]:M);f&&w._options&&w._options.onFirstListenerDidAdd&&w._options.onFirstListenerDidAdd(w),w._options&&w._options.onListenerDidAdd&&w._options.onListenerDidAdd(w,M,m);var ee;w._leakageMon&&(ee=w._leakageMon.check(w._listeners.size));var oe;return oe={dispose:function(){if(ee&&ee(),oe.dispose=x._noop,!w._disposed&&(L(),w._options&&w._options.onLastListenerRemove)){var F=w._listeners&&!w._listeners.isEmpty();F||w._options.onLastListenerRemove(w)}}},v instanceof me.b?v.add(oe):Array.isArray(v)&&v.push(oe),oe}),this._event},enumerable:!0,configurable:!0}),x.prototype.fire=function(w){if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new we.a);for(var M=this._listeners.iterator(),m=M.next();!m.done;m=M.next())this._deliveryQueue.push([m.value,w]);for(;this._deliveryQueue.size>0;){var v=this._deliveryQueue.shift(),f=v[0],L=v[1];try{typeof f=="function"?f.call(void 0,L):f[0].call(f[1],L)}catch(ee){Object(q.e)(ee)}}}},x.prototype.dispose=function(){this._listeners&&this._listeners.clear(),this._deliveryQueue&&this._deliveryQueue.clear(),this._leakageMon&&this._leakageMon.dispose(),this._disposed=!0},x._noop=function(){},x}(),A=function(x){Ee(w,x);function w(M){var m=x.call(this,M)||this;return m._isPaused=0,m._eventQueue=new we.a,m._mergeFn=M&&M.merge,m}return w.prototype.pause=function(){this._isPaused++},w.prototype.resume=function(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){var M=this._eventQueue.toArray();this._eventQueue.clear(),x.prototype.fire.call(this,this._mergeFn(M))}else for(;!this._isPaused&&this._eventQueue.size!==0;)x.prototype.fire.call(this,this._eventQueue.shift())},w.prototype.fire=function(M){this._listeners&&(this._isPaused!==0?this._eventQueue.push(M):x.prototype.fire.call(this,M))},w}(N),_=function(){function x(){var w=this;this.hasListeners=!1,this.events=[],this.emitter=new N({onFirstListenerAdd:function(){return w.onFirstListenerAdd()},onLastListenerRemove:function(){return w.onLastListenerRemove()}})}return Object.defineProperty(x.prototype,"event",{get:function(){return this.emitter.event},enumerable:!0,configurable:!0}),x.prototype.add=function(w){var M=this,m={event:w,listener:null};this.events.push(m),this.hasListeners&&this.hook(m);var v=function(){M.hasListeners&&M.unhook(m);var f=M.events.indexOf(m);M.events.splice(f,1)};return Object(me.h)(Object(_e.a)(v))},x.prototype.onFirstListenerAdd=function(){var w=this;this.hasListeners=!0,this.events.forEach(function(M){return w.hook(M)})},x.prototype.onLastListenerRemove=function(){var w=this;this.hasListeners=!1,this.events.forEach(function(M){return w.unhook(M)})},x.prototype.hook=function(w){var M=this;w.listener=w.event(function(m){return M.emitter.fire(m)})},x.prototype.unhook=function(w){w.listener&&w.listener.dispose(),w.listener=null},x.prototype.dispose=function(){this.emitter.dispose()},x}(),C=function(){function x(){this.buffers=[]}return x.prototype.wrapEvent=function(w){var M=this;return function(m,v,f){return w(function(L){var ee=M.buffers[M.buffers.length-1];ee?ee.push(function(){return m.call(v,L)}):m.call(v,L)},void 0,f)}},x.prototype.bufferEvents=function(w){var M=[];this.buffers.push(M);var m=w();return this.buffers.pop(),M.forEach(function(v){return v()}),m},x}(),O=function(){function x(){var w=this;this.listening=!1,this.inputEvent=fe.None,this.inputEventListener=me.a.None,this.emitter=new N({onFirstListenerDidAdd:function(){w.listening=!0,w.inputEventListener=w.inputEvent(w.emitter.fire,w.emitter)},onLastListenerRemove:function(){w.listening=!1,w.inputEventListener.dispose()}}),this.event=this.emitter.event}return Object.defineProperty(x.prototype,"input",{set:function(w){this.inputEvent=w,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=w(this.emitter.fire,this.emitter))},enumerable:!0,configurable:!0}),x.prototype.dispose=function(){this.inputEventListener.dispose(),this.emitter.dispose()},x}()},N0LK:function(rt,ue,l){"use strict";l.d(ue,"x",function(){return q}),l.d(ue,"F",function(){return _e}),l.d(ue,"r",function(){return we}),l.d(ue,"o",function(){return Ee}),l.d(ue,"p",function(){return fe}),l.d(ue,"Q",function(){return Y}),l.d(ue,"K",function(){return N}),l.d(ue,"k",function(){return A}),l.d(ue,"N",function(){return _}),l.d(ue,"m",function(){return C}),l.d(ue,"l",function(){return O}),l.d(ue,"I",function(){return x}),l.d(ue,"H",function(){return w}),l.d(ue,"q",function(){return M}),l.d(ue,"t",function(){return m}),l.d(ue,"D",function(){return v}),l.d(ue,"e",function(){return f}),l.d(ue,"f",function(){return L}),l.d(ue,"B",function(){return ee}),l.d(ue,"C",function(){return oe}),l.d(ue,"n",function(){return b}),l.d(ue,"O",function(){return j}),l.d(ue,"c",function(){return re}),l.d(ue,"d",function(){return k}),l.d(ue,"z",function(){return S}),l.d(ue,"A",function(){return Q}),l.d(ue,"u",function(){return z}),l.d(ue,"E",function(){return K}),l.d(ue,"G",function(){return de}),l.d(ue,"i",function(){return be}),l.d(ue,"g",function(){return y}),l.d(ue,"v",function(){return Ue}),l.d(ue,"h",function(){return De}),l.d(ue,"y",function(){return nt}),l.d(ue,"w",function(){return Ne}),l.d(ue,"a",function(){return Pe}),l.d(ue,"P",function(){return ae}),l.d(ue,"L",function(){return Z}),l.d(ue,"J",function(){return ye}),l.d(ue,"j",function(){return W}),l.d(ue,"M",function(){return T}),l.d(ue,"s",function(){return Ce}),l.d(ue,"b",function(){return We});function q(H){return!H||typeof H!="string"?!0:H.trim().length===0}function _e(H,G,he){he===void 0&&(he="0");for(var ke=""+H,Me=[ke],Ge=ke.length;Ge<G;Ge++)Me.push(he);return Me.reverse().join("")}var me=/{(\d+)}/g;function we(H){for(var G=[],he=1;he<arguments.length;he++)G[he-1]=arguments[he];return G.length===0?H:H.replace(me,function(ke,Me){var Ge=parseInt(Me,10);return isNaN(Ge)||Ge<0||Ge>=G.length?ke:G[Ge]})}function Ee(H){return H.replace(/[<>&]/g,function(G){switch(G){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return G}})}function fe(H){return H.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function Y(H,G){G===void 0&&(G=" ");var he=B(H,G);return N(he,G)}function B(H,G){if(!H||!G)return H;var he=G.length;if(he===0||H.length===0)return H;for(var ke=0;H.indexOf(G,ke)===ke;)ke=ke+he;return H.substring(ke)}function N(H,G){if(!H||!G)return H;var he=G.length,ke=H.length;if(he===0||ke===0)return H;for(var Me=ke,Ge=-1;!(Ge=H.lastIndexOf(G,Me-1),Ge===-1||Ge+he!==Me);){if(Ge===0)return"";Me=Ge}return H.substring(0,Me)}function A(H){return H.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function _(H,G){if(H.length<G.length)return!1;if(H===G)return!0;for(var he=0;he<G.length;he++)if(H[he]!==G[he])return!1;return!0}function C(H,G){var he=H.length-G.length;return he>0?H.indexOf(G,he)===he:he===0?H===G:!1}function O(H,G,he){if(he===void 0&&(he={}),!H)throw new Error("Cannot create regex from empty string");G||(H=fe(H)),he.wholeWord&&(/\B/.test(H.charAt(0))||(H="\\b"+H),/\B/.test(H.charAt(H.length-1))||(H=H+"\\b"));var ke="";return he.global&&(ke+="g"),he.matchCase||(ke+="i"),he.multiline&&(ke+="m"),he.unicode&&(ke+="u"),new RegExp(H,ke)}function x(H){if(H.source==="^"||H.source==="^$"||H.source==="$"||H.source==="^\\s*$")return!1;var G=H.exec("");return!!(G&&H.lastIndex===0)}function w(H){return(H.global?"g":"")+(H.ignoreCase?"i":"")+(H.multiline?"m":"")+(H.unicode?"u":"")}function M(H){for(var G=0,he=H.length;G<he;G++){var ke=H.charCodeAt(G);if(ke!==32&&ke!==9)return G}return-1}function m(H,G,he){G===void 0&&(G=0),he===void 0&&(he=H.length);for(var ke=G;ke<he;ke++){var Me=H.charCodeAt(ke);if(Me!==32&&Me!==9)return H.substring(G,ke)}return H.substring(G,he)}function v(H,G){G===void 0&&(G=H.length-1);for(var he=G;he>=0;he--){var ke=H.charCodeAt(he);if(ke!==32&&ke!==9)return he}return-1}function f(H,G){return H<G?-1:H>G?1:0}function L(H,G){for(var he=Math.min(H.length,G.length),ke=0;ke<he;ke++){var Me=H.charCodeAt(ke),Ge=G.charCodeAt(ke);if(Me===Ge)continue;oe(Me)&&(Me+=32),oe(Ge)&&(Ge+=32);var et=Me-Ge;if(et===0)continue;return ee(Me)&&ee(Ge)?et:f(H.toLowerCase(),G.toLowerCase())}return H.length<G.length?-1:H.length>G.length?1:0}function ee(H){return H>=97&&H<=122}function oe(H){return H>=65&&H<=90}function F(H){return ee(H)||oe(H)}function b(H,G){return H.length===G.length&&se(H,G)}function se(H,G,he){he===void 0&&(he=H.length);for(var ke=0;ke<he;ke++){var Me=H.charCodeAt(ke),Ge=G.charCodeAt(ke);if(Me===Ge)continue;if(F(Me)&&F(Ge)){var et=Math.abs(Me-Ge);if(et!==0&&et!==32)return!1}else if(String.fromCharCode(Me).toLowerCase()!==String.fromCharCode(Ge).toLowerCase())return!1}return!0}function j(H,G){var he=G.length;return G.length>H.length?!1:se(H,G,he)}function re(H,G){var he,ke=Math.min(H.length,G.length);for(he=0;he<ke;he++)if(H.charCodeAt(he)!==G.charCodeAt(he))return he;return ke}function k(H,G){var he,ke=Math.min(H.length,G.length),Me=H.length-1,Ge=G.length-1;for(he=0;he<ke;he++)if(H.charCodeAt(Me-he)!==G.charCodeAt(Ge-he))return he;return ke}function S(H){return 55296<=H&&H<=56319}function Q(H){return 56320<=H&&H<=57343}function z(H,G,he){var ke=H.charCodeAt(he);if(S(ke)&&he+1<G){var Me=H.charCodeAt(he+1);if(Q(Me))return(ke-55296<<10)+(Me-56320)+65536}return ke}function U(H,G){var he=H.charCodeAt(G-1);if(Q(he)&&G>1){var ke=H.charCodeAt(G-2);if(S(ke))return(ke-55296<<10)+(he-56320)+65536}return he}function K(H,G){var he=Ze.getInstance(),ke=G,Me=H.length,Ge=z(H,Me,G);G+=Ge>=65536?2:1;for(var et=he.getGraphemeBreakType(Ge);G<Me;){var Ke=z(H,Me,G),yt=he.getGraphemeBreakType(Ke);if(We(et,yt))break;G+=Ke>=65536?2:1,et=yt}return G-ke}function de(H,G){var he=Ze.getInstance(),ke=G,Me=U(H,G);G-=Me>=65536?2:1;for(var Ge=he.getGraphemeBreakType(Me);G>0;){var et=U(H,G),Ke=he.getGraphemeBreakType(et);if(We(Ke,Ge))break;G-=et>=65536?2:1,Ge=Ke}return ke-G}var J=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function be(H){return J.test(H)}var I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;function y(H){return I.test(H)}var pe=/^[\t\n\r\x20-\x7E]*$/;function Ue(H){return pe.test(H)}function De(H){for(var G=0,he=H.length;G<he;G++)if(nt(H.charCodeAt(G)))return!0;return!1}function nt(H){return H=+H,H>=11904&&H<=55215||H>=63744&&H<=64255||H>=65281&&H<=65374}function Ne(H){return H>=127462&&H<=127487||H>=9728&&H<=10175||H>=127744&&H<=128591||H>=128640&&H<=128764||H>=128992&&H<=129003||H>=129280&&H<=129535||H>=129648&&H<=129651||H>=129656&&H<=129666||H>=129680&&H<=129685}var Pe=String.fromCharCode(65279);function ae(H){return!!(H&&H.length>0&&H.charCodeAt(0)===65279)}function Z(H){return btoa(encodeURIComponent(H))}function ye(H,G){for(var he="",ke=0;ke<G;ke++)he+=H;return he}function W(H,G){return G===void 0&&(G=!1),H?(G&&(H=H.replace(/\\./g,"")),H.toLowerCase()!==H):!1}function T(H){var G=90-65+1;return H=H%(2*G),H<G?String.fromCharCode(97+H):String.fromCharCode(65+H-G)}function Ce(H){var G=Ze.getInstance();return G.getGraphemeBreakType(H)}function We(H,G){return H===0?G!==5&&G!==7:H===2&&G===3?!1:H===4||H===2||H===3||(G===4||G===2||G===3)?!0:H===8&&(G===8||G===9||G===11||G===12)||((H===11||H===9)&&(G===9||G===10)||((H===12||H===10)&&G===10||(G===5||G===13||(G===7||(H===1||H===13&&G===14)))))?!1:!(H===6&&G===6)}var Ze=function(){function H(){this._data=Be()}return H.getInstance=function(){return H._INSTANCE||(H._INSTANCE=new H),H._INSTANCE},H.prototype.getGraphemeBreakType=function(G){if(G<32)return G===10?3:G===13?2:4;if(G<127)return 0;for(var he=this._data,ke=he.length/3,Me=1;Me<=ke;)if(G<he[3*Me])Me=2*Me;else if(G>he[3*Me+1])Me=2*Me+1;else return he[3*Me+2];return 0},H._INSTANCE=null,H}();function Be(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}},NvD2:function(rt,ue,l){"use strict";l.d(ue,"a",function(){return fe});var q=l("Kwbf");function _e(Y,B){var N=new Set;return Y.forEach(function(A){B.has(A)||N.add(A)}),N}function me(Y){var B=Y||{},N=B.disabled,A=B.disableCheckbox,_=B.checkable;return!!(N||A)||_===!1}function we(Y,B,N,A){for(var _=new Set(Y),C=new Set,O=0;O<=N;O+=1){var x=B.get(O)||new Set;x.forEach(function(v){var f=v.key,L=v.node,ee=v.children,oe=ee===void 0?[]:ee;_.has(f)&&!A(L)&&oe.filter(function(F){return!A(F.node)}).forEach(function(F){_.add(F.key)})})}for(var w=new Set,M=N;M>=0;M-=1){var m=B.get(M)||new Set;m.forEach(function(v){var f=v.parent,L=v.node;if(A(L)||!v.parent||w.has(v.parent.key))return;if(A(v.parent.node)){w.add(f.key);return}var ee=!0,oe=!1;(f.children||[]).filter(function(F){return!A(F.node)}).forEach(function(F){var b=F.key,se=_.has(b);ee&&!se&&(ee=!1),!oe&&(se||C.has(b))&&(oe=!0)}),ee&&_.add(f.key),oe&&C.add(f.key),w.add(f.key)})}return{checkedKeys:Array.from(_),halfCheckedKeys:Array.from(_e(C,_))}}function Ee(Y,B,N,A,_){for(var C=new Set(Y),O=new Set(B),x=0;x<=A;x+=1){var w=N.get(x)||new Set;w.forEach(function(f){var L=f.key,ee=f.node,oe=f.children,F=oe===void 0?[]:oe;!C.has(L)&&!O.has(L)&&!_(ee)&&F.filter(function(b){return!_(b.node)}).forEach(function(b){C.delete(b.key)})})}O=new Set;for(var M=new Set,m=A;m>=0;m-=1){var v=N.get(m)||new Set;v.forEach(function(f){var L=f.parent,ee=f.node;if(_(ee)||!f.parent||M.has(f.parent.key))return;if(_(f.parent.node)){M.add(L.key);return}var oe=!0,F=!1;(L.children||[]).filter(function(b){return!_(b.node)}).forEach(function(b){var se=b.key,j=C.has(se);oe&&!j&&(oe=!1),!F&&(j||O.has(se))&&(F=!0)}),oe||C.delete(L.key),F&&O.add(L.key),M.add(L.key)})}return{checkedKeys:Array.from(C),halfCheckedKeys:Array.from(_e(O,C))}}function fe(Y,B,N,A){var _=[],C;A?C=A:C=me;var O=new Set(Y.filter(function(m){var v=!!N[m];return v||_.push(m),v})),x=new Map,w=0;Object.keys(N).forEach(function(m){var v=N[m],f=v.level,L=x.get(f);L||(L=new Set,x.set(f,L)),L.add(v),w=Math.max(w,f)}),Object(q.a)(!_.length,"Tree missing follow keys: ".concat(_.slice(0,100).map(function(m){return"'".concat(m,"'")}).join(", ")));var M;return B===!0?M=we(O,x,w,C):M=Ee(O,B.halfCheckedKeys,x,w,C),M}},O2Wb:function(rt,ue,l){rt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(rt,ue,l){"use strict";var q=l("U8pU"),_e=l("VTBJ"),me=l("Ff2n"),we=l("q1tI"),Ee=l("uciX"),fe=l("7ixt"),Y=function(O){var x=O.overlay,w=O.prefixCls,M=O.id,m=O.overlayInnerStyle;return we.createElement("div",{className:"".concat(w,"-inner"),id:M,role:"tooltip",style:m},typeof x=="function"?x():x)},B=Y,N=function(O,x){var w=O.overlayClassName,M=O.trigger,m=M===void 0?["hover"]:M,v=O.mouseEnterDelay,f=v===void 0?0:v,L=O.mouseLeaveDelay,ee=L===void 0?.1:L,oe=O.overlayStyle,F=O.prefixCls,b=F===void 0?"rc-tooltip":F,se=O.children,j=O.onVisibleChange,re=O.afterVisibleChange,k=O.transitionName,S=O.animation,Q=O.placement,z=Q===void 0?"right":Q,U=O.align,K=U===void 0?{}:U,de=O.destroyTooltipOnHide,J=de===void 0?!1:de,be=O.defaultVisible,I=O.getTooltipContainer,y=O.overlayInnerStyle,pe=Object(me.a)(O,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Ue=Object(we.useRef)(null);Object(we.useImperativeHandle)(x,function(){return Ue.current});var De=Object(_e.a)({},pe);"visible"in O&&(De.popupVisible=O.visible);var nt=function(){var ye=O.arrowContent,W=ye===void 0?null:ye,T=O.overlay,Ce=O.id;return[we.createElement("div",{className:"".concat(b,"-arrow"),key:"arrow"},W),we.createElement(B,{key:"content",prefixCls:b,id:Ce,overlay:T,overlayInnerStyle:y})]},Ne=!1,Pe=!1;if(typeof J=="boolean")Ne=J;else if(J&&Object(q.a)(J)==="object"){var ae=J.keepParent;Ne=ae===!0,Pe=ae===!1}return we.createElement(Ee.a,Object.assign({popupClassName:w,prefixCls:b,popup:nt,action:m,builtinPlacements:fe.a,popupPlacement:z,ref:Ue,popupAlign:K,getPopupContainer:I,onPopupVisibleChange:j,afterPopupVisibleChange:re,popupTransitionName:k,popupAnimation:S,defaultPopupVisible:be,destroyPopupOnHide:Ne,autoDestroy:Pe,mouseLeaveDelay:ee,popupStyle:oe,mouseEnterDelay:f},De),se)},A=Object(we.forwardRef)(N),_=ue.a=A},OZM5:function(rt,ue,l){"use strict";l.d(ue,"b",function(){return A}),l.d(ue,"a",function(){return _}),l.d(ue,"k",function(){return C}),l.d(ue,"h",function(){return O}),l.d(ue,"i",function(){return x}),l.d(ue,"g",function(){return w}),l.d(ue,"c",function(){return M}),l.d(ue,"d",function(){return m}),l.d(ue,"j",function(){return L}),l.d(ue,"e",function(){return ee}),l.d(ue,"f",function(){return oe});var q=l("KQm4"),_e=l("U8pU"),me=l("Ff2n"),we=l("q1tI"),Ee=l.n(we),fe=l("Kwbf"),Y=l("WaYH"),B=.25,N=2;function A(F,b){var se=F.slice(),j=se.indexOf(b);return j>=0&&se.splice(j,1),se}function _(F,b){var se=F.slice();return se.indexOf(b)===-1&&se.push(b),se}function C(F){return F.split("-")}function O(F,b){return"".concat(F,"-").concat(b)}function x(F){return F&&F.type&&F.type.isTreeNode}function w(F,b){var se=[F],j=b[F];function re(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];k.forEach(function(S){var Q=S.key,z=S.children;se.push(Q),re(z)})}return re(j.children),se}function M(F,b){var se=F.clientY,j=b.selectHandle.getBoundingClientRect(),re=j.top,k=j.bottom,S=j.height,Q=Math.max(S*B,N);return se<=re+Q?-1:se>=k-Q?1:0}function m(F,b){if(!F)return;var se=b.multiple;return se?F.slice():F.length?[F[0]]:F}var v=function(b){return b};function f(F,b){if(!F)return[];var se=b||{},j=se.processProps,re=j===void 0?v:j,k=Array.isArray(F)?F:[F];return k.map(function(S){var Q=S.children,z=Object(me.a)(S,["children"]),U=f(Q,b);return Ee.a.createElement(Y.a,Object.assign({},re(z)),U)})}function L(F){if(!F)return null;var b;if(Array.isArray(F))b={checkedKeys:F,halfCheckedKeys:void 0};else if(Object(_e.a)(F)==="object")b={checkedKeys:F.checked||void 0,halfCheckedKeys:F.halfChecked||void 0};else return Object(fe.a)(!1,"`checkedKeys` is not an array or an object"),null;return b}function ee(F,b){var se=new Set;function j(re){if(se.has(re))return;var k=b[re];if(!k)return;se.add(re);var S=k.parent,Q=k.node;if(Q.disabled)return;S&&j(S.key)}return(F||[]).forEach(function(re){j(re)}),Object(q.a)(se)}function oe(F){var b={};return Object.keys(F).forEach(function(se){(se.startsWith("data-")||se.startsWith("aria-"))&&(b[se]=F[se])}),b}},Ot1p:function(rt,ue,l){"use strict";var q=l("2qtc"),_e=l("kLXV"),me=l("rAM+"),we=l("miYZ"),Ee=l("tsqr"),fe=l("9og8"),Y=l("tJVT"),B=l("jrin"),N=l("WmNS"),A=l.n(N),_=l("q1tI"),C=l.n(_),O=l("VrN/"),x=l.n(O),w=l("bdgK"),M=l("p77/"),m=l("Bd2K"),v=l("ELLl"),f=l("19Vz"),L=l("lZu9"),ee=l("+NIl"),oe=l("kSUc"),F=l("9Bee"),b=function(ve){var Oe=ve.value,lt=Oe===void 0?"":Oe,Ye=ve.className,je=ve.showTextOnly,pt=ve.showLines,Ut=ve.style,ut=Ut===void 0?{}:Ut,$t=Object(_.useMemo)(function(){return""},[lt]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:$t}}))},se=l("0Owb"),j=l("dejd"),re=l("C+DQ"),k=l("1vsH"),S=l("m3rI"),Q=[{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 z(ve){var Oe=ve.onActionCallback,lt=ve.title,Ye=ve.icon,je=ve.actionName,pt=ve.className,Ut=pt===void 0?"":pt,ut=ve.children;function $t(){Oe(je)}return C.a.createElement("a",{title:lt,className:Ut,onClick:$t},C.a.createElement("i",{className:"md-iconfont ".concat(Ye)}),ut)}var U=function(ve){var Oe=ve.watch,lt=ve.showNullButton,Ye=ve.onActionCallback,je=ve.fullScreen,pt=ve.insertTemp,Ut=ve.hidetoolBar,ut=ve.uuid,$t=ve.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(k.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(k.D)("_educoder_session"),"&key=").concat(ut,"&api=").concat(encodeURIComponent(S.a.PROXY_SERVER)));var ot=[].concat(Q,[{title:"".concat(Oe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Oe?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return C.a.createElement("ul",{className:"markdown-toolbar-container"},!Ut&&ot.map(function(Xt,Wt){return C.a.createElement("li",{key:Wt},Xt.actionName?C.a.createElement(z,Object(se.a)({},Xt,{onActionCallback:Ye})):C.a.createElement("span",{className:"v-line"}))}),lt?C.a.createElement("li",null,C.a.createElement(z,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ye},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,pt&&C.a.createElement("li",null,C.a.createElement(z,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(pt),onActionCallback:Ye},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",{className:"btn-full-screen"},C.a.createElement(z,{icon:"".concat(je?"icon-shrink":"icon-enlarge"),title:je?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ye})))},K=l("M8RZ"),de=l("+L6B"),J=l("2/Rp"),be=l("y8nQ"),I=l("Vl3Y"),y=l("5NDa"),pe=l("5rEg"),Ue={labelCol:{span:4},wrapperCol:{span:20}},De=function(ve){var Oe=ve.callback,lt=ve.onCancel;function Ye(je){Oe(je)}return C.a.createElement(I.a,Object(se.a)({},Ue,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ye}),C.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(pe.a,null)),C.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(pe.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(J.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},nt=l("7ahc"),Ne=l("k1fw"),Pe=l("HmJG"),ae=l("BjJ7"),Z=I.a.useForm,ye={width:280,marginRight:10},W={labelCol:{span:5},wrapperCol:{span:19}},T=function(ve){var Oe=ve.callback,lt=ve.onCancel,Ye=Z(),je=Object(Y.a)(Ye,1),pt=je[0],Ut=Object(_.useRef)();function ut(Xt){Oe(Object(Ne.a)(Object(Ne.a)({},Xt),{},{name:Ut.current}))}function $t(Xt,Wt){pt.setFieldsValue({src:"/api/attachments/".concat(Xt.id,"?type=").concat(Xt.content_type),type:Wt.type})}function ot(Xt){var Wt=Xt.target.files[0];Ut.current=Wt.name,We(Wt,$t)}return C.a.createElement(I.a,Object(se.a)({form:pt},W,{className:"upload-image-panel",onFinish:ut}),C.a.createElement(I.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},C.a.createElement(pe.a,{style:ye})),C.a.createElement(Ce,{onFileChange:ot}))),C.a.createElement(I.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},C.a.createElement(pe.a,{style:{width:264}})),C.a.createElement(I.a.Item,{style:{textAlign:"right"}},C.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(J.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))};function Ce(ve){var Oe=ve.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:Oe}))}function We(ve,Oe){if(!ve)throw new String("\u6CA1\u6709\u6587\u4EF6");var lt=new FormData;lt.append("editormd-image-file",ve),lt.append("file_param_name","editormd-image-file"),lt.append("byxhr","true");var Ye=new window.XMLHttpRequest;Ye.withCredentials=!0,Ye.addEventListener("load",function(je){Oe(JSON.parse(je.target.responseText),ve)},!1),Ye.addEventListener("error",function(je){console.error(je)},!1),Ye.open("POST","".concat(ae.a,"/api/attachments.json")),Ye.send(lt)}var Ze=l("giR+"),Be=l("fyUT"),H=l("7Kak"),G=l("9yH6"),he=G.a.Group,ke={margin:"0 8px"},Me=function(ve){var Oe=ve.callback,lt=ve.onCancel;function Ye(je){Oe(je)}return C.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ye},C.a.createElement("div",{className:"flex-container"},C.a.createElement("span",{style:ke},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:ke},"\u884C\u6570"),C.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(Be.a,null)),C.a.createElement("span",{style:ke},"\u5217\u6570"),C.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(Be.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12}},C.a.createElement("span",{style:ke},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(I.a.Item,{name:"align"},C.a.createElement(he,null,C.a.createElement(G.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(G.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(G.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(G.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(J.a,{type:"ghost",onClick:lt},"\u53D6\u6D88")))},Ge=l("ErOA"),et=l("7Cbv"),Ke="link",yt="upload-image",ct="code-block",gt="add-table",st="------------",Ot={default:st,left:":".concat(st),center:":".concat(st,":"),right:"".concat(st,":")},xt=l("9VGf"),wt,Le;function ft(){}var At=0,He=1e4,Xe="\u2581",$=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function ne(ve){return/^\d+$/.test(ve)?"".concat(ve,"px"):ve}var ie=navigator.platform.toUpperCase().indexOf("MAC")>=0,P=ie?"Cmd":"Ctrl",D=["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"],X=(wt={},Object(B.a)(wt,P+"-B","bold"),Object(B.a)(wt,P+"-I","italic"),wt),V=(Le={},Object(B.a)(Le,Ke,"\u6DFB\u52A0\u94FE\u63A5"),Object(B.a)(Le,ct,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(B.a)(Le,yt,"\u6DFB\u52A0\u6587\u4EF6"),Object(B.a)(Le,gt,"\u6DFB\u52A0\u8868\u683C"),Le),xe=ue.a=function(ve){var Oe=ve.defaultValue,lt=Oe===void 0?"":Oe,Ye=ve.onChange,je=ve.width,pt=je===void 0?"100%":je,Ut=ve.height,ut=Ut===void 0?400:Ut,$t=ve.miniToolbar,ot=$t===void 0?!1:$t,Xt=ve.isFocus,Wt=Xt===void 0?!1:Xt,St=ve.watch,Yt=ve.insertTemp,zt=ve.mode,Je=zt===void 0?"markdown":zt,ze=ve.id,Ae=ze===void 0?"markdown-editor-id":ze,$e=ve.showResizeBar,Dt=$e===void 0?!1:$e,Nt=ve.noStorage,Jt=Nt===void 0?!1:Nt,Ft=ve.showNullButton,_t=Ft===void 0?!1:Ft,an=ve.hidetoolBar,jt=an===void 0?!1:an,cn=ve.fullScreen,Kt=cn===void 0?!1:cn,dn=ve.onBlur,Nn=ve.onCMBeforeChange,sn=ve.onFullScreen,Fe=ve.className,it=Fe===void 0?"":Fe,Gt=ve.disablePaste,qt=Gt===void 0?!1:Gt,nn=ve.placeholder,ln=nn===void 0?"":nn,u=ve.values,o=u===void 0?"":u,a=Object(_.useState)(null),c=Object(Y.a)(a,2),p=c[0],h=c[1],ce=Object(_.useState)(lt),tt=Object(Y.a)(ce,2),ht=tt[0],It=tt[1],Re=Object(_.useState)(St),ge=Object(Y.a)(Re,2),qe=ge[0],Lt=ge[1],Pt=Object(_.useState)(Kt),Tt=Object(Y.a)(Pt,2),Mt=Tt[0],mn=Tt[1],jn=Object(_.useState)(""),kn=Object(Y.a)(jn,2),_n=kn[0],Ln=kn[1],Un=Object(_.useState)(0),ti=Object(Y.a)(Un,2),wi=ti[0],Xn=ti[1],$n=Object(_.useState)(ut),$i=Object(Y.a)($n,2),_i=$i[0],An=$i[1],Fi=Object(_.useState)(!1),ar=Object(Y.a)(Fi,2),fr=ar[0],zn=ar[1],En=Object(_.useRef)(Object(et.a)()),li=Object(_.useRef)(!1),gn=Object(_.useRef)(),Hn=Object(_.useRef)(),wn=Object(_.useRef)(),di=Object(_.useRef)(),Yn=Object(_.useRef)(),Ci=function(){var Vt=Object(fe.a)(A.a.mark(function rn(){var Zt,hn;return A.a.wrap(function(Rn){for(;;)switch(Rn.prev=Rn.next){case 0:return Rn.next=2,Object(Ge.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:En.current}});case 2:hn=Rn.sent,hn!=null&&(Zt=hn.attachments)!==null&&Zt!==void 0&&Zt.length&&(console.log("cm:",p,Hn),hn.attachments.map(function(yn){yn.content_type.indexOf("image")>-1?p.replaceSelection("![,](/api/attachments/".concat(yn.id,"?type=").concat(yn.content_type,")")):yn.content_type.indexOf("video")>-1?p.replaceSelection('<video width="100%" controls src="'.concat(S.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):yn.content_type.indexOf("pdf")>-1?p.replaceSelection('<a href="'.concat(S.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(yn.content_type,'&disposition=inline" target="_blank">').concat(yn.name,"</a>")):p.replaceSelection("[".concat(yn.name,"](").concat(S.a.API_SERVER,"/api/attachments/").concat(yn.id,"?type=").concat(yn.content_type,")"))}));case 4:case"end":return Rn.stop()}},rn)}));return function(){return Vt.apply(this,arguments)}}();Object(_.useEffect)(function(){It(o),p==null||p.setValue(o)},[o]),Object(_.useEffect)(function(){sn==null||sn(Mt)},[Mt]),Object(_.useEffect)(function(){if(Hn.current){var Vt=x.a.fromTextArea(Hn.current,{mode:Je,lineNumbers:!ot,lineWrapping:!0,value:lt,autoCloseTags:!0,autoCloseBrackets:!0});Wt&&Vt.focus();function rn(Zt,hn){if(qt){hn.preventDefault();return}var bn=hn.clipboardData;if(bn){var Rn=bn.types.toString(),yn=bn.items;if(Rn==="Files"||bn.types.indexOf("Files")>-1){if(hn.preventDefault(),Je=="stex")return;try{var Kn,Si=yn[1];((Kn=yn[0])===null||Kn===void 0?void 0:Kn.kind)==="file"&&(Si=yn[0]);var fn=Si.getAsFile(),rr=fn.name.split(".").pop();We(fn,function(vn){if(vn.id){var Jn,Wi,zi;(fn==null||((Jn=fn.type)===null||Jn===void 0)?void 0:Jn.indexOf("image"))>-1?Vt.replaceSelection("![,](/api/attachments/".concat(vn.id,"?type=").concat(vn.content_type,")")):(fn==null||((Wi=fn.type)===null||Wi===void 0)?void 0:Wi.indexOf("video"))>-1?Vt.replaceSelection('<video width="100%" controls src="'.concat(S.a.API_SERVER,"/api/attachments/").concat(vn.id,'"></video>')):(fn==null||((zi=fn.type)===null||zi===void 0)?void 0:zi.indexOf("pdf"))>-1?Vt.replaceSelection('<a href="'.concat(S.a.API_SERVER,"/api/attachments/").concat(vn.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):D.includes(rr)?Vt.replaceSelection('<a href="'.concat(S.a.API_SERVER,"/api/attachments/").concat(vn.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):Vt.replaceSelection("[".concat(fn.name,"](").concat(S.a.API_SERVER,"/api/attachments/").concat(vn.id,"?type=").concat(vn.content_type,")"))}else(vn==null?void 0:vn.status)===401&&(document.location.href="/user/login")})}catch(vn){Ee.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Vt.on("paste",rn),Vt.on("dragleave",function(Zt,hn){wn.current.classList.remove("mouse-hover-md")}),Vt.on("dragover",function(Zt,hn){wn.current.classList.add("mouse-hover-md")}),Vt.on("drop",function(Zt,hn){wn.current.classList.add("mouse-hover-md");var bn;if(bn=hn.dataTransfer.files,bn.length>0){hn.preventDefault(),hn.stopPropagation();for(var Rn=function(Si){var fn=bn[Si],rr=fn.name.split(".").pop();We(fn,function(vn){if(vn.id){var Jn,Wi,zi;(fn==null||((Jn=fn.type)===null||Jn===void 0)?void 0:Jn.indexOf("image"))>-1?Vt.replaceSelection("![,](/api/attachments/".concat(vn.id,"?type=").concat(vn.content_type,")")):(fn==null||((Wi=fn.type)===null||Wi===void 0)?void 0:Wi.indexOf("video"))>-1?Vt.replaceSelection('<video width="100%" controls src="'.concat(S.a.API_SERVER,"/api/attachments/").concat(vn.id,'"></video>')):(fn==null||((zi=fn.type)===null||zi===void 0)?void 0:zi.indexOf("pdf"))>-1?Vt.replaceSelection('<a href="'.concat(S.a.API_SERVER,"/api/attachments/").concat(vn.id,"?type=").concat(fn.type,'&disposition=inline" target="_blank">').concat(fn.name,"</a>")):D.includes(rr)?Vt.replaceSelection('<a href="'.concat(S.a.API_SERVER,"/api/attachments/").concat(vn.id,'?type=office&disposition=inline" target="_blank">').concat(fn.name,"</a>")):Vt.replaceSelection("[".concat(fn.name,"](").concat(S.a.API_SERVER,"/api/attachments/").concat(vn.id,"?type=").concat(vn.content_type,")"))}else(vn==null?void 0:vn.status)===401&&(document.location.href="/user/login")})},yn=0;yn<bn.length;yn++)Rn(yn)}}),h(Vt),function(){Vt.off("paste",rn)}}},[]);var pr=Object(_.useCallback)(function(){if(wn.current)try{}catch(Vt){console.log(Vt,"---- to set md editor body height")}},[_i,wn,Mt]);Object(_.useEffect)(function(){function Vt(){var Zt=new w.default(function(hn){var bn=Object(me.a)(hn),Rn;try{for(bn.s();!(Rn=bn.n()).done;){var yn=Rn.value;(yn.target.offsetHeight>0||yn.target.offsetWidth>0)&&(pr(),p.setSize("100%","100%"),p.refresh())}}catch(Kn){bn.e(Kn)}finally{bn.f()}});return Zt.observe(Hn.current.parentElement),Zt}if(p){var rn=Vt();return function(){rn.unobserve(Hn.current.parentElement)}}},[p,pr]),Object(_.useEffect)(function(){if(p){for(var Vt=[],rn=function(){var yn=hn[Zt];bn=Object(Y.a)(yn,2);var Kn=bn[0],Si=bn[1],fn=Object(B.a)({},Kn,function(){nr(Si)});Vt.push(fn),p.addKeyMap(fn)},Zt=0,hn=Object.entries(X);Zt<hn.length;Zt++){var bn;rn()}return gn.current=setInterval(function(){li.current&&Ci()},4e3),function(){clearInterval(gn.current);var Rn=Object(me.a)(Vt),yn;try{for(Rn.s();!(yn=Rn.n()).done;){var Kn=yn.value;p.removeKeyMap(Kn)}}catch(Si){Rn.e(Si)}finally{Rn.f()}}}},[p]),Object(_.useEffect)(function(){Kt!==Mt&&mn(Kt)},[Kt]),Object(xt.a)(function(){if(!Jt&&wi>0){var Vt=new Date().getTime(),rn=window.sessionStorage.getItem(Ae);Vt>=wi+He&&(!rn||rn!==ht)&&(window.sessionStorage.setItem(Ae,ht),zn(!0))}},He),Object(_.useEffect)(function(){Lt(St)},[p,St]),Object(_.useEffect)(function(){p&&(Wt&&p.focus())},[p,Wt]),Object(_.useEffect)(function(){if(qe&&p){var Vt=p.getScrollerElement();function rn(Zt){var hn=Zt.target;if(Yn.current){var bn=hn.scrollTop/hn.scrollHeight;Yn.current.scrollTop=Yn.current.scrollHeight*bn}}return Vt.addEventListener("scroll",rn),function(){Vt.removeEventListener("scroll",rn)}}},[p,qe]),Object(_.useEffect)(function(){if(p&&Nn){function Vt(rn,Zt){Nn(rn,Zt)}return p.on("beforeChange",Vt),function(){p.off("beforeChange",Vt)}}},[p,Nn]),Object(_.useEffect)(function(){if(p&&dn){function Vt(){dn(p.getValue())}return p.on("blur",Vt),function(){p.off("blur",Vt)}}},[p,dn]),Object(_.useEffect)(function(){if(p){function Vt(rn){var Zt=rn.getValue();It(Zt),Xn(new Date().getTime()),rn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ye&&Ye(Zt)}return p.on("change",Vt),function(){p.off("change",Vt)}}},[p,Ye]),Object(_.useEffect)(function(){p&&(lt==null?(p.setValue(""),It("")):lt!==p.getValue()&&(p.setValue(lt),It(lt),p.setCursor(p.lineCount(),0)))},[p,lt]);var nr=Object(_.useCallback)(function(Vt){var rn=p.getCursor(),Zt=p.getSelection(),hn=Zt.split(`
`);switch(Vt){case"bold":return p.replaceSelection("**"+Zt+"**"),Zt===""&&p.setCursor(rn.line,rn.ch+2),p.focus();case"italic":return p.replaceSelection("*"+Zt+"*"),Zt===""&&p.setCursor(rn.line,rn.ch+1),p.focus();case"code":return p.replaceSelection("`"+Zt+"`"),Zt===""&&p.setCursor(rn.line,rn.ch+1),p.focus();case"inline-latex":return p.replaceSelection("`$$"+Zt+"$$`"),Zt===""&&p.setCursor(rn.line,rn.ch+3),p.focus();case"latex":return p.replaceSelection("```latex\n"+Zt+"\n```"),p.setCursor(rn.line+1,Zt.length+1),p.focus();case"line-break":return p.replaceSelection(`<br/>
`),p.focus();case"list-ul":return Zt===""?p.replaceSelection("- "+Zt):p.replaceSelection(hn.map(function(bn){return bn===""?"":"- ".concat(bn)}).join(`
`)),p.focus();case"list-ol":return Zt===""?p.replaceSelection("1. "+Zt):p.replaceSelection(hn.map(function(bn,Rn){return bn===""?"":"".concat(Rn+1,". ").concat(bn)}).join(`
`)),p.focus();case"add-null-ch":return Zt===""&&p.setCursor(rn.line,rn.ch+1),p.replaceSelection(Xe),p.focus();case"inster-template-1":return Zt===""&&p.setCursor(rn.line,rn.ch),p.replaceSelection($),p.focus();case"eraser":return p.setValue(""),p.focus();case"trigger-watch":return Lt(!qe),p.focus();case"trigger-full-screen":return mn(!Mt),p.focus();case Ke:Ln(Ke);return;case ct:Ln(ct);return;case yt:Ln(yt);return;case gt:Ln(gt);return;default:throw new Error}},[p,qe,Mt]),ir=Object(_.useCallback)(function(Vt){Ln("");switch(_n){case Ke:var rn=Vt.title,Zt=Vt.link;return p.replaceSelection("[".concat(rn,"](").concat(Zt,")")),p.focus();case ct:var hn=Vt.language,bn=Vt.content;return p.replaceSelection(["```"+hn,bn,"```"].join(`
`)),p.focus();case yt:var Rn=Vt.src,yn=Vt.alt,Kn=Vt.name;return Rn.indexOf("type=image")>-1?p.replaceSelection("![ ".concat(yn||""," ]( ").concat(Rn,' "').concat(yn||"",'" )')):Rn.indexOf("type=application/pdf")>-1?p.replaceSelection('<a href="'.concat(Rn,'&disposition=inline" target="_blank">').concat(Kn,"</a>")):p.replaceSelection('<a href="'.concat(Rn,'" target="_blank">').concat(Kn,"</a>")),p.focus();case gt:for(var Si=Vt.row,fn=Vt.col,rr=Vt.align,vn=`
`,Jn=0;Jn<Si;Jn++){for(var Wi=[],zi=[],Br=0;Br<fn;Br++)Jn===1&&zi.push(Ot[rr]),Wi.push(" ");Jn===1&&(vn+="| ".concat(zi.join(" | "),` |
`)),vn+="| ".concat(Wi.join(fn===1?"":" | "),` |
`)}return p.replaceSelection(vn+`
`),p.focus();default:throw new Error}},[p,_n]),Sr=Object(_.useMemo)(function(){switch(_n){case Ke:return C.a.createElement(De,{callback:ir,onCancel:Cn});case ct:return C.a.createElement(nt.b,{callback:ir,onCancel:Cn});case yt:return C.a.createElement(T,{callback:ir,onCancel:Cn});case gt:return C.a.createElement(Me,{callback:ir,onCancel:Cn});default:return null}},[_n]);function Cn(){Ln("")}Object(_.useEffect)(function(){if(di.current){var Vt=di.current,rn=!1,Zt=0;function hn(yn){rn=!0,Zt=yn.pageY}function bn(){rn=!1}function Rn(yn){if(rn){var Kn=yn.pageY-Zt;Kn<0&&(Kn=0),Kn>300&&(Kn=300);var Si=ut+Kn+"px";An(Si)}}return Vt.addEventListener("mousedown",hn),document.addEventListener("mousemove",Rn),document.addEventListener("mouseup",bn),function(){Vt.removeEventListener("mousedown",hn),document.removeEventListener("mousemove",Rn),document.removeEventListener("mouseup",bn)}}},[p,di]),Object(_.useEffect)(function(){An(ut)},[ut]);var Ji=ne(pt),Gi=ne(_i),sr={width:Ji,height:Gi},Zi=Object(_.useMemo)(function(){if(wi){var Vt=new Date(wi),rn=Vt.getHours(),Zt=Vt.getMinutes(),hn=Vt.getSeconds();return rn=rn<10?"0"+rn:rn,Zt=Zt<10?"0"+Zt:Zt,hn=hn<10?"0"+hn:hn,"".concat(rn,":").concat(Zt,":").concat(hn)}return 0},[wi]);function lr(){window.sessionStorage.removeItem(Ae),zn(!1),Xn(0)}function ur(){zn(!1),Xn(0),p.setValue(window.sessionStorage.getItem(Ae))}function no(Vt,rn){var Zt=p.getValue();Zt=Zt.replace(Vt,rn),It(Zt),p==null||p.setValue(Zt)}return C.a.createElement(_.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:wn},C.a.createElement("div",{className:"markdown-editor-container ".concat(it," ").concat(qe?"on-preview":""," ").concat(ot?"mini":""," ").concat(Mt?"full-screen":""),style:sr},C.a.createElement(U,{insertTemp:Yt,watch:qe,fullScreen:Mt,showNullButton:_t,onActionCallback:nr,hidetoolBar:jt,uuid:En.current,setOpenPhones:function(){li.current=!0}}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:Hn,placeholder:ln})),qe?C.a.createElement("div",{ref:Yn,className:"preview-container"},Je==="stex"&&C.a.createElement(b,{value:ht}),Je!=="stex"&&C.a.createElement(F.a,{edit:!0,value:ht,replaces:no})):null))),Dt?C.a.createElement("a",{ref:di,className:"editor-resize"}):null,C.a.createElement(K.a,null,V[_n]?C.a.createElement(_e.a,{centered:!0,title:V[_n],visible:!0,onCancel:Cn,footer:null},Sr):null))}},PGNT:function(rt,ue,l){rt.exports={wrap:"wrap___orWmH",modal:"modal___142IN",titleWrap:"titleWrap___2UWGN",required:"required___lXOtq",title:"title___2wqMf",colorGray:"colorGray___3FkLm",choiceWrap:"choiceWrap___3pbic",answer:"answer___30LSv",activeAnswer:"activeAnswer___3ayAN",deleteIcon:"deleteIcon___2HHly",addIcon:"addIcon___29vcx",editorWrap:"editorWrap___ANVP6",htmlWrap:"htmlWrap___38sLf",radio:"radio___15wok",color333:"color333___sNPjh",color999:"color999___1ofkl",fold:"fold___6rnoE",head:"head___2muph"}},PsQE:function(rt,ue,l){rt.exports={flex_box_center:"flex_box_center___2PkN_",flex_space_between:"flex_space_between___36cDA",flex_box_vertical_center:"flex_box_vertical_center___2c88u",flex_box_center_end:"flex_box_center_end___14cXO",flex_box_column:"flex_box_column___3nalt",wrap:"wrap___3xZrs",left:"left___19hOK",title:"title___3Ti2k",total:"total___3MRC5",list:"list___3pdfL",name:"name___2IcTs",b:"b___2W0Sn",r:"r___2Tpj8",l:"l___1rMKQ",tag:"tag___jj2X5",right:"right___16831",examName:"examName___2TmgX",t:"t___1CJZd",num:"num___1qX6C",topWarp:"topWarp___3WuSr",head:"head___3z9Hq",so:"so___m2B6Z",btn:"btn___20VL7",content:"content___2tTuo",titleWrap:"titleWrap___1cYdQ",single:"single___1BKtz",analysis:"analysis___1qm4Y",text:"text___1JQUf",btnsElse:"btnsElse___2IzAs",btnsWrap:"btnsWrap___3ib37",btns:"btns___2DbBT",modalColumn:"modalColumn___1zs36",modalRow:"modalRow___14b2N",sup:"sup___1CIjI",popover:"popover___Mmcvb"}},QDVR:function(rt,ue,l){"use strict";l.d(ue,"e",function(){return _e}),l.d(ue,"d",function(){return me}),l.d(ue,"c",function(){return Y}),l.d(ue,"b",function(){return B}),l.d(ue,"a",function(){return A});var q=function(){var _=function(C,O){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,w){x.__proto__=w}||function(x,w){for(var M in w)w.hasOwnProperty(M)&&(x[M]=w[M])},_(C,O)};return function(C,O){_(C,O);function x(){this.constructor=C}C.prototype=O===null?Object.create(O):(x.prototype=O.prototype,new x)}}();function _e(_){var C=[];return _.forEach(function(O){return C.push(O)}),C}function me(_){var C=[];return _.forEach(function(O,x){return C.push(x)}),C}var we=function(){function _(){this._value="",this._pos=0}return _.prototype.reset=function(C){return this._value=C,this._pos=0,this},_.prototype.next=function(){return this._pos+=1,this},_.prototype.hasNext=function(){return this._pos<this._value.length-1},_.prototype.cmp=function(C){var O=C.charCodeAt(0),x=this._value.charCodeAt(this._pos);return O-x},_.prototype.value=function(){return this._value[this._pos]},_}(),Ee=function(){function _(C){C===void 0&&(C=!0),this._splitOnBackslash=C}return _.prototype.reset=function(C){return this._value=C.replace(/\\$|\/$/,""),this._from=0,this._to=0,this.next()},_.prototype.hasNext=function(){return this._to<this._value.length},_.prototype.next=function(){this._from=this._to;for(var C=!0;this._to<this._value.length;this._to++){var O=this._value.charCodeAt(this._to);if(O===47||this._splitOnBackslash&&O===92)if(C)this._from++;else break;else C=!1}return this},_.prototype.cmp=function(C){for(var O=0,x=C.length,w=this._from;O<x&&w<this._to;){var M=C.charCodeAt(O)-this._value.charCodeAt(w);if(M!==0)return M;O+=1,w+=1}return x===this._to-this._from?0:O<x?-1:1},_.prototype.value=function(){return this._value.substring(this._from,this._to)},_}(),fe=function(){function _(){}return _}(),Y=function(){function _(C){this._iter=C}return _.forPaths=function(){return new _(new Ee)},_.forStrings=function(){return new _(new we)},_.prototype.clear=function(){this._root=void 0},_.prototype.set=function(C,O){var x=this._iter.reset(C),w;for(this._root||(this._root=new fe,this._root.segment=x.value()),w=this._root;;){var M=x.cmp(w.segment);if(M>0)w.left||(w.left=new fe,w.left.segment=x.value()),w=w.left;else if(M<0)w.right||(w.right=new fe,w.right.segment=x.value()),w=w.right;else if(x.hasNext())x.next(),w.mid||(w.mid=new fe,w.mid.segment=x.value()),w=w.mid;else break}var m=w.value;return w.value=O,w.key=C,m},_.prototype.get=function(C){for(var O=this._iter.reset(C),x=this._root;x;){var w=O.cmp(x.segment);if(w>0)x=x.left;else if(w<0)x=x.right;else if(O.hasNext())O.next(),x=x.mid;else break}return x?x.value:void 0},_.prototype.findSubstr=function(C){for(var O=this._iter.reset(C),x=this._root,w=void 0;x;){var M=O.cmp(x.segment);if(M>0)x=x.left;else if(M<0)x=x.right;else if(O.hasNext())O.next(),w=x.value||w,x=x.mid;else break}return x&&x.value||w},_.prototype.forEach=function(C){this._forEach(this._root,C)},_.prototype._forEach=function(C,O){C&&(this._forEach(C.left,O),C.value&&O(C.value,C.key),this._forEach(C.mid,O),this._forEach(C.right,O))},_}(),B=function(){function _(){this.map=new Map,this.ignoreCase=!1}return _.prototype.set=function(C,O){this.map.set(this.toKey(C),O)},_.prototype.get=function(C){return this.map.get(this.toKey(C))},_.prototype.toKey=function(C){var O=C.toString();return this.ignoreCase&&(O=O.toLowerCase()),O},_}(),N=function(){function _(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}return _.prototype.clear=function(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0},Object.defineProperty(_.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),_.prototype.get=function(C,O){O===void 0&&(O=0);var x=this._map.get(C);return x?(O!==0&&this.touch(x,O),x.value):void 0},_.prototype.set=function(C,O,x){x===void 0&&(x=0);var w=this._map.get(C);if(w)w.value=O,x!==0&&this.touch(w,x);else{w={key:C,value:O,next:void 0,previous:void 0};switch(x){case 0:this.addItemLast(w);break;case 1:this.addItemFirst(w);break;case 2:this.addItemLast(w);break;default:this.addItemLast(w);break}this._map.set(C,w),this._size++}},_.prototype.delete=function(C){return!!this.remove(C)},_.prototype.remove=function(C){var O=this._map.get(C);return O?(this._map.delete(C),this.removeItem(O),this._size--,O.value):void 0},_.prototype.forEach=function(C,O){for(var x=this._head;x;)O?C.bind(O)(x.value,x.key,this):C(x.value,x.key,this),x=x.next},_.prototype.trimOld=function(C){if(C>=this.size)return;if(C===0){this.clear();return}for(var O=this._head,x=this.size;O&&x>C;)this._map.delete(O.key),O=O.next,x--;this._head=O,this._size=x,O&&(O.previous=void 0)},_.prototype.addItemFirst=function(C){if(!this._head&&!this._tail)this._tail=C;else if(this._head)C.next=this._head,this._head.previous=C;else throw new Error("Invalid list");this._head=C},_.prototype.addItemLast=function(C){if(!this._head&&!this._tail)this._head=C;else if(this._tail)C.previous=this._tail,this._tail.next=C;else throw new Error("Invalid list");this._tail=C},_.prototype.removeItem=function(C){if(C===this._head&&C===this._tail)this._head=void 0,this._tail=void 0;else if(C===this._head){if(!C.next)throw new Error("Invalid list");C.next.previous=void 0,this._head=C.next}else if(C===this._tail){if(!C.previous)throw new Error("Invalid list");C.previous.next=void 0,this._tail=C.previous}else{var O=C.next,x=C.previous;if(!O||!x)throw new Error("Invalid list");O.previous=x,x.next=O}C.next=void 0,C.previous=void 0},_.prototype.touch=function(C,O){if(!this._head||!this._tail)throw new Error("Invalid list");if(O!==1&&O!==2)return;if(O===1){if(C===this._head)return;var x=C.next,w=C.previous;C===this._tail?(w.next=void 0,this._tail=w):(x.previous=w,w.next=x),C.previous=void 0,C.next=this._head,this._head.previous=C,this._head=C}else if(O===2){if(C===this._tail)return;var x=C.next,w=C.previous;C===this._head?(x.previous=void 0,this._head=x):(x.previous=w,w.next=x),C.next=void 0,C.previous=this._tail,this._tail.next=C,this._tail=C}},_.prototype.toJSON=function(){var C=[];return this.forEach(function(O,x){C.push([x,O])}),C},_}(),A=function(_){q(C,_);function C(O,x){x===void 0&&(x=1);var w=_.call(this)||this;return w._limit=O,w._ratio=Math.min(Math.max(0,x),1),w}return C.prototype.get=function(O){return _.prototype.get.call(this,O,2)},C.prototype.peek=function(O){return _.prototype.get.call(this,O,0)},C.prototype.set=function(O,x){_.prototype.set.call(this,O,x,2),this.checkTrim()},C.prototype.checkTrim=function(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))},C}(N)},QSKd:function(rt,ue,l){rt.exports=l.p+"static/wenhao.50b63ac4.svg"},"RZ/O":function(rt,ue,l){rt.exports=l.p+"static/bi.9c9b0364.svg"},SJMd:function(rt,ue){/**
* @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 l,q,_e,me=!1,we,Ee;window.PR_SHOULD_USE_CONTINUATION=!0;var fe,Y;(function(){var B=window,N=["break,continue,do,else,for,if,return,while"],A=[N,"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"],_=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],C=[_,"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"],O=[_,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],x=[_,"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"],w="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",M=[_,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],m="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",v=[N,"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"],f=[N,"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"],L=[N,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],ee=[C,x,O,M,m,v,f,L],oe=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,F="str",b="kwd",se="com",j="typ",re="lit",k="pun",S="pln",Q="tag",z="dec",U="src",K="atn",de="atv",J="nocode",be="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(G){for(var he=0,ke=!1,Me=!1,Ge=0,et=G.length;Ge<et;++Ge){var Ke=G[Ge];if(Ke.ignoreCase)Me=!0;else if(/[a-z]/i.test(Ke.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ke=!0,Me=!1;break}}var yt={b:8,t:9,n:10,v:11,f:12,r:13};function ct(wt){var Le=wt.charCodeAt(0);if(Le!==92)return Le;var ft=wt.charAt(1);return Le=yt[ft],Le||("0"<=ft&&ft<="7"?parseInt(wt.substring(1),8):ft==="u"||ft==="x"?parseInt(wt.substring(2),16):wt.charCodeAt(1))}function gt(wt){if(wt<32)return(wt<16?"\\x0":"\\x")+wt.toString(16);var Le=String.fromCharCode(wt);return Le==="\\"||Le==="-"||Le==="]"||Le==="^"?"\\"+Le:Le}function st(wt){var Le=wt.substring(1,wt.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")),ft=[],At=Le[0]==="^",He=["["];At&&He.push("^");for(var Xe=At?1:0,$=Le.length;Xe<$;++Xe){var ne=Le[Xe];if(/\\[bdsw]/i.test(ne))He.push(ne);else{var ie=ct(ne),P;Xe+2<$&&Le[Xe+1]==="-"?(P=ct(Le[Xe+2]),Xe+=2):P=ie,ft.push([ie,P]),P<65||ie>122||(P<65||ie>90||ft.push([Math.max(65,ie)|32,Math.min(P,90)|32]),P<97||ie>122||ft.push([Math.max(97,ie)&~32,Math.min(P,122)&~32]))}}ft.sort(function(xe,ve){return xe[0]-ve[0]||ve[1]-xe[1]});for(var D=[],X=[],Xe=0;Xe<ft.length;++Xe){var V=ft[Xe];V[0]<=X[1]+1?X[1]=Math.max(X[1],V[1]):D.push(X=V)}for(var Xe=0;Xe<D.length;++Xe){var V=D[Xe];He.push(gt(V[0])),V[1]>V[0]&&(V[1]+1>V[0]&&He.push("-"),He.push(gt(V[1])))}return He.push("]"),He.join("")}function Ot(wt){for(var Le=wt.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")),ft=Le.length,At=[],He=0,Xe=0;He<ft;++He){var $=Le[He];if($==="(")++Xe;else if($.charAt(0)==="\\"){var ne=+$.substring(1);ne&&(ne<=Xe?At[ne]=-1:Le[He]=gt(ne))}}for(var He=1;He<At.length;++He)At[He]===-1&&(At[He]=++he);for(var He=0,Xe=0;He<ft;++He){var $=Le[He];if($==="(")++Xe,At[Xe]||(Le[He]="(?:");else if($.charAt(0)==="\\"){var ne=+$.substring(1);ne&&ne<=Xe&&(Le[He]="\\"+At[ne])}}for(var He=0;He<ft;++He)Le[He]==="^"&&Le[He+1]!=="^"&&(Le[He]="");if(wt.ignoreCase&&ke)for(var He=0;He<ft;++He){var $=Le[He],ie=$.charAt(0);$.length>=2&&ie==="["?Le[He]=st($):ie!=="\\"&&(Le[He]=$.replace(/[a-zA-Z]/g,function(X){var V=X.charCodeAt(0);return"["+String.fromCharCode(V&~32,V|32)+"]"}))}return Le.join("")}for(var xt=[],Ge=0,et=G.length;Ge<et;++Ge){var Ke=G[Ge];if(Ke.global||Ke.multiline)throw new Error(""+Ke);xt.push("(?:"+Ot(Ke)+")")}return new RegExp(xt.join("|"),Me?"gi":"g")}function y(G,he){var ke=/(?:^|\s)nocode(?:\s|$)/,Me=[],Ge=0,et=[],Ke=0;function yt(ct){var gt=ct.nodeType;if(gt==1){if(ke.test(ct.className))return;for(var st=ct.firstChild;st;st=st.nextSibling)yt(st);var Ot=ct.nodeName.toLowerCase();(Ot==="br"||Ot==="li")&&(Me[Ke]=`
`,et[Ke<<1]=Ge++,et[Ke++<<1|1]=ct)}else if(gt==3||gt==4){var xt=ct.nodeValue;xt.length&&(he?xt=xt.replace(/\r\n?/g,`
`):xt=xt.replace(/[ \t\r\n]+/g," "),Me[Ke]=xt,et[Ke<<1]=Ge,Ge+=xt.length,et[Ke++<<1|1]=ct)}}return yt(G),{sourceCode:Me.join("").replace(/\n$/,""),spans:et}}function pe(G,he,ke,Me,Ge){if(!ke)return;var et={sourceNode:G,pre:1,langExtension:null,numberLines:null,sourceCode:ke,spans:null,basePos:he,decorations:null};Me(et),Ge.push.apply(Ge,et.decorations)}var Ue=/\S/;function De(G){for(var he=void 0,ke=G.firstChild;ke;ke=ke.nextSibling){var Me=ke.nodeType;he=Me===1?he?G:ke:Me===3&&Ue.test(ke.nodeValue)?G:he}return he===G?void 0:he}function nt(G,he){var ke={},Me;(function(){for(var Ke=G.concat(he),yt=[],ct={},gt=0,st=Ke.length;gt<st;++gt){var Ot=Ke[gt],xt=Ot[3];if(xt)for(var wt=xt.length;--wt>=0;)ke[xt.charAt(wt)]=Ot;var Le=Ot[1],ft=""+Le;ct.hasOwnProperty(ft)||(yt.push(Le),ct[ft]=null)}yt.push(/[\0-\uffff]/),Me=I(yt)})();var Ge=he.length,et=function(Ke){for(var yt=Ke.sourceCode,ct=Ke.basePos,gt=Ke.sourceNode,st=[ct,S],Ot=0,xt=yt.match(Me)||[],wt={},Le=0,ft=xt.length;Le<ft;++Le){var At=xt[Le],He=wt[At],Xe=void 0,$;if(typeof He=="string")$=!1;else{var ne=ke[At.charAt(0)];if(ne)Xe=At.match(ne[1]),He=ne[0];else{for(var ie=0;ie<Ge;++ie)if(ne=he[ie],Xe=At.match(ne[1]),Xe){He=ne[0];break}Xe||(He=S)}$=He.length>=5&&He.substring(0,5)==="lang-",$&&!(Xe&&typeof Xe[1]=="string")&&($=!1,He=U),$||(wt[At]=He)}var P=Ot;if(Ot+=At.length,!$)st.push(ct+P,He);else{var D=Xe[1],X=At.indexOf(D),V=X+D.length;Xe[2]&&(V=At.length-Xe[2].length,X=V-D.length);var xe=He.substring(5);pe(gt,ct+P,At.substring(0,X),et,st),pe(gt,ct+P+X,D,T(xe,D),st),pe(gt,ct+P+V,At.substring(V),et,st)}}Ke.decorations=st};return et}function Ne(G){var he=[],ke=[];G.tripleQuotedStrings?he.push([F,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):G.multiLineStrings?he.push([F,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):he.push([F,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),G.verbatimStrings&&ke.push([F,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Me=G.hashComments;Me&&(G.cStyleComments?(Me>1?he.push([se,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):he.push([se,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ke.push([F,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):he.push([se,/^#[^\r\n]*/,null,"#"])),G.cStyleComments&&(ke.push([se,/^\/\/[^\r\n]*/,null]),ke.push([se,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ge=G.regexLiterals;if(Ge){var et=Ge>1?"":`
\r`,Ke=et?".":"[\\S\\s]",yt="/(?=[^/*"+et+"])(?:[^/\\x5B\\x5C"+et+"]|\\x5C"+Ke+"|\\x5B(?:[^\\x5C\\x5D"+et+"]|\\x5C"+Ke+")*(?:\\x5D|$))+/";ke.push(["lang-regex",RegExp("^"+be+"("+yt+")")])}var ct=G.types;ct&&ke.push([j,ct]);var gt=(""+G.keywords).replace(/^ | $/g,"");gt.length&&ke.push([b,new RegExp("^(?:"+gt.replace(/[\s,]+/g,"|")+")\\b"),null]),he.push([S,/^\s+/,null,` \r
\xA0`]);var st="^.[^\\s\\w.$@'\"`/\\\\]*";return G.regexLiterals&&(st+="(?!s*/)"),ke.push([re,/^@[a-z_$][a-z_$@0-9]*/i,null],[j,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[S,/^[a-z_$][a-z_$@0-9]*/i,null],[re,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[S,/^\\[\s\S]?/,null],[k,new RegExp(st),null]),nt(he,ke)}var Pe=Ne({keywords:ee,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ae(G,he,ke){for(var Me=/(?:^|\s)nocode(?:\s|$)/,Ge=/\r\n?|\n/,et=G.ownerDocument,Ke=et.createElement("li");G.firstChild;)Ke.appendChild(G.firstChild);var yt=[Ke];function ct(Le){var ft=Le.nodeType;if(ft==1&&!Me.test(Le.className))if(Le.nodeName==="br")gt(Le),Le.parentNode&&Le.parentNode.removeChild(Le);else for(var At=Le.firstChild;At;At=At.nextSibling)ct(At);else if((ft==3||ft==4)&&ke){var He=Le.nodeValue,Xe=He.match(Ge);if(Xe){var $=He.substring(0,Xe.index);Le.nodeValue=$;var ne=He.substring(Xe.index+Xe[0].length);if(ne){var ie=Le.parentNode;ie.insertBefore(et.createTextNode(ne),Le.nextSibling)}gt(Le),$||Le.parentNode.removeChild(Le)}}}function gt(Le){for(;!Le.nextSibling;)if(Le=Le.parentNode,!Le)return;function ft(Xe,$){var ne=$?Xe.cloneNode(!1):Xe,ie=Xe.parentNode;if(ie){var P=ft(ie,1),D=Xe.nextSibling;P.appendChild(ne);for(var X=D;X;X=D)D=X.nextSibling,P.appendChild(X)}return ne}for(var At=ft(Le.nextSibling,0),He;(He=At.parentNode)&&He.nodeType===1;)At=He;yt.push(At)}for(var st=0;st<yt.length;++st)ct(yt[st]);he===(he|0)&&yt[0].setAttribute("value",he);var Ot=et.createElement("ol");Ot.className="linenums";for(var xt=Math.max(0,he-1|0)||0,st=0,wt=yt.length;st<wt;++st)Ke=yt[st],Ke.className="L"+(st+xt)%10,Ke.firstChild||Ke.appendChild(et.createTextNode("\xA0")),Ot.appendChild(Ke);G.appendChild(Ot)}function Z(G){var he=/\bMSIE\s(\d+)/.exec(navigator.userAgent);he=he&&+he[1]<=8;var ke=/\n/g,Me=G.sourceCode,Ge=Me.length,et=0,Ke=G.spans,yt=Ke.length,ct=0,gt=G.decorations,st=gt.length,Ot=0;gt[st]=Ge;var xt,wt;for(wt=xt=0;wt<st;)gt[wt]!==gt[wt+2]?(gt[xt++]=gt[wt++],gt[xt++]=gt[wt++]):wt+=2;for(st=xt,wt=xt=0;wt<st;){for(var Le=gt[wt],ft=gt[wt+1],At=wt+2;At+2<=st&&gt[At+1]===ft;)At+=2;gt[xt++]=Le,gt[xt++]=ft,wt=At}st=gt.length=xt;var He=G.sourceNode,Xe="";He&&(Xe=He.style.display,He.style.display="none");try{for(var $=null;ct<yt;){var ne=Ke[ct],ie=Ke[ct+2]||Ge,P=gt[Ot+2]||Ge,At=Math.min(ie,P),D=Ke[ct+1],X;if(D.nodeType!==1&&(X=Me.substring(et,At))){he&&(X=X.replace(ke,"\r")),D.nodeValue=X;var V=D.ownerDocument,xe=V.createElement("span");xe.className=gt[Ot+1];var ve=D.parentNode;ve.replaceChild(xe,D),xe.appendChild(D),et<ie&&(Ke[ct+1]=D=V.createTextNode(Me.substring(At,ie)),ve.insertBefore(D,xe.nextSibling))}et=At,et>=ie&&(ct+=2),et>=P&&(Ot+=2)}}finally{He&&(He.style.display=Xe)}}var ye={};function W(G,he){for(var ke=he.length;--ke>=0;){var Me=he[ke];ye.hasOwnProperty(Me)?B.console&&console.warn("cannot override language handler %s",Me):ye[Me]=G}}function T(G,he){return G&&ye.hasOwnProperty(G)||(G=/^\s*</.test(he)?"default-markup":"default-code"),ye[G]}W(Pe,["default-code"]),W(nt([],[[S,/^[^<?]+/],[z,/^<!\w[^>]*(?:>|$)/],[se,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[k,/^(?:<[%?]|[%?]>)/],["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"]),W(nt([[S,/^[\s]+/,null,` \r
`],[de,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[Q,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[K,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[k,/^[=<>\/]+/],["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"]),W(nt([],[[de,/^[\s\S]+/]]),["uq.val"]),W(Ne({keywords:C,hashComments:!0,cStyleComments:!0,types:oe}),["c","cc","cpp","cxx","cyc","m"]),W(Ne({keywords:"null,true,false"}),["json"]),W(Ne({keywords:x,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:oe}),["cs"]),W(Ne({keywords:O,cStyleComments:!0}),["java"]),W(Ne({keywords:L,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),W(Ne({keywords:v,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),W(Ne({keywords:m,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),W(Ne({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),W(Ne({keywords:M,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),W(Ne({keywords:w,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),W(nt([],[[F,/^[\s\S]+/]]),["regex"]);function Ce(G){var he=G.langExtension;try{var ke=y(G.sourceNode,G.pre),Me=ke.sourceCode;G.sourceCode=Me,G.spans=ke.spans,G.basePos=0,T(he,Me)(G),Z(G)}catch(Ge){B.console&&console.log(Ge&&Ge.stack||Ge)}}function We(G,he,ke){var Me=ke||!1,Ge=he||null,et=document.createElement("div");et.innerHTML="<pre>"+G+"</pre>",et=et.firstChild,Me&&ae(et,Me,!0);var Ke={langExtension:Ge,numberLines:Me,sourceNode:et,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ce(Ke),et.innerHTML}function Ze(G,he){var ke=he||document.body,Me=ke.ownerDocument||document;function Ge(ne){return ke.getElementsByTagName(ne)}for(var et=[Ge("pre"),Ge("code"),Ge("xmp")],Ke=[],yt=0;yt<et.length;++yt)for(var ct=0,gt=et[yt].length;ct<gt;++ct)Ke.push(et[yt][ct]);et=null;var st=Date;st.now||(st={now:function(){return+new Date}});var Ot=0,xt=/\blang(?:uage)?-([\w.]+)(?!\S)/,wt=/\bprettyprint\b/,Le=/\bprettyprinted\b/,ft=/pre|xmp/i,At=/^code$/i,He=/^(?:pre|code|xmp)$/i,Xe={};function $(){for(var ne=B.PR_SHOULD_USE_CONTINUATION?st.now()+250:Infinity;Ot<Ke.length&&st.now()<ne;Ot++){for(var ie=Ke[Ot],P=Xe,D=ie;D=D.previousSibling;){var X=D.nodeType,V=(X===7||X===8)&&D.nodeValue;if(V?!/^\??prettify\b/.test(V):X!==3||/\S/.test(D.nodeValue))break;if(V){P={},V.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Wt,St,Yt){P[St]=Yt});break}}var xe=ie.className;if((P!==Xe||wt.test(xe))&&!Le.test(xe)){for(var ve=!1,Oe=ie.parentNode;Oe;Oe=Oe.parentNode){var lt=Oe.tagName;if(He.test(lt)&&Oe.className&&wt.test(Oe.className)){ve=!0;break}}if(!ve){ie.className+=" prettyprinted";var Ye=P.lang;if(!Ye){Ye=xe.match(xt);var je;!Ye&&(je=De(ie))&&At.test(je.tagName)&&(Ye=je.className.match(xt)),Ye&&(Ye=Ye[1])}var pt;if(ft.test(ie.tagName))pt=1;else{var Ut=ie.currentStyle,ut=Me.defaultView,$t=Ut?Ut.whiteSpace:ut&&ut.getComputedStyle?ut.getComputedStyle(ie,null).getPropertyValue("white-space"):0;pt=$t&&$t.substring(0,3)==="pre"}var ot=P.linenums;(ot=ot==="true"||+ot)||(ot=xe.match(/\blinenums\b(?::(\d+))?/),ot=ot?ot[1]&&ot[1].length?+ot[1]:!0:!1),ot&&ae(ie,ot,pt);var Xt={langExtension:Ye,sourceNode:ie,numberLines:ot,pre:pt,sourceCode:null,basePos:null,spans:null,decorations:null};Ce(Xt)}}}Ot<Ke.length?B.setTimeout($,250):typeof G=="function"&&G()}$()}var Be=B.PR={createSimpleLexer:nt,registerLangHandler:W,sourceDecorator:Ne,PR_ATTRIB_NAME:K,PR_ATTRIB_VALUE:de,PR_COMMENT:se,PR_DECLARATION:z,PR_KEYWORD:b,PR_LITERAL:re,PR_NOCODE:J,PR_PLAIN:S,PR_PUNCTUATION:k,PR_SOURCE:U,PR_STRING:F,PR_TAG:Q,PR_TYPE:j,prettyPrintOne:me?B.prettyPrintOne=We:fe=We,prettyPrint:Y=me?B.prettyPrint=Ze:Y=Ze},H=B.define;typeof H=="function"&&H.amd&&H("google-code-prettify",[],function(){return Be})})()},T8No:function(rt,ue,l){"use strict";l.d(ue,"a",function(){return we}),l.d(ue,"b",function(){return O}),l.d(ue,"d",function(){return x}),l.d(ue,"c",function(){return w}),l.d(ue,"e",function(){return M});var q=l("N0LK"),_e=l("Cg/j"),me=function(){var m=function(v,f){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,ee){L.__proto__=ee}||function(L,ee){for(var oe in ee)ee.hasOwnProperty(oe)&&(L[oe]=ee[oe])},m(v,f)};return function(v,f){m(v,f);function L(){this.constructor=v}v.prototype=f===null?Object.create(f):(L.prototype=f.prototype,new L)}}(),we=function(){function m(){}return m.has=function(v){return fe.create(v)},m.equals=function(v,f){return Y.create(v,f)},m.regex=function(v,f){return A.create(v,f)},m.not=function(v){return N.create(v)},m.and=function(){for(var v=[],f=0;f<arguments.length;f++)v[f]=arguments[f];return C.create(v)},m.or=function(){for(var v=[],f=0;f<arguments.length;f++)v[f]=arguments[f];return O.create(v)},m.deserialize=function(v,f){return f===void 0&&(f=!1),v?this._deserializeOrExpression(v,f):void 0},m._deserializeOrExpression=function(v,f){var L=this,ee=v.split("||");return O.create(ee.map(function(oe){return L._deserializeAndExpression(oe,f)}))},m._deserializeAndExpression=function(v,f){var L=this,ee=v.split("&&");return C.create(ee.map(function(oe){return L._deserializeOne(oe,f)}))},m._deserializeOne=function(v,f){if(v=v.trim(),v.indexOf("!=")>=0){var L=v.split("!=");return B.create(L[0].trim(),this._deserializeValue(L[1],f))}if(v.indexOf("==")>=0){var L=v.split("==");return Y.create(L[0].trim(),this._deserializeValue(L[1],f))}if(v.indexOf("=~")>=0){var L=v.split("=~");return A.create(L[0].trim(),this._deserializeRegexValue(L[1],f))}return/^\!\s*/.test(v)?N.create(v.substr(1).trim()):fe.create(v)},m._deserializeValue=function(v,f){if(v=v.trim(),v==="true")return!0;if(v==="false")return!1;var L=/^'([^']*)'$/.exec(v);return L?L[1].trim():v},m._deserializeRegexValue=function(v,f){if(Object(q.x)(v)){if(f)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}var L=v.indexOf("/"),ee=v.lastIndexOf("/");if(L===ee||L<0){if(f)throw new Error("bad regexp-value '"+v+"', missing /-enclosure");return console.warn("bad regexp-value '"+v+"', missing /-enclosure"),null}var oe=v.slice(L+1,ee),F=v[ee+1]==="i"?"i":"";try{return new RegExp(oe,F)}catch(b){if(f)throw new Error("bad regexp-value '"+v+"', parse error: "+b);return console.warn("bad regexp-value '"+v+"', parse error: "+b),null}},m}();function Ee(m,v){var f=m.getType(),L=v.getType();if(f!==L)return f-L;switch(f){case 1:return m.cmp(v);case 2:return m.cmp(v);case 3:return m.cmp(v);case 4:return m.cmp(v);case 6:return m.cmp(v);case 7:return m.cmp(v);case 5:return m.cmp(v);default:throw new Error("Unknown ContextKeyExpr!")}}var fe=function(){function m(v){this.key=v}return m.create=function(v){return new m(v)},m.prototype.getType=function(){return 1},m.prototype.cmp=function(v){return this.key<v.key?-1:this.key>v.key?1:0},m.prototype.equals=function(v){return v instanceof m?this.key===v.key:!1},m.prototype.evaluate=function(v){return!!v.getValue(this.key)},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return N.create(this.key)},m}(),Y=function(){function m(v,f){this.key=v,this.value=f}return m.create=function(v,f){return typeof f=="boolean"?f?fe.create(v):N.create(v):new m(v,f)},m.prototype.getType=function(){return 3},m.prototype.cmp=function(v){return this.key<v.key?-1:this.key>v.key?1:this.value<v.value?-1:this.value>v.value?1:0},m.prototype.equals=function(v){return v instanceof m?this.key===v.key&&this.value===v.value:!1},m.prototype.evaluate=function(v){return v.getValue(this.key)==this.value},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return B.create(this.key,this.value)},m}(),B=function(){function m(v,f){this.key=v,this.value=f}return m.create=function(v,f){return typeof f=="boolean"?f?N.create(v):fe.create(v):new m(v,f)},m.prototype.getType=function(){return 4},m.prototype.cmp=function(v){return this.key<v.key?-1:this.key>v.key?1:this.value<v.value?-1:this.value>v.value?1:0},m.prototype.equals=function(v){return v instanceof m?this.key===v.key&&this.value===v.value:!1},m.prototype.evaluate=function(v){return v.getValue(this.key)!=this.value},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return Y.create(this.key,this.value)},m}(),N=function(){function m(v){this.key=v}return m.create=function(v){return new m(v)},m.prototype.getType=function(){return 2},m.prototype.cmp=function(v){return this.key<v.key?-1:this.key>v.key?1:0},m.prototype.equals=function(v){return v instanceof m?this.key===v.key:!1},m.prototype.evaluate=function(v){return!v.getValue(this.key)},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return fe.create(this.key)},m}(),A=function(){function m(v,f){this.key=v,this.regexp=f}return m.create=function(v,f){return new m(v,f)},m.prototype.getType=function(){return 6},m.prototype.cmp=function(v){if(this.key<v.key)return-1;if(this.key>v.key)return 1;var f=this.regexp?this.regexp.source:"",L=v.regexp?v.regexp.source:"";return f<L?-1:f>L?1:0},m.prototype.equals=function(v){if(v instanceof m){var f=this.regexp?this.regexp.source:"",L=v.regexp?v.regexp.source:"";return this.key===v.key&&f===L}return!1},m.prototype.evaluate=function(v){var f=v.getValue(this.key);return this.regexp?this.regexp.test(f):!1},m.prototype.keys=function(){return[this.key]},m.prototype.negate=function(){return _.create(this)},m}(),_=function(){function m(v){this._actual=v}return m.create=function(v){return new m(v)},m.prototype.getType=function(){return 7},m.prototype.cmp=function(v){return this._actual.cmp(v._actual)},m.prototype.equals=function(v){return v instanceof m?this._actual.equals(v._actual):!1},m.prototype.evaluate=function(v){return!this._actual.evaluate(v)},m.prototype.keys=function(){return this._actual.keys()},m.prototype.negate=function(){return this._actual},m}(),C=function(){function m(v){this.expr=v}return m.create=function(v){var f=m._normalizeArr(v);return f.length===0?void 0:f.length===1?f[0]:new m(f)},m.prototype.getType=function(){return 5},m.prototype.cmp=function(v){if(this.expr.length<v.expr.length)return-1;if(this.expr.length>v.expr.length)return 1;for(var f=0,L=this.expr.length;f<L;f++){var ee=Ee(this.expr[f],v.expr[f]);if(ee!==0)return ee}return 0},m.prototype.equals=function(v){if(v instanceof m){if(this.expr.length!==v.expr.length)return!1;for(var f=0,L=this.expr.length;f<L;f++)if(!this.expr[f].equals(v.expr[f]))return!1;return!0}return!1},m.prototype.evaluate=function(v){for(var f=0,L=this.expr.length;f<L;f++)if(!this.expr[f].evaluate(v))return!1;return!0},m._normalizeArr=function(v){var f=[];if(v){for(var L=0,ee=v.length;L<ee;L++){var oe=v[L];if(!oe)continue;if(oe instanceof m){f=f.concat(oe.expr);continue}if(oe instanceof O)throw new Error('It is not allowed to have an or expression here due to lack of parens! For example "a && (b||c)" is not supported, use "(a&&b) || (a&&c)" instead.');f.push(oe)}f.sort(Ee)}return f},m.prototype.keys=function(){for(var v=[],f=0,L=this.expr;f<L.length;f++){var ee=L[f];v.push.apply(v,ee.keys())}return v},m.prototype.negate=function(){for(var v=[],f=0,L=this.expr;f<L.length;f++){var ee=L[f];v.push(ee.negate())}return O.create(v)},m}(),O=function(){function m(v){this.expr=v}return m.create=function(v){var f=m._normalizeArr(v);return f.length===0?void 0:f.length===1?f[0]:new m(f)},m.prototype.getType=function(){return 8},m.prototype.equals=function(v){if(v instanceof m){if(this.expr.length!==v.expr.length)return!1;for(var f=0,L=this.expr.length;f<L;f++)if(!this.expr[f].equals(v.expr[f]))return!1;return!0}return!1},m.prototype.evaluate=function(v){for(var f=0,L=this.expr.length;f<L;f++)if(this.expr[f].evaluate(v))return!0;return!1},m._normalizeArr=function(v){var f=[];if(v){for(var L=0,ee=v.length;L<ee;L++){var oe=v[L];if(!oe)continue;if(oe instanceof m){f=f.concat(oe.expr);continue}f.push(oe)}f.sort(Ee)}return f},m.prototype.keys=function(){for(var v=[],f=0,L=this.expr;f<L.length;f++){var ee=L[f];v.push.apply(v,ee.keys())}return v},m.prototype.negate=function(){for(var v=[],f=0,L=this.expr;f<L.length;f++){var ee=L[f];v.push(ee.negate())}for(var oe=function(U){return U instanceof m?U.expr:[U]};v.length>1;){for(var F=v.shift(),b=v.shift(),se=[],j=0,re=oe(F);j<re.length;j++)for(var k=re[j],S=0,Q=oe(b);S<Q.length;S++){var z=Q[S];se.push(we.and(k,z))}v.unshift(we.or.apply(we,se))}return v[0]},m}(),x=function(m){me(v,m);function v(f,L){var ee=m.call(this,f)||this;return ee._defaultValue=L,ee}return v.prototype.bindTo=function(f){return f.createKey(this.key,this._defaultValue)},v.prototype.getValue=function(f){return f.getContextKeyValue(this.key)},v.prototype.toNegated=function(){return we.not(this.key)},v}(fe),w=Object(_e.c)("contextKeyService"),M="setContext"},"VrN/":function(rt,ue,l){(function(q,_e){rt.exports=_e()})(this,function(){"use strict";var q=navigator.userAgent,_e=navigator.platform,me=/gecko\/\d/i.test(q),we=/MSIE \d/.test(q),Ee=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q),fe=/Edge\/(\d+)/.exec(q),Y=we||Ee||fe,B=Y&&(we?document.documentMode||6:+(fe||Ee)[1]),N=!fe&&/WebKit\//.test(q),A=N&&/Qt\/\d+\.\d+/.test(q),_=!fe&&/Chrome\//.test(q),C=/Opera\//.test(q),O=/Apple Computer/.test(navigator.vendor),x=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(q),w=/PhantomJS/.test(q),M=!fe&&/AppleWebKit/.test(q)&&/Mobile\/\w+/.test(q),m=/Android/.test(q),v=M||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(q),f=M||/Mac/.test(_e),L=/\bCrOS\b/.test(q),ee=/win/i.test(_e),oe=C&&q.match(/Version\/(\d*\.\d*)/);oe&&(oe=Number(oe[1])),oe&&oe>=15&&(C=!1,N=!0);var F=f&&(A||C&&(oe==null||oe<12.11)),b=me||Y&&B>=9;function se(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var j=function(e,t){var i=e.className,n=se(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 re(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function k(e,t){return re(e).appendChild(t)}function S(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 Q(e,t,i,n){var r=S(e,t,i,n);return r.setAttribute("role","presentation"),r}var z;document.createRange?z=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:z=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 U(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 K(){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 de(e,t){var i=e.className;se(t).test(i)||(e.className+=(i?" ":"")+t)}function J(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!se(i[n]).test(t)&&(t+=" "+i[n]);return t}var be=function(e){e.select()};M?be=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Y&&(be=function(e){try{e.select()}catch(t){}});function I(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function y(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 pe(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,d=r||0;;){var g=e.indexOf(" ",s);if(g<0||g>=t)return d+(t-s);d+=g-s,d+=i-d%i,s=g+1}}var Ue=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};Ue.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ue.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 nt=50,Ne={toString:function(){return"CodeMirror.Pass"}},Pe={scroll:!1},ae={origin:"*mouse"},Z={origin:"+move"};function ye(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var d=s-n;if(s==e.length||r+d>=t)return n+Math.min(d,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var W=[""];function T(e){for(;W.length<=e;)W.push(Ce(W)+" ");return W[e]}function Ce(e){return e[e.length-1]}function We(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function Ze(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function Be(){}function H(e,t){var i;return Object.create?i=Object.create(e):(Be.prototype=e,i=new Be),t&&y(t,i),i}var G=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function he(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||G.test(e))}function ke(e,t){return t?t.source.indexOf("\\w")>-1&&he(e)?!0:t.test(e):he(e)}function Me(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ge=/[\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 et(e){return e.charCodeAt(0)>=768&&Ge.test(e)}function Ke(e,t,i){for(;(i<0?t>0:t<e.length)&&et(e.charAt(t));)t+=i;return t}function yt(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 ct(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var d=e[s];(d.from<i&&d.to>t||t==i&&d.to==t)&&(n(Math.max(d.from,t),Math.min(d.to,i),d.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var gt=null;function st(e,t,i){var n;gt=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:gt=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:gt=r)}return n!=null?n:gt}var Ot=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(R){return R<=247?e.charAt(R):1424<=R&&R<=1524?"R":1536<=R&&R<=1785?t.charAt(R-1536):1774<=R&&R<=2220?"r":8192<=R&&R<=8203?"w":R==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,d=/[Lb1n]/,g=/[1n]/;function E(R,te,le){this.level=R,this.from=te,this.to=le}return function(R,te){var le=te=="ltr"?"L":"R";if(R.length==0||te=="ltr"&&!n.test(R))return!1;for(var Te=R.length,Se=[],Qe=0;Qe<Te;++Qe)Se.push(i(R.charCodeAt(Qe)));for(var at=0,mt=le;at<Te;++at){var kt=Se[at];kt=="m"?Se[at]=mt:mt=kt}for(var Bt=0,Rt=le;Bt<Te;++Bt){var Ht=Se[Bt];Ht=="1"&&Rt=="r"?Se[Bt]="n":s.test(Ht)&&(Rt=Ht,Ht=="r"&&(Se[Bt]="R"))}for(var tn=1,Qt=Se[0];tn<Te-1;++tn){var pn=Se[tn];pn=="+"&&Qt=="1"&&Se[tn+1]=="1"?Se[tn]="1":pn==","&&Qt==Se[tn+1]&&(Qt=="1"||Qt=="n")&&(Se[tn]=Qt),Qt=pn}for(var Bn=0;Bn<Te;++Bn){var bi=Se[Bn];if(bi==",")Se[Bn]="N";else if(bi=="%"){var Qn=void 0;for(Qn=Bn+1;Qn<Te&&Se[Qn]=="%";++Qn);for(var Ki=Bn&&Se[Bn-1]=="!"||Qn<Te&&Se[Qn]=="1"?"1":"N",Ui=Bn;Ui<Qn;++Ui)Se[Ui]=Ki;Bn=Qn-1}}for(var ai=0,Ii=le;ai<Te;++ai){var xi=Se[ai];Ii=="L"&&xi=="1"?Se[ai]="L":s.test(xi)&&(Ii=xi)}for(var ci=0;ci<Te;++ci)if(r.test(Se[ci])){var si=void 0;for(si=ci+1;si<Te&&r.test(Se[si]);++si);for(var ei=(ci?Se[ci-1]:le)=="L",Bi=(si<Te?Se[si]:le)=="L",eo=ei==Bi?ei?"L":"R":le,wr=ci;wr<si;++wr)Se[wr]=eo;ci=si-1}for(var Oi=[],or,Ei=0;Ei<Te;)if(d.test(Se[Ei])){var Ra=Ei;for(++Ei;Ei<Te&&d.test(Se[Ei]);++Ei);Oi.push(new E(0,Ra,Ei))}else{var hr=Ei,Ur=Oi.length,Ir=te=="rtl"?1:0;for(++Ei;Ei<Te&&Se[Ei]!="L";++Ei);for(var Mi=hr;Mi<Ei;)if(g.test(Se[Mi])){hr<Mi&&(Oi.splice(Ur,0,new E(1,hr,Mi)),Ur+=Ir);var to=Mi;for(++Mi;Mi<Ei&&g.test(Se[Mi]);++Mi);Oi.splice(Ur,0,new E(2,to,Mi)),Ur+=Ir,hr=Mi}else++Mi;hr<Ei&&Oi.splice(Ur,0,new E(1,hr,Ei))}return te=="ltr"&&(Oi[0].level==1&&(or=R.match(/^\s+/))&&(Oi[0].from=or[0].length,Oi.unshift(new E(0,0,or[0].length))),Ce(Oi).level==1&&(or=R.match(/\s+$/))&&(Ce(Oi).to-=or[0].length,Oi.push(new E(0,Te-or[0].length,Te)))),te=="rtl"?Oi.reverse():Oi}}();function xt(e,t){var i=e.order;return i==null&&(i=e.order=Ot(e.text,t)),i}var wt=[],Le=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]||wt).concat(i)}};function ft(e,t){return e._handlers&&e._handlers[t]||wt}function At(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers,r=n&&n[t];if(r){var s=De(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function He(e,t){var i=ft(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 Xe(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),He(e,i||t.type,e,t),X(t)||t.codemirrorIgnore}function $(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 ne(e,t){return ft(e,t).length>0}function ie(e){e.prototype.on=function(t,i){Le(this,t,i)},e.prototype.off=function(t,i){At(this,t,i)}}function P(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function D(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function X(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function V(e){P(e),D(e)}function xe(e){return e.target||e.srcElement}function ve(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),f&&e.ctrlKey&&t==1&&(t=3),t}var Oe=function(){if(Y&&B<9)return!1;var e=S("div");return"draggable"in e||"dragDrop"in e}(),lt;function Ye(e){if(lt==null){var t=S("span","\u200B");k(e,S("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(lt=t.offsetWidth<=1&&t.offsetHeight>2&&!(Y&&B<8))}var i=lt?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var je;function pt(e){if(je!=null)return je;var t=k(e,document.createTextNode("A\u062EA")),i=z(t,0,1).getBoundingClientRect(),n=z(t,1,2).getBoundingClientRect();return re(e),!i||i.left==i.right?!1:je=n.right-i.right<3}var Ut=`
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),d=s.indexOf("\r");d!=-1?(i.push(s.slice(0,d)),t+=d+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},ut=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},$t=function(){var e=S("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ot=null;function Xt(e){if(ot!=null)return ot;var t=k(e,S("span","x")),i=t.getBoundingClientRect(),n=z(t,0,1).getBoundingClientRect();return ot=Math.abs(i.left-n.left)>1}var Wt={},St={};function Yt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wt[e]=t}function zt(e,t){St[e]=t}function Je(e){if(typeof e=="string"&&St.hasOwnProperty(e))e=St[e];else if(e&&typeof e.name=="string"&&St.hasOwnProperty(e.name)){var t=St[e.name];typeof t=="string"&&(t={name:t}),e=H(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Je("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Je("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ze(e,t){t=Je(t);var i=Wt[t.name];if(!i)return ze(e,"text/plain");var n=i(e,t);if(Ae.hasOwnProperty(t.name)){var r=Ae[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 d in t.modeProps)n[d]=t.modeProps[d];return n}var Ae={};function $e(e,t){var i=Ae.hasOwnProperty(e)?Ae[e]:Ae[e]={};y(t,i)}function Dt(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 Nt(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 Jt(e,t,i){return e.startState?e.startState(t,i):!0}var Ft=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};Ft.prototype.eol=function(){return this.pos>=this.string.length},Ft.prototype.sol=function(){return this.pos==this.lineStart},Ft.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ft.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ft.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},Ft.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ft.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ft.prototype.skipToEnd=function(){this.pos=this.string.length},Ft.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ft.prototype.backUp=function(e){this.pos-=e},Ft.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=pe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?pe(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.indentation=function(){return pe(this.string,null,this.tabSize)-(this.lineStart?pe(this.string,this.lineStart,this.tabSize):0)},Ft.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(d){return i?d.toLowerCase():d},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)}},Ft.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ft.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ft.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ft.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function _t(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 an(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var d=s.text;r==i.line&&(d=d.slice(0,i.ch)),r==t.line&&(d=d.slice(t.ch)),n.push(d),++r}),n}function jt(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function cn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Kt(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 dn(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 d=0;d<e.lines.length;++d){var g=e.lines[d],E=g.height;if(t<E)break;t-=E}return i+d}function Nn(e,t){return t>=e.first&&t<e.first+e.size}function sn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Fe(e,t,i){if(i===void 0&&(i=null),!(this instanceof Fe))return new Fe(e,t,i);this.line=e,this.ch=t,this.sticky=i}function it(e,t){return e.line-t.line||e.ch-t.ch}function Gt(e,t){return e.sticky==t.sticky&&it(e,t)==0}function qt(e){return Fe(e.line,e.ch)}function nn(e,t){return it(e,t)<0?t:e}function ln(e,t){return it(e,t)<0?e:t}function u(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 Fe(e.first,0);var i=e.first+e.size-1;return t.line>i?Fe(i,_t(e,i).text.length):a(t,_t(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?Fe(e.line,t):i<0?Fe(e.line,0):e}function c(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},h=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};h.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},h.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},h.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},h.fromSaved=function(e,t,i){return t instanceof p?new h(e,Dt(e.mode,t.state),i,t.lookAhead):new h(e,Dt(e.mode,t),i)},h.prototype.save=function(e){var t=e!==!1?Dt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new p(t,this.maxLookAhead):t};function ce(e,t,i,n){var r=[e.state.modeGen],s={};Tt(e,t.text,e.doc.mode,i,function(R,te){return r.push(R,te)},s,n);for(var d=i.state,g=function(R){i.baseTokens=r;var te=e.state.overlays[R],le=1,Te=0;i.state=!0,Tt(e,t.text,te.mode,i,function(Se,Qe){for(var at=le;Te<Se;){var mt=r[le];mt>Se&&r.splice(le,1,Se,r[le+1],mt),le+=2,Te=Math.min(Se,mt)}if(!Qe)return;if(te.opaque)r.splice(at,le-at,Se,"overlay "+Qe),le=at+2;else for(;at<le;at+=2){var kt=r[at+1];r[at+1]=(kt?kt+" ":"")+"overlay "+Qe}},s),i.state=d,i.baseTokens=null,i.baseTokenPos=1},E=0;E<e.state.overlays.length;++E)g(E);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function tt(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=ht(e,Kt(t)),r=t.text.length>e.options.maxHighlightLength&&Dt(e.doc.mode,n.state),s=ce(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 ht(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new h(n,!0,t);var s=Mt(e,t,i),d=s>n.first&&_t(n,s-1).stateAfter,g=d?h.fromSaved(n,d,s):new h(n,Jt(n.mode),s);return n.iter(s,t,function(E){It(e,E.text,g);var R=g.line;E.stateAfter=R==t-1||R%5==0||R>=r.viewFrom&&R<r.viewTo?g.save():null,g.nextLine()}),i&&(n.modeFrontier=g.line),g}function It(e,t,i,n){var r=e.doc.mode,s=new Ft(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&Re(r,i.state);!s.eol();)ge(r,s,i.state),s.start=s.pos}function Re(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Nt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function ge(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=Nt(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 qe=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Lt(e,t,i,n){var r=e.doc,s=r.mode,d;t=o(r,t);var g=_t(r,t.line),E=ht(e,t.line,i),R=new Ft(g.text,e.options.tabSize,E),te;for(n&&(te=[]);(n||R.pos<t.ch)&&!R.eol();)R.start=R.pos,d=ge(s,R,E.state),n&&te.push(new qe(R,d,Dt(r.mode,E.state)));return n?te:new qe(R,d,E.state)}function Pt(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 Tt(e,t,i,n,r,s,d){var g=i.flattenSpans;g==null&&(g=e.options.flattenSpans);var E=0,R=null,te=new Ft(t,e.options.tabSize,n),le,Te=e.options.addModeClass&&[null];for(t==""&&Pt(Re(i,n.state),s);!te.eol();){if(te.pos>e.options.maxHighlightLength?(g=!1,d&&It(e,t,n,te.pos),te.pos=t.length,le=null):le=Pt(ge(i,te,n.state,Te),s),Te){var Se=Te[0].name;Se&&(le="m-"+(le?Se+" "+le:Se))}if(!g||R!=le){for(;E<te.start;)E=Math.min(te.start,E+5e3),r(E,R);R=le}te.start=te.pos}for(;E<te.pos;){var Qe=Math.min(te.pos,E+5e3);r(Qe,R),E=Qe}}function Mt(e,t,i){for(var n,r,s=e.doc,d=i?-1:t-(e.doc.mode.innerMode?1e3:100),g=t;g>d;--g){if(g<=s.first)return s.first;var E=_t(s,g-1),R=E.stateAfter;if(R&&(!i||g+(R instanceof p?R.lookAhead:0)<=s.modeFrontier))return g;var te=pe(E.text,null,e.options.tabSize);(r==null||n>te)&&(r=g-1,n=te)}return r}function mn(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=_t(e,n).stateAfter;if(r&&(!(r instanceof p)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var jn=!1,kn=!1;function _n(){jn=!0}function Ln(){kn=!0}function Un(e,t,i){this.marker=e,this.from=t,this.to=i}function ti(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function wi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Xn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function $n(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],d=s.marker,g=s.from==null||(d.inclusiveLeft?s.from<=t:s.from<t);if(g||s.from==t&&d.type=="bookmark"&&(!i||!s.marker.insertLeft)){var E=s.to==null||(d.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new Un(d,s.from,E?null:s.to))}}return n}function $i(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],d=s.marker,g=s.to==null||(d.inclusiveRight?s.to>=t:s.to>t);if(g||s.from==t&&d.type=="bookmark"&&(!i||s.marker.insertLeft)){var E=s.from==null||(d.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new Un(d,E?null:s.from-t,s.to==null?null:s.to-t))}}return n}function _i(e,t){if(t.full)return null;var i=Nn(e,t.from.line)&&_t(e,t.from.line).markedSpans,n=Nn(e,t.to.line)&&_t(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,d=it(t.from,t.to)==0,g=$n(i,r,d),E=$i(n,s,d),R=t.text.length==1,te=Ce(t.text).length+(R?r:0);if(g)for(var le=0;le<g.length;++le){var Te=g[le];if(Te.to==null){var Se=ti(E,Te.marker);Se?R&&(Te.to=Se.to==null?null:Se.to+te):Te.to=r}}if(E)for(var Qe=0;Qe<E.length;++Qe){var at=E[Qe];if(at.to!=null&&(at.to+=te),at.from==null){var mt=ti(g,at.marker);mt||(at.from=te,R&&(g||(g=[])).push(at))}else at.from+=te,R&&(g||(g=[])).push(at)}g&&(g=An(g)),E&&E!=g&&(E=An(E));var kt=[g];if(!R){var Bt=t.text.length-2,Rt;if(Bt>0&&g)for(var Ht=0;Ht<g.length;++Ht)g[Ht].to==null&&(Rt||(Rt=[])).push(new Un(g[Ht].marker,null,null));for(var tn=0;tn<Bt;++tn)kt.push(Rt);kt.push(E)}return kt}function An(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 Fi(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(Se){if(Se.markedSpans)for(var Qe=0;Qe<Se.markedSpans.length;++Qe){var at=Se.markedSpans[Qe].marker;at.readOnly&&(!n||De(n,at)==-1)&&(n||(n=[])).push(at)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var d=n[s],g=d.find(0),E=0;E<r.length;++E){var R=r[E];if(it(R.to,g.from)<0||it(R.from,g.to)>0)continue;var te=[E,1],le=it(R.from,g.from),Te=it(R.to,g.to);(le<0||!d.inclusiveLeft&&!le)&&te.push({from:R.from,to:g.from}),(Te>0||!d.inclusiveRight&&!Te)&&te.push({from:g.to,to:R.to}),r.splice.apply(r,te),E+=te.length-3}return r}function ar(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 fr(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function zn(e){return e.inclusiveLeft?-1:0}function En(e){return e.inclusiveRight?1:0}function li(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=it(n.from,r.from)||zn(e)-zn(t);if(s)return-s;var d=it(n.to,r.to)||En(e)-En(t);return d||t.id-e.id}function gn(e,t){var i=kn&&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||li(n,r.marker)<0)&&(n=r.marker);return n}function Hn(e){return gn(e,!0)}function wn(e){return gn(e,!1)}function di(e,t){var i=kn&&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||li(n,s.marker)<0)&&(n=s.marker)}return n}function Yn(e,t,i,n,r){var s=_t(e,t),d=kn&&s.markedSpans;if(d)for(var g=0;g<d.length;++g){var E=d[g];if(!E.marker.collapsed)continue;var R=E.marker.find(0),te=it(R.from,i)||zn(E.marker)-zn(r),le=it(R.to,n)||En(E.marker)-En(r);if(te>=0&&le<=0||te<=0&&le>=0)continue;if(te<=0&&(E.marker.inclusiveRight&&r.inclusiveLeft?it(R.to,i)>=0:it(R.to,i)>0)||te>=0&&(E.marker.inclusiveRight&&r.inclusiveLeft?it(R.from,n)<=0:it(R.from,n)<0))return!0}}function Ci(e){for(var t;t=Hn(e);)e=t.find(-1,!0).line;return e}function pr(e){for(var t;t=wn(e);)e=t.find(1,!0).line;return e}function nr(e){for(var t,i;t=wn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ir(e,t){var i=_t(e,t),n=Ci(i);return i==n?t:Kt(n)}function Sr(e,t){if(t>e.lastLine())return t;var i=_t(e,t),n;if(!Cn(e,i))return t;for(;n=wn(i);)i=n.find(1,!0).line;return Kt(i)+1}function Cn(e,t){var i=kn&&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&&Ji(e,t,n))return!0}}function Ji(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return Ji(e,n.line,ti(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)&&Ji(e,t,r))return!0}function Gi(e){e=Ci(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 d=0;d<s.children.length;++d){var g=s.children[d];if(g==i)break;t+=g.height}return t}function sr(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=Hn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=wn(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 Zi(e){var t=e.display,i=e.doc;t.maxLine=_t(i,i.first),t.maxLineLength=sr(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=sr(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var lr=function(e,t,i){this.text=e,fr(this,t),this.height=i?i(this):1};lr.prototype.lineNo=function(){return Kt(this)},ie(lr);function ur(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),ar(e),fr(e,i);var r=n?n(e):1;r!=e.height&&cn(e,r)}function no(e){e.parent=null,ar(e)}var Vt={},rn={};function Zt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?rn:Vt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function hn(e,t){var i=Q("span",null,null,N?"padding-right: .1px":null),n={pre:Q("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,d=void 0;n.pos=0,n.addToken=Rn,pt(e.display.measure)&&(d=xt(s,e.doc.direction))&&(n.addToken=Kn(n.addToken,d)),n.map=[];var g=t!=e.display.externalMeasured&&Kt(s);fn(s,n,tt(e,s,g)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=J(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=J(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Ye(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(N){var E=n.content.lastChild;(/\bcm-tab\b/.test(E.className)||E.querySelector&&E.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=J(n.pre.className,n.textClass||"")),n}function bn(e){var t=S("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Rn(e,t,i,n,r,s,d){if(!t)return;var g=e.splitSpaces?yn(t,e.trailingSpace):t,E=e.cm.state.specialChars,R=!1,te;if(!E.test(t))e.col+=t.length,te=document.createTextNode(g),e.map.push(e.pos,e.pos+t.length,te),Y&&B<9&&(R=!0),e.pos+=t.length;else{te=document.createDocumentFragment();for(var le=0;;){E.lastIndex=le;var Te=E.exec(t),Se=Te?Te.index-le:t.length-le;if(Se){var Qe=document.createTextNode(g.slice(le,le+Se));Y&&B<9?te.appendChild(S("span",[Qe])):te.appendChild(Qe),e.map.push(e.pos,e.pos+Se,Qe),e.col+=Se,e.pos+=Se}if(!Te)break;le+=Se+1;var at=void 0;if(Te[0]==" "){var mt=e.cm.options.tabSize,kt=mt-e.col%mt;at=te.appendChild(S("span",T(kt),"cm-tab")),at.setAttribute("role","presentation"),at.setAttribute("cm-text"," "),e.col+=kt}else Te[0]=="\r"||Te[0]==`
`?(at=te.appendChild(S("span",Te[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),at.setAttribute("cm-text",Te[0]),e.col+=1):(at=e.cm.options.specialCharPlaceholder(Te[0]),at.setAttribute("cm-text",Te[0]),Y&&B<9?te.appendChild(S("span",[at])):te.appendChild(at),e.col+=1);e.map.push(e.pos,e.pos+1,at),e.pos++}}if(e.trailingSpace=g.charCodeAt(t.length-1)==32,i||n||r||R||s||d){var Bt=i||"";n&&(Bt+=n),r&&(Bt+=r);var Rt=S("span",[te],Bt,s);if(d)for(var Ht in d)d.hasOwnProperty(Ht)&&Ht!="style"&&Ht!="class"&&Rt.setAttribute(Ht,d[Ht]);return e.content.appendChild(Rt)}e.content.appendChild(te)}function yn(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 Kn(e,t){return function(i,n,r,s,d,g,E){r=r?r+" cm-force-border":"cm-force-border";for(var R=i.pos,te=R+n.length;;){for(var le=void 0,Te=0;Te<t.length&&!(le=t[Te],le.to>R&&le.from<=R);Te++);if(le.to>=te)return e(i,n,r,s,d,g,E);e(i,n.slice(0,le.to-R),r,s,null,g,E),s=null,n=n.slice(le.to-R),R=le.to}}}function Si(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 fn(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var d=1;d<i.length;d+=2)t.addToken(t,r.slice(s,s=i[d]),Zt(i[d+1],t.cm.options));return}for(var g=r.length,E=0,R=1,te="",le,Te,Se=0,Qe,at,mt,kt,Bt;;){if(Se==E){Qe=at=mt=Te="",Bt=null,kt=null,Se=Infinity;for(var Rt=[],Ht=void 0,tn=0;tn<n.length;++tn){var Qt=n[tn],pn=Qt.marker;if(pn.type=="bookmark"&&Qt.from==E&&pn.widgetNode)Rt.push(pn);else if(Qt.from<=E&&(Qt.to==null||Qt.to>E||pn.collapsed&&Qt.to==E&&Qt.from==E)){if(Qt.to!=null&&Qt.to!=E&&Se>Qt.to&&(Se=Qt.to,at=""),pn.className&&(Qe+=" "+pn.className),pn.css&&(Te=(Te?Te+";":"")+pn.css),pn.startStyle&&Qt.from==E&&(mt+=" "+pn.startStyle),pn.endStyle&&Qt.to==Se&&(Ht||(Ht=[])).push(pn.endStyle,Qt.to),pn.title&&((Bt||(Bt={})).title=pn.title),pn.attributes)for(var Bn in pn.attributes)(Bt||(Bt={}))[Bn]=pn.attributes[Bn];pn.collapsed&&(!kt||li(kt.marker,pn)<0)&&(kt=Qt)}else Qt.from>E&&Se>Qt.from&&(Se=Qt.from)}if(Ht)for(var bi=0;bi<Ht.length;bi+=2)Ht[bi+1]==Se&&(at+=" "+Ht[bi]);if(!kt||kt.from==E)for(var Qn=0;Qn<Rt.length;++Qn)Si(t,0,Rt[Qn]);if(kt&&(kt.from||0)==E){if(Si(t,(kt.to==null?g+1:kt.to)-E,kt.marker,kt.from==null),kt.to==null)return;kt.to==E&&(kt=!1)}}if(E>=g)break;for(var Ki=Math.min(g,Se);;){if(te){var Ui=E+te.length;if(!kt){var ai=Ui>Ki?te.slice(0,Ki-E):te;t.addToken(t,ai,le?le+Qe:Qe,mt,E+ai.length==Se?at:"",Te,Bt)}if(Ui>=Ki){te=te.slice(Ki-E),E=Ki;break}E=Ui,mt=""}te=r.slice(s,s=i[R++]),le=Zt(i[R++],t.cm.options)}}}function rr(e,t,i){this.line=t,this.rest=nr(t),this.size=this.rest?Kt(Ce(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Cn(e,t)}function vn(e,t,i){for(var n=[],r,s=t;s<i;s=r){var d=new rr(e.doc,_t(e.doc,s),s);r=s+d.size,n.push(d)}return n}var Jn=null;function Wi(e){Jn?Jn.ops.push(e):e.ownsGroup=Jn={ops:[e],delayedCallbacks:[]}}function zi(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 Br(e,t){var i=e.ownsGroup;if(!i)return;try{zi(i)}finally{Jn=null,t(i)}}var kr=null;function ui(e,t){var i=ft(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;Jn?r=Jn.delayedCallbacks:kr?r=kr:(r=kr=[],setTimeout(qo,0));for(var s=function(g){r.push(function(){return i[g].apply(null,n)})},d=0;d<i.length;++d)s(d)}function qo(){var e=kr;kr=null;for(var t=0;t<e.length;++t)e[t]()}function Fr(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?ea(e,t):s=="gutter"?Ao(e,t,i,n):s=="class"?io(e,t):s=="widget"&&Rr(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=S("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Y&&B<8&&(e.node.style.zIndex=2)),e.node}function cr(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var n=mr(t);t.background=n.insertBefore(S("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function To(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):hn(e,t)}function ea(e,t){var i=t.text.className,n=To(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,io(e,t)):i&&(t.text.className=i)}function io(e,t){cr(e,t),t.line.wrapClass?mr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Ao(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=mr(t);t.gutterBackground=S("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 d=mr(t),g=t.gutter=S("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(g),d.insertBefore(g,t.text),t.line.gutterClass&&(g.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=g.appendChild(S("div",sn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var E=0;E<e.display.gutterSpecs.length;++E){var R=e.display.gutterSpecs[E].className,te=s.hasOwnProperty(R)&&s[R];te&&g.appendChild(S("div",[te],"CodeMirror-gutter-elt","left: "+n.gutterLeft[R]+"px; width: "+n.gutterWidth[R]+"px"))}}}function Rr(e,t,i){t.alignable&&(t.alignable=null);for(var n=se("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ro(e,t,i)}function Po(e,t,i,n){var r=To(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),io(e,t),Ao(e,t,i,n),ro(e,t,n),t.node}function ro(e,t,i){if(Or(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)Or(e,t.rest[n],t,i,!1)}function Or(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),d=0,g=t.widgets;d<g.length;++d){var E=g[d],R=S("div",[E.node],"CodeMirror-linewidget"+(E.className?" "+E.className:""));E.handleMouseEvents||R.setAttribute("cm-ignore-events","true"),ta(E,R,i,n),e.display.input.setUneditable(R),r&&E.above?s.insertBefore(R,i.gutter||i.text):s.appendChild(R),ui(E,"redraw")}}function ta(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 vr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!U(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;"),k(t.display.measure,S("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Qi(e,t){for(var i=xe(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Wr(e){return e.lineSpace.offsetTop}function Tr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lo(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=k(e.measure,S("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 Yi(e){return nt-e.display.nativeBarWidth}function qi(e){return e.display.scroller.clientWidth-Yi(e)-e.display.barWidth}function Ar(e){return e.display.scroller.clientHeight-Yi(e)-e.display.barHeight}function bt(e,t,i){var n=e.options.lineWrapping,r=n&&qi(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var d=t.text.firstChild.getClientRects(),g=0;g<d.length-1;g++){var E=d[g],R=d[g+1];Math.abs(E.bottom-R.bottom)>2&&s.push((E.bottom+R.top)/2-i.top)}}s.push(i.bottom-i.top)}}function dt(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(Kt(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ve(e,t){t=Ci(t);var i=Kt(t),n=e.display.externalMeasured=new rr(e.doc,t,i);n.lineN=i;var r=n.built=hn(e,n);return n.text=r.pre,k(e.display.lineMeasure,r.pre),n}function Ie(e,t,i,n){return Ct(e,vt(e,t),i,n)}function Et(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Lr(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function vt(e,t){var i=Kt(t),n=Et(e,i);n&&!n.text?n=null:n&&n.changes&&(Fr(e,n,i,oo(e)),e.curOp.forceUpdate=!0),n||(n=Ve(e,t));var r=dt(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Ct(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),d;return t.cache.hasOwnProperty(s)?d=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(bt(e,t.view,t.rect),t.hasHeights=!0),d=On(e,t,i,n),d.bogus||(t.cache[s]=d)),{left:d.left,right:d.right,top:r?d.rtop:d.top,bottom:r?d.rbottom:d.bottom}}var en={left:0,right:0,top:0,bottom:0};function un(e,t,i){for(var n,r,s,d,g,E,R=0;R<e.length;R+=3)if(g=e[R],E=e[R+1],t<g?(r=0,s=1,d="left"):t<E?(r=t-g,s=r+1):(R==e.length-3||t==E&&e[R+3]>t)&&(s=E-g,r=s-1,t>=E&&(d="right")),r!=null){if(n=e[R+2],g==E&&i==(n.insertLeft?"left":"right")&&(d=i),i=="left"&&r==0)for(;R&&e[R-2]==e[R-3]&&e[R-1].insertLeft;)n=e[(R-=3)+2],d="left";if(i=="right"&&r==E-g)for(;R<e.length-3&&e[R+3]==e[R+4]&&!e[R+5].insertLeft;)n=e[(R+=3)+2],d="right";break}return{node:n,start:r,end:s,collapse:d,coverStart:g,coverEnd:E}}function Pn(e,t){var i=en;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 On(e,t,i,n){var r=un(t.map,i,n),s=r.node,d=r.start,g=r.end,E=r.collapse,R;if(s.nodeType==3){for(var te=0;te<4;te++){for(;d&&et(t.line.text.charAt(r.coverStart+d));)--d;for(;r.coverStart+g<r.coverEnd&&et(t.line.text.charAt(r.coverStart+g));)++g;if(Y&&B<9&&d==0&&g==r.coverEnd-r.coverStart?R=s.parentNode.getBoundingClientRect():R=Pn(z(s,d,g).getClientRects(),n),R.left||R.right||d==0)break;g=d,d=d-1,E="right"}Y&&B<11&&(R=Mn(e.display.measure,R))}else{d>0&&(E=n="right");var le;e.options.lineWrapping&&(le=s.getClientRects()).length>1?R=le[n=="right"?le.length-1:0]:R=s.getBoundingClientRect()}if(Y&&B<9&&!d&&(!R||!R.left&&!R.right)){var Te=s.parentNode.getClientRects()[0];Te?R={left:Te.left,right:Te.left+Di(e.display),top:Te.top,bottom:Te.bottom}:R=en}for(var Se=R.top-t.rect.top,Qe=R.bottom-t.rect.top,at=(Se+Qe)/2,mt=t.view.measure.heights,kt=0;kt<mt.length-1&&!(at<mt[kt]);kt++);var Bt=kt?mt[kt-1]:0,Rt=mt[kt],Ht={left:(E=="right"?R.right:R.left)-t.rect.left,right:(E=="left"?R.left:R.right)-t.rect.left,top:Bt,bottom:Rt};return!R.left&&!R.right&&(Ht.bogus=!0),e.options.singleCursorHeightPerLine||(Ht.rtop=Se,Ht.rbottom=Qe),Ht}function Mn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Xt(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 Sn(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 ni(e){e.display.externalMeasure=null,re(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Sn(e.display.view[t])}function Fn(e){ni(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Wn(){return _&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function hi(){return _&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ri(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=vr(e.widgets[i]));return t}function qn(e,t,i,n,r){if(!r){var s=ri(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var d=Gi(t);if(n=="local"?d+=Wr(e.display):d-=e.display.viewOffset,n=="page"||n=="window"){var g=e.display.lineSpace.getBoundingClientRect();d+=g.top+(n=="window"?0:hi());var E=g.left+(n=="window"?0:Wn());i.left+=E,i.right+=E}return i.top+=d,i.bottom+=d,i}function fi(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=Wn(),r-=hi();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var d=e.display.lineSpace.getBoundingClientRect();return{left:n-d.left,top:r-d.top}}function Ti(e,t,i,n,r){return n||(n=_t(e.doc,t.line)),qn(e,n,Ie(e,n,t.ch,r),i)}function on(e,t,i,n,r,s){n=n||_t(e.doc,t.line),r||(r=vt(e,n));function d(Qe,at){var mt=Ct(e,r,Qe,at?"right":"left",s);return at?mt.left=mt.right:mt.right=mt.left,qn(e,n,mt,i)}var g=xt(n,e.doc.direction),E=t.ch,R=t.sticky;if(E>=n.text.length?(E=n.text.length,R="before"):E<=0&&(E=0,R="after"),!g)return d(R=="before"?E-1:E,R=="before");function te(Qe,at,mt){var kt=g[at],Bt=kt.level==1;return d(mt?Qe-1:Qe,Bt!=mt)}var le=st(g,E,R),Te=gt,Se=te(E,le,R=="before");return Te!=null&&(Se.other=te(E,Te,R!="before")),Se}function xn(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Di(e.display)*t.ch);var n=_t(e.doc,t.line),r=Gi(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function Zn(e,t,i,n,r){var s=Fe(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function pi(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return Zn(n.first,0,null,-1,-1);var r=dn(n,i),s=n.first+n.size-1;if(r>s)return Zn(n.first+n.size-1,_t(n,s).text.length,null,1,1);t<0&&(t=0);for(var d=_t(n,r);;){var g=In(e,d,r,t,i),E=di(d,g.ch+(g.xRel>0||g.outside>0?1:0));if(!E)return g;var R=E.find(1);if(R.line==r)return R;d=_t(n,r=R.line)}}function oi(e,t,i,n){n-=ri(t);var r=t.text.length,s=yt(function(d){return Ct(e,i,d-1).bottom<=n},r,0);return r=yt(function(d){return Ct(e,i,d).top>n},s,r),{begin:s,end:r}}function Ai(e,t,i,n){i||(i=vt(e,t));var r=qn(e,t,Ct(e,i,n),"line").top;return oi(e,t,i,r)}function Pi(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function In(e,t,i,n,r){r-=Gi(t);var s=vt(e,t),d=ri(t),g=0,E=t.text.length,R=!0,te=xt(t,e.doc.direction);if(te){var le=(e.options.lineWrapping?mi:Gn)(e,t,i,s,te,n,r);R=le.level!=1,g=R?le.from:le.to-1,E=R?le.to:le.from-1}var Te=null,Se=null,Qe=yt(function(tn){var Qt=Ct(e,s,tn);return Qt.top+=d,Qt.bottom+=d,Pi(Qt,n,r,!1)?(Qt.top<=r&&Qt.left<=n&&(Te=tn,Se=Qt),!0):!1},g,E),at,mt,kt=!1;if(Se){var Bt=n-Se.left<Se.right-n,Rt=Bt==R;Qe=Te+(Rt?0:1),mt=Rt?"after":"before",at=Bt?Se.left:Se.right}else{!R&&(Qe==E||Qe==g)&&Qe++,mt=Qe==0?"after":Qe==t.text.length?"before":Ct(e,s,Qe-(R?1:0)).bottom+d<=r==R?"after":"before";var Ht=on(e,Fe(i,Qe,mt),"line",t,s);at=Ht.left,kt=r<Ht.top?-1:r>=Ht.bottom?1:0}return Qe=Ke(t.text,Qe,1),Zn(i,Qe,mt,kt,n-at)}function Gn(e,t,i,n,r,s,d){var g=yt(function(le){var Te=r[le],Se=Te.level!=1;return Pi(on(e,Fe(i,Se?Te.to:Te.from,Se?"before":"after"),"line",t,n),s,d,!0)},0,r.length-1),E=r[g];if(g>0){var R=E.level!=1,te=on(e,Fe(i,R?E.from:E.to,R?"after":"before"),"line",t,n);Pi(te,s,d,!0)&&te.top>d&&(E=r[g-1])}return E}function mi(e,t,i,n,r,s,d){var g=oi(e,t,n,d),E=g.begin,R=g.end;/\s/.test(t.text.charAt(R-1))&&R--;for(var te=null,le=null,Te=0;Te<r.length;Te++){var Se=r[Te];if(Se.from>=R||Se.to<=E)continue;var Qe=Se.level!=1,at=Ct(e,n,Qe?Math.min(R,Se.to)-1:Math.max(E,Se.from)).right,mt=at<s?s-at+1e9:at-s;(!te||le>mt)&&(te=Se,le=mt)}return te||(te=r[r.length-1]),te.from<E&&(te={from:E,to:te.to,level:te.level}),te.to>R&&(te={from:te.from,to:R,level:te.level}),te}var ki;function vi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ki==null){ki=S("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ki.appendChild(document.createTextNode("x")),ki.appendChild(S("br"));ki.appendChild(document.createTextNode("x"))}k(e.measure,ki);var i=ki.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),re(e.measure),i||1}function Di(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=S("span","xxxxxxxxxx"),i=S("pre",[t],"CodeMirror-line-like");k(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function oo(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,d=0;s;s=s.nextSibling,++d){var g=e.display.gutterSpecs[d].className;i[g]=s.offsetLeft+s.clientLeft+r,n[g]=s.clientWidth}return{fixedPos:ao(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ao(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ta(e){var t=vi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Di(e.display)-3);return function(r){if(Cn(e.doc,r))return 0;var s=0;if(r.widgets)for(var d=0;d<r.widgets.length;d++)r.widgets[d].height&&(s+=r.widgets[d].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function na(e){var t=e.doc,i=Ta(e);t.iter(function(n){var r=i(n);r!=n.height&&cn(n,r)})}function Pr(e,t,i,n){var r=e.display;if(!i&&xe(t).getAttribute("cm-not-content")=="true")return null;var s,d,g=r.lineSpace.getBoundingClientRect();try{s=t.clientX-g.left,d=t.clientY-g.top}catch(le){return null}var E=pi(e,s,d),R;if(n&&E.xRel>0&&(R=_t(e.doc,E.line).text).length==E.ch){var te=pe(R,R.length,e.options.tabSize)-R.length;E=Fe(E.line,Math.max(0,Math.round((s-Lo(e.display).left)/Di(e.display))-te))}return E}function Lr(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 Ni(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)kn&&ir(e.doc,t)<r.viewTo&&yr(e);else if(i<=r.viewFrom)kn&&Sr(e.doc,i+n)>r.viewFrom?yr(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)yr(e);else if(t<=r.viewFrom){var s=Mo(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):yr(e)}else if(i>=r.viewTo){var d=Mo(e,t,t,-1);d?(r.view=r.view.slice(0,d.index),r.viewTo=d.lineN):yr(e)}else{var g=Mo(e,t,t,-1),E=Mo(e,i,i+n,1);g&&E?(r.view=r.view.slice(0,g.index).concat(vn(e,g.lineN,E.lineN)).concat(r.view.slice(E.index)),r.viewTo+=n):yr(e)}var R=r.externalMeasured;R&&(i<R.lineN?R.lineN+=n:t<R.lineN+R.size&&(r.externalMeasured=null))}function gr(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[Lr(e,t)];if(s.node==null)return;var d=s.changes||(s.changes=[]);De(d,i)==-1&&d.push(i)}function yr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Mo(e,t,i,n){var r=Lr(e,t),s,d=e.display.view;if(!kn||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var g=e.display.viewFrom,E=0;E<r;E++)g+=d[E].size;if(g!=t){if(n>0){if(r==d.length-1)return null;s=g+d[r].size-t,r++}else s=g-t;t+=s,i+=s}for(;ir(e.doc,i)!=i;){if(r==(n<0?0:d.length-1))return null;i+=n*d[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Vs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=vn(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=vn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Lr(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(vn(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Lr(e,i)))),n.viewTo=i}function Aa(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 so(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Pa(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),d=0;d<i.sel.ranges.length;d++){if(!t&&d==i.sel.primIndex)continue;var g=i.sel.ranges[d];if(g.from().line>=e.display.viewTo||g.to().line<e.display.viewFrom)continue;var E=g.empty();(E||e.options.showCursorWhenSelecting)&&La(e,g.head,r),E||Xs(e,g,s)}return n}function La(e,t,i){var n=on(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(S("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(S("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 Do(e,t){return e.top-t.top||e.left-t.left}function Xs(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),d=Lo(e.display),g=d.left,E=Math.max(n.sizerWidth,qi(e)-n.sizer.offsetLeft)-d.right,R=r.direction=="ltr";function te(Rt,Ht,tn,Qt){Ht<0&&(Ht=0),Ht=Math.round(Ht),Qt=Math.round(Qt),s.appendChild(S("div",null,"CodeMirror-selected","position: absolute; left: "+Rt+`px;
top: `+Ht+"px; width: "+(tn==null?E-Rt:tn)+`px;
height: `+(Qt-Ht)+"px"))}function le(Rt,Ht,tn){var Qt=_t(r,Rt),pn=Qt.text.length,Bn,bi;function Qn(ai,Ii){return Ti(e,Fe(Rt,ai),"div",Qt,Ii)}function Ki(ai,Ii,xi){var ci=Ai(e,Qt,null,ai),si=Ii=="ltr"==(xi=="after")?"left":"right",ei=xi=="after"?ci.begin:ci.end-(/\s/.test(Qt.text.charAt(ci.end-1))?2:1);return Qn(ei,si)[si]}var Ui=xt(Qt,r.direction);return ct(Ui,Ht||0,tn==null?pn:tn,function(ai,Ii,xi,ci){var si=xi=="ltr",ei=Qn(ai,si?"left":"right"),Bi=Qn(Ii-1,si?"right":"left"),eo=Ht==null&&ai==0,wr=tn==null&&Ii==pn,Oi=ci==0,or=!Ui||ci==Ui.length-1;if(Bi.top-ei.top<=3){var Ei=(R?eo:wr)&&Oi,Ra=(R?wr:eo)&&or,hr=Ei?g:(si?ei:Bi).left,Ur=Ra?E:(si?Bi:ei).right;te(hr,ei.top,Ur-hr,ei.bottom)}else{var Ir,Mi,to,Oa;si?(Ir=R&&eo&&Oi?g:ei.left,Mi=R?E:Ki(ai,xi,"before"),to=R?g:Ki(Ii,xi,"after"),Oa=R&&wr&&or?E:Bi.right):(Ir=R?Ki(ai,xi,"before"):g,Mi=!R&&eo&&Oi?E:ei.right,to=!R&&wr&&or?g:Bi.left,Oa=R?Ki(Ii,xi,"after"):E),te(Ir,ei.top,Mi-Ir,ei.bottom),ei.bottom<Bi.top&&te(g,ei.bottom,null,Bi.top),te(to,Bi.top,Oa-to,Bi.bottom)}(!Bn||Do(ei,Bn)<0)&&(Bn=ei),Do(Bi,Bn)<0&&(Bn=Bi),(!bi||Do(ei,bi)<0)&&(bi=ei),Do(Bi,bi)<0&&(bi=Bi)}),{start:Bn,end:bi}}var Te=t.from(),Se=t.to();if(Te.line==Se.line)le(Te.line,Te.ch,Se.ch);else{var Qe=_t(r,Te.line),at=_t(r,Se.line),mt=Ci(Qe)==Ci(at),kt=le(Te.line,Te.ch,mt?Qe.text.length+1:null).end,Bt=le(Se.line,mt?0:null,Se.ch).start;mt&&(kt.top<Bt.top-2?(te(kt.right,kt.top,null,kt.bottom),te(g,Bt.top,Bt.left,Bt.bottom)):te(kt.right,kt.top,Bt.left-kt.right,kt.bottom)),kt.bottom<Bt.top&&te(g,kt.bottom,null,Bt.top)}i.appendChild(s)}function ia(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 Ma(e){e.state.focused||(e.display.input.focus(),ra(e))}function Da(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,zr(e))},100)}function ra(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(He(e,"focus",e,t),e.state.focused=!0,de(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),N&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ia(e)}function zr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(He(e,"blur",e,t),e.state.focused=!1,j(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function No(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,d=void 0,g=0;if(r.hidden)continue;if(Y&&B<8){var E=r.node.offsetTop+r.node.offsetHeight;d=E-i,i=E}else{var R=r.node.getBoundingClientRect();d=R.bottom-R.top,!s&&r.text.firstChild&&(g=r.text.firstChild.getBoundingClientRect().right-R.left-1)}var te=r.line.height-d;if((te>.005||te<-.005)&&(cn(r.line,d),Na(r.line),r.rest))for(var le=0;le<r.rest.length;le++)Na(r.rest[le]);if(g>e.display.sizerWidth){var Te=Math.ceil(g/Di(e.display));Te>e.display.maxLineLength&&(e.display.maxLineLength=Te,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Na(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 jo(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=dn(t,n),d=dn(t,r);if(i&&i.ensure){var g=i.ensure.from.line,E=i.ensure.to.line;g<s?(s=g,d=dn(t,Gi(_t(t,g))+e.wrapper.clientHeight)):Math.min(E,t.lastLine())>=d&&(s=dn(t,Gi(_t(t,E))-e.wrapper.clientHeight),d=E)}return{from:s,to:Math.max(d,s+1)}}function $s(e,t){if(Xe(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&&!w){var s=S("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Wr(e.display))+`px;
height: `+(t.bottom-t.top+Yi(e)+i.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(r),e.display.lineSpace.removeChild(s)}}function Ys(e,t,i,n){n==null&&(n=0);var r;!e.options.lineWrapping&&t==i&&(t=t.ch?Fe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?Fe(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var d=!1,g=on(e,t),E=!i||i==t?g:on(e,i);r={left:Math.min(g.left,E.left),top:Math.min(g.top,E.top)-n,right:Math.max(g.left,E.left),bottom:Math.max(g.bottom,E.bottom)+n};var R=oa(e,r),te=e.doc.scrollTop,le=e.doc.scrollLeft;if(R.scrollTop!=null&&(uo(e,R.scrollTop),Math.abs(e.doc.scrollTop-te)>1&&(d=!0)),R.scrollLeft!=null&&(Mr(e,R.scrollLeft),Math.abs(e.doc.scrollLeft-le)>1&&(d=!0)),!d)break}return r}function Js(e,t){var i=oa(e,t);i.scrollTop!=null&&uo(e,i.scrollTop),i.scrollLeft!=null&&Mr(e,i.scrollLeft)}function oa(e,t){var i=e.display,n=vi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=Ar(e),d={};t.bottom-t.top>s&&(t.bottom=t.top+s);var g=e.doc.height+Tr(i),E=t.top<n,R=t.bottom>g-n;if(t.top<r)d.scrollTop=E?0:t.top;else if(t.bottom>r+s){var te=Math.min(t.top,(R?g:t.bottom)-s);te!=r&&(d.scrollTop=te)}var le=e.options.fixedGutter?0:i.gutters.offsetWidth,Te=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-le,Se=qi(e)-i.gutters.offsetWidth,Qe=t.right-t.left>Se;return Qe&&(t.right=t.left+Se),t.left<10?d.scrollLeft=0:t.left<Te?d.scrollLeft=Math.max(0,t.left+le-(Qe?0:10)):t.right>Se+Te-3&&(d.scrollLeft=t.right+(Qe?0:10)-Se),d}function aa(e,t){if(t==null)return;Uo(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Hr(e){Uo(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function lo(e,t,i){(t!=null||i!=null)&&Uo(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Zs(e,t){Uo(e),e.curOp.scrollToPos=t}function Uo(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=xn(e,t.from),n=xn(e,t.to);ja(e,i,n,t.margin)}}function ja(e,t,i,n){var r=oa(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});lo(e,r.scrollLeft,r.scrollTop)}function uo(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;me||la(e,{top:t}),Ua(e,t,!0),me&&la(e),fo(e,100)}function Ua(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 Mr(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,za(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function co(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+Tr(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+Yi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Dr=function(e,t,i){this.cm=i;var n=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),Le(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Le(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Y&&B<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=f&&!x?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Ue,this.disableVert=new Ue},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 Kr(e,t){t||(t=co(e));var i=e.display.barWidth,n=e.display.barHeight;Ia(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&No(e),Ia(e,co(e)),i=e.display.barWidth,n=e.display.barHeight}function Ia(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 Ba={native:Dr,null:ho};function Fa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ba[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Le(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"?Mr(e,t):uo(e,t)},e),e.display.scrollbars.addClass&&de(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Nr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Qs},Wi(e.curOp)}function jr(e){var t=e.curOp;t&&Br(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;qs(i)})}function qs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var d=0;d<t.length;d++)rl(t[d])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&Zi(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 Io(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&sa(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&No(t),e.barMeasure=co(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ie(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+Yi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-qi(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function il(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Mr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==K();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Kr(t,e.barMeasure),e.updatedDisplay&&ca(t,e.barMeasure),e.selectionChanged&&ia(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Ma(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Wa(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ua(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Mr(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=Ys(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,r)}var s=e.maybeHiddenMarkers,d=e.maybeUnhiddenMarkers;if(s)for(var g=0;g<s.length;++g)s[g].lines.length||He(s[g],"hide");if(d)for(var E=0;E<d.length;++E)d[E].lines.length&&He(d[E],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&He(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Hi(e,t){if(e.curOp)return t();Nr(e);try{return t()}finally{jr(e)}}function gi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Nr(e);try{return t.apply(e,arguments)}finally{jr(e)}}}function Li(e){return function(){if(this.curOp)return e.apply(this,arguments);Nr(this);try{return e.apply(this,arguments)}finally{jr(this)}}}function yi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Nr(t);try{return e.apply(this,arguments)}finally{jr(t)}}}function fo(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,I(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=ht(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 d=s.styles,g=s.text.length>e.options.maxHighlightLength?Dt(t.mode,n.state):null,E=ce(e,s,n,!0);g&&(n.state=g),s.styles=E.styles;var R=s.styleClasses,te=E.classes;te?s.styleClasses=te:R&&(s.styleClasses=null);for(var le=!d||d.length!=s.styles.length||R!=te&&(!R||!te||R.bgClass!=te.bgClass||R.textClass!=te.textClass),Te=0;!le&&Te<d.length;++Te)le=d[Te]!=s.styles[Te];le&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&It(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&&Hi(e,function(){for(var s=0;s<r.length;s++)gr(e,r[s],"text")})}var Io=function(e,t,i){var n=e.display;this.viewport=t,this.visible=jo(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=qi(e),this.force=i,this.dims=oo(e),this.events=[]};Io.prototype.signal=function(e,t){ne(e,t)&&this.events.push(arguments)},Io.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.apply(null,this.events[e])};function al(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Yi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Yi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=K();if(!t||!U(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&U(e.display.lineDiv,n.anchorNode)&&(i.anchorNode=n.anchorNode,i.anchorOffset=n.anchorOffset,i.focusNode=n.focusNode,i.focusOffset=n.focusOffset)}return i}function ll(e){if(!e||!e.activeElt||e.activeElt==K())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&U(document.body,e.anchorNode)&&U(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 sa(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return yr(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&&Aa(e)==0)return!1;Ha(e)&&(yr(e),t.dims=oo(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),d=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>d&&i.viewTo-d<20&&(d=Math.min(r,i.viewTo)),kn&&(s=ir(e.doc,s),d=Sr(e.doc,d));var g=s!=i.viewFrom||d!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Vs(e,s,d),i.viewOffset=Gi(_t(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var E=Aa(e);if(!g&&E==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var R=sl(e);return E>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),E>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(R),re(i.cursorDiv),re(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,g&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,fo(e,400)),i.updateLineNumbers=null,!0}function Wa(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==qi(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Tr(e.display)-Ar(e),i.top)}),t.visible=jo(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=jo(e.display,e.doc,i));if(!sa(e,t))break;No(e);var r=co(e);so(e),Kr(e,r),ca(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 la(e,t){var i=new Io(e,t);if(sa(e,i)){No(e),Wa(e,i);var n=co(e);so(e),Kr(e,n),ca(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,d=s.firstChild;function g(Qe){var at=Qe.nextSibling;return N&&f&&e.display.currentWheelTarget==Qe?Qe.style.display="none":Qe.parentNode.removeChild(Qe),at}for(var E=n.view,R=n.viewFrom,te=0;te<E.length;te++){var le=E[te];if(!le.hidden)if(!le.node||le.node.parentNode!=s){var Te=Po(e,le,R,i);s.insertBefore(Te,d)}else{for(;d!=le.node;)d=g(d);var Se=r&&t!=null&&t<=R&&le.lineNumber;le.changes&&(De(le.changes,"gutter")>-1&&(Se=!1),Fr(e,le,R,i)),Se&&(re(le.lineNumber),le.lineNumber.appendChild(document.createTextNode(sn(e.options,R)))),d=le.node.nextSibling}R+=le.size}for(;d;)d=g(d)}function ua(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ca(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+Yi(e)+"px"}function za(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=ao(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",d=0;d<i.length;d++)if(!i[d].hidden){e.options.fixedGutter&&(i[d].gutter&&(i[d].gutter.style.left=s),i[d].gutterBackground&&(i[d].gutterBackground.style.left=s));var g=i[d].alignable;if(g)for(var E=0;E<g.length;E++)g[E].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function Ha(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=sn(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(S("div",[S("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,d=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-d)+1,n.lineNumWidth=n.lineNumInnerWidth+d,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",ua(e.display),!0}return!1}function da(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],d=null;if(typeof s!="string"&&(d=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:d})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Ka(e){var t=e.gutters,i=e.gutterSpecs;re(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,d=r.style,g=t.appendChild(S("div",null,"CodeMirror-gutter "+s));d&&(g.style.cssText=d),s=="CodeMirror-linenumbers"&&(e.lineGutter=g,g.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",ua(e)}function po(e){Ka(e.display),Ni(e),za(e)}function cl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=S("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=S("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=Q("div",null,"CodeMirror-code"),r.selectionDiv=S("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=S("div",null,"CodeMirror-cursors"),r.measure=S("div",null,"CodeMirror-measure"),r.lineMeasure=S("div",null,"CodeMirror-measure"),r.lineSpace=Q("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=Q("div",[r.lineSpace],"CodeMirror-lines");r.mover=S("div",[s],null,"position: relative"),r.sizer=S("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=S("div",null,null,"position: absolute; height: "+nt+"px; width: 1px;"),r.gutters=S("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=S("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=S("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),Y&&B<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!N&&!(me&&v)&&(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=da(n.gutters,n.lineNumbers),Ka(r),i.init(r)}var Bo=0,Vi=null;Y?Vi=-.53:me?Vi=15:_?Vi=-.7:O&&(Vi=-1/3);function Ga(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 dl(e){var t=Ga(e);return t.x*=Vi,t.y*=Vi,t}function Va(e,t){var i=Ga(t),n=i.x,r=i.y,s=e.display,d=s.scroller,g=d.scrollWidth>d.clientWidth,E=d.scrollHeight>d.clientHeight;if(!(n&&g||r&&E))return;if(r&&f&&N){e:for(var R=t.target,te=s.view;R!=d;R=R.parentNode)for(var le=0;le<te.length;le++)if(te[le].node==R){e.display.currentWheelTarget=R;break e}}if(n&&!me&&!C&&Vi!=null){r&&E&&uo(e,Math.max(0,d.scrollTop+r*Vi)),Mr(e,Math.max(0,d.scrollLeft+n*Vi)),(!r||r&&E)&&P(t),s.wheelStartX=null;return}if(r&&Vi!=null){var Te=r*Vi,Se=e.doc.scrollTop,Qe=Se+s.wrapper.clientHeight;Te<0?Se=Math.max(0,Se+Te-50):Qe=Math.min(e.doc.height,Qe+Te+50),la(e,{top:Se,bottom:Qe})}Bo<20&&(s.wheelStartX==null?(s.wheelStartX=d.scrollLeft,s.wheelStartY=d.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var at=d.scrollLeft-s.wheelStartX,mt=d.scrollTop-s.wheelStartY,kt=mt&&s.wheelDY&&mt/s.wheelDY||at&&s.wheelDX&&at/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!kt)return;Vi=(Vi*Bo+kt)/(Bo+1),++Bo},200)):(s.wheelDX+=n,s.wheelDY+=r))}var Xi=function(e,t){this.ranges=e,this.primIndex=t};Xi.prototype.primary=function(){return this.ranges[this.primIndex]},Xi.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(!Gt(i.anchor,n.anchor)||!Gt(i.head,n.head))return!1}return!0},Xi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Tn(qt(this.ranges[t].anchor),qt(this.ranges[t].head));return new Xi(e,this.primIndex)},Xi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Xi.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(it(t,n.from())>=0&&it(e,n.to())<=0)return i}return-1};var Tn=function(e,t){this.anchor=e,this.head=t};Tn.prototype.from=function(){return ln(this.anchor,this.head)},Tn.prototype.to=function(){return nn(this.anchor,this.head)},Tn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function er(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(Te,Se){return it(Te.from(),Se.from())}),i=De(t,r);for(var s=1;s<t.length;s++){var d=t[s],g=t[s-1],E=it(g.to(),d.from());if(n&&!d.empty()?E>0:E>=0){var R=ln(g.from(),d.from()),te=nn(g.to(),d.to()),le=g.empty()?d.from()==d.head:g.from()==g.head;s<=i&&--i,t.splice(--s,2,new Tn(le?te:R,le?R:te))}}return new Xi(t,i)}function br(e,t){return new Xi([new Tn(e,t||e)],0)}function Er(e){return e.text?Fe(e.from.line+e.text.length-1,Ce(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Xa(e,t){if(it(e,t.from)<0)return e;if(it(e,t.to)<=0)return Er(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+=Er(t).ch-t.to.ch),Fe(i,n)}function ha(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new Tn(Xa(r.anchor,t),Xa(r.head,t)))}return er(e.cm,i,e.sel.primIndex)}function $a(e,t,i){return e.line==t.line?Fe(i.line,e.ch-t.ch+i.ch):Fe(i.line+(e.line-t.line),e.ch)}function hl(e,t,i){for(var n=[],r=Fe(e.first,0),s=r,d=0;d<t.length;d++){var g=t[d],E=$a(g.from,r,s),R=$a(Er(g),r,s);if(r=g.to,s=R,i=="around"){var te=e.sel.ranges[d],le=it(te.head,te.anchor)<0;n[d]=new Tn(le?R:E,le?E:R)}else n[d]=new Tn(E,E)}return new Xi(n,e.sel.primIndex)}function fa(e){e.doc.mode=ze(e.options,e.doc.modeOption),mo(e)}function mo(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&&Ni(e)}function Ya(e,t){return t.from.ch==0&&t.to.ch==0&&Ce(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function pa(e,t,i,n){function r(Bt){return i?i[Bt]:null}function s(Bt,Rt,Ht){ur(Bt,Rt,Ht,n),ui(Bt,"change",Bt,t)}function d(Bt,Rt){for(var Ht=[],tn=Bt;tn<Rt;++tn)Ht.push(new lr(R[tn],r(tn),n));return Ht}var g=t.from,E=t.to,R=t.text,te=_t(e,g.line),le=_t(e,E.line),Te=Ce(R),Se=r(R.length-1),Qe=E.line-g.line;if(t.full)e.insert(0,d(0,R.length)),e.remove(R.length,e.size-R.length);else if(Ya(e,t)){var at=d(0,R.length-1);s(le,le.text,Se),Qe&&e.remove(g.line,Qe),at.length&&e.insert(g.line,at)}else if(te==le)if(R.length==1)s(te,te.text.slice(0,g.ch)+Te+te.text.slice(E.ch),Se);else{var mt=d(1,R.length-1);mt.push(new lr(Te+te.text.slice(E.ch),Se,n)),s(te,te.text.slice(0,g.ch)+R[0],r(0)),e.insert(g.line+1,mt)}else if(R.length==1)s(te,te.text.slice(0,g.ch)+R[0]+le.text.slice(E.ch),r(0)),e.remove(g.line+1,Qe);else{s(te,te.text.slice(0,g.ch)+R[0],r(0)),s(le,Te+le.text.slice(E.ch),Se);var kt=d(1,R.length-1);Qe>1&&e.remove(g.line+1,Qe-1),e.insert(g.line+1,kt)}ui(e,"change",e,t)}function _r(e,t,i){function n(r,s,d){if(r.linked)for(var g=0;g<r.linked.length;++g){var E=r.linked[g];if(E.doc==s)continue;var R=d&&E.sharedHist;if(i&&!R)continue;t(E.doc,R),n(E.doc,r,R)}}n(e,null,!0)}function Ja(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,na(e),fa(e),Za(e),e.options.lineWrapping||Zi(e),e.options.mode=t.modeOption,Ni(e)}function Za(e){(e.doc.direction=="rtl"?de:j)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){Hi(e,function(){Za(e),Ni(e)})}function Fo(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 ma(e,t){var i={from:qt(t.from),to:Er(t),text:an(e,t.from,t.to)};return es(e,i,t.from.line,t.to.line+1),_r(e,function(n){return es(n,i,t.from.line,t.to.line+1)},!0),i}function Qa(e){for(;e.length;){var t=Ce(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Qa(e.done),Ce(e.done);if(e.done.length&&!Ce(e.done).ranges)return Ce(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ce(e.done)}function qa(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,d,g;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)=="*"))&&(d=pl(r,r.lastOp==n)))g=Ce(d.changes),it(t.from,t.to)==0&&it(t.from,g.to)==0?g.to=Er(t):d.changes.push(ma(e,t));else{var E=Ce(r.done);for((!E||!E.ranges)&&Wo(e.sel,r.done),d={changes:[ma(e,t)],generation:r.generation},r.done.push(d);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,g||He(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 vl(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,Ce(r.done),t))?r.done[r.done.length-1]=t:Wo(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Qa(r.undone)}function Wo(e,t){var i=Ce(t);i&&i.ranges&&i.equals(e)||t.push(e)}function es(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(d){d.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=d.markedSpans),++s})}function gl(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(gl(i[r]));return n}function ts(e,t){var i=yl(e,t),n=_i(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],d=n[r];if(s&&d){e:for(var g=0;g<d.length;++g){for(var E=d[g],R=0;R<s.length;++R)if(s[R].marker==E.marker)continue e;s.push(E)}}else d&&(i[r]=d)}return i}function Gr(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?Xi.prototype.deepCopy.call(s):s);continue}var d=s.changes,g=[];n.push({changes:g});for(var E=0;E<d.length;++E){var R=d[E],te=void 0;if(g.push({from:R.from,to:R.to,text:R.text}),t)for(var le in R)(te=le.match(/^spans_(\d+)$/))&&(De(t,Number(te[1]))>-1&&(Ce(g)[le]=R[le],delete R[le]))}}return n}function va(e,t,i,n){if(n){var r=e.anchor;if(i){var s=it(t,r)<0;s!=it(i,r)<0?(r=t,t=i):s!=it(t,i)<0&&(t=i)}return new Tn(r,t)}else return new Tn(i||t,t)}function zo(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Ri(e,new Xi([va(e.sel.primary(),t,i,r)],0),n)}function ns(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]=va(e.sel.ranges[s],t[s],null,r);var d=er(e.cm,n,e.sel.primIndex);Ri(e,d,i)}function ga(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Ri(e,er(e.cm,r,e.sel.primIndex),n)}function is(e,t,i,n){Ri(e,br(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 Tn(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return He(e,"beforeSelectionChange",e,n),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?er(e.cm,n.ranges,n.ranges.length-1):t}function rs(e,t,i){var n=e.history.done,r=Ce(n);r&&r.ranges?(n[n.length-1]=t,Ho(e,t,i)):Ri(e,t,i)}function Ri(e,t,i){Ho(e,t,i),vl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Ho(e,t,i){(ne(e,"beforeSelectionChange")||e.cm&&ne(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(it(t.primary().head,e.sel.primary().head)<0?-1:1);os(e,ss(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&Hr(e.cm)}function os(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,$(e.cm)),ui(e,"cursorActivity",e)}function as(e){os(e,ss(e,e.sel,null,!1))}function ss(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var d=t.ranges[s],g=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],E=Ko(e,d.anchor,g&&g.anchor,i,n),R=Ko(e,d.head,g&&g.head,i,n);(r||E!=d.anchor||R!=d.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new Tn(E,R))}return r?er(e.cm,r,t.primIndex):t}function Vr(e,t,i,n,r){var s=_t(e,t.line);if(s.markedSpans)for(var d=0;d<s.markedSpans.length;++d){var g=s.markedSpans[d],E=g.marker,R="selectLeft"in E?!E.selectLeft:E.inclusiveLeft,te="selectRight"in E?!E.selectRight:E.inclusiveRight;if((g.from==null||(R?g.from<=t.ch:g.from<t.ch))&&(g.to==null||(te?g.to>=t.ch:g.to>t.ch))){if(r&&(He(E,"beforeCursorEnter"),E.explicitlyCleared))if(s.markedSpans){--d;continue}else break;if(!E.atomic)continue;if(i){var le=E.find(n<0?1:-1),Te=void 0;if((n<0?te:R)&&(le=ls(e,le,-n,le&&le.line==t.line?s:null)),le&&le.line==t.line&&(Te=it(le,i))&&(n<0?Te<0:Te>0))return Vr(e,le,t,n,r)}var Se=E.find(n<0?-1:1);return(n<0?R:te)&&(Se=ls(e,Se,n,Se.line==t.line?s:null)),Se?Vr(e,Se,t,n,r):null}}return t}function Ko(e,t,i,n,r){var s=n||1,d=Vr(e,t,i,s,r)||!r&&Vr(e,t,i,s,!0)||Vr(e,t,i,-s,r)||!r&&Vr(e,t,i,-s,!0);return d||(e.cantEdit=!0,Fe(e.first,0))}function ls(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,Fe(t.line-1)):null:i>0&&t.ch==(n||_t(e,t.line)).text.length?t.line<e.first+e.size-1?Fe(t.line+1,0):null:new Fe(t.line,t.ch+i)}function us(e){e.setSelection(Fe(e.firstLine(),0),Fe(e.lastLine()),Pe)}function cs(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,d,g){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),d&&(n.text=d),g!==void 0&&(n.origin=g)}),He(e,"beforeChange",e,n),e.cm&&He(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 Xr(e,t,i){if(e.cm){if(!e.cm.curOp)return gi(e.cm,Xr)(e,t,i);if(e.cm.state.suppressEdits)return}if((ne(e,"beforeChange")||e.cm&&ne(e.cm,"beforeChange"))&&(t=cs(e,t,!0),!t))return;var n=jn&&!i&&Fi(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)ds(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else ds(e,t)}function ds(e,t){if(t.text.length==1&&t.text[0]==""&&it(t.from,t.to)==0)return;var i=ha(e,t);qa(e,t,i,e.cm?e.cm.curOp.id:NaN),vo(e,t,i,_i(e,t));var n=[];_r(e,function(r,s){!s&&De(n,r.history)==-1&&(ms(r.history,t),n.push(r.history)),vo(r,t,null,_i(r,t))})}function Go(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,d=e.sel,g=t=="undo"?r.done:r.undone,E=t=="undo"?r.undone:r.done,R=0;R<g.length&&!(s=g[R],i?s.ranges&&!s.equals(e.sel):!s.ranges);R++);if(R==g.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=g.pop(),s.ranges){if(Wo(s,E),i&&!s.equals(e.sel)){Ri(e,s,{clearRedo:!1});return}d=s}else if(n){g.push(s);return}else break;var te=[];Wo(d,E),E.push({changes:te,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var le=ne(e,"beforeChange")||e.cm&&ne(e.cm,"beforeChange"),Te=function(at){var mt=s.changes[at];if(mt.origin=t,le&&!cs(e,mt,!1))return g.length=0,{};te.push(ma(e,mt));var kt=at?ha(e,mt):Ce(g);vo(e,mt,kt,ts(e,mt)),!at&&e.cm&&e.cm.scrollIntoView({from:mt.from,to:Er(mt)});var Bt=[];_r(e,function(Rt,Ht){!Ht&&De(Bt,Rt.history)==-1&&(ms(Rt.history,mt),Bt.push(Rt.history)),vo(Rt,mt,null,ts(Rt,mt))})},Se=s.changes.length-1;Se>=0;--Se){var Qe=Te(Se);if(Qe)return Qe.v}}function hs(e,t){if(t==0)return;if(e.first+=t,e.sel=new Xi(We(e.sel.ranges,function(r){return new Tn(Fe(r.anchor.line+t,r.anchor.ch),Fe(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Ni(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)gr(e.cm,n,"gutter")}}function vo(e,t,i,n){if(e.cm&&!e.cm.curOp)return gi(e.cm,vo)(e,t,i,n);if(t.to.line<e.first){hs(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);hs(e,r),t={from:Fe(e.first,0),to:Fe(t.to.line+r,t.to.ch),text:[Ce(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:Fe(s,_t(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=an(e,t.from,t.to),i||(i=ha(e,t)),e.cm?El(e.cm,t,n):pa(e,t,n),Ho(e,i,Pe),e.cantEdit&&Ko(e,Fe(e.firstLine(),0))&&(e.cantEdit=!1)}function El(e,t,i){var n=e.doc,r=e.display,s=t.from,d=t.to,g=!1,E=s.line;e.options.lineWrapping||(E=Kt(Ci(_t(n,s.line))),n.iter(E,d.line+1,function(Se){if(Se==r.maxLine)return g=!0,!0})),n.sel.contains(t.from,t.to)>-1&&$(e),pa(n,t,i,Ta(e)),e.options.lineWrapping||(n.iter(E,s.line+t.text.length,function(Se){var Qe=sr(Se);Qe>r.maxLineLength&&(r.maxLine=Se,r.maxLineLength=Qe,r.maxLineChanged=!0,g=!1)}),g&&(e.curOp.updateMaxLine=!0)),mn(n,s.line),fo(e,400);var R=t.text.length-(d.line-s.line)-1;t.full?Ni(e):s.line==d.line&&t.text.length==1&&!Ya(e.doc,t)?gr(e,s.line,"text"):Ni(e,s.line,d.line+1,R);var te=ne(e,"changes"),le=ne(e,"change");if(le||te){var Te={from:s,to:d,text:t.text,removed:t.removed,origin:t.origin};le&&ui(e,"change",e,Te),te&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Te)}e.display.selForContextMenu=null}function $r(e,t,i,n,r){var s;n||(n=i),it(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),Xr(e,{from:i,to:n,text:t,origin:r})}function fs(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ps(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],d=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var g=0;g<s.ranges.length;g++)fs(s.ranges[g].anchor,t,i,n),fs(s.ranges[g].head,t,i,n);continue}for(var E=0;E<s.changes.length;++E){var R=s.changes[E];if(i<R.from.line)R.from=Fe(R.from.line+n,R.from.ch),R.to=Fe(R.to.line+n,R.to.ch);else if(t<=R.to.line){d=!1;break}}d||(e.splice(0,r+1),r=0)}}function ms(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;ps(e.done,i,n,r),ps(e.undone,i,n,r)}function go(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=_t(e,u(e,t)):r=Kt(t),r==null?null:(n(s,r)&&e.cm&&gr(e.cm,r,i),s)}function yo(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}yo.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,no(r),ui(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 bo(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}bo.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),d=n.height;if(n.removeInner(e,s),this.height-=d-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 yo))){var g=[];this.collapse(g),this.children=[new yo(g)],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 d=r.lines.length%25+25,g=d;g<r.lines.length;){var E=new yo(r.lines.slice(g,g+=25));r.height-=E.height,this.children.splice(++n,0,E),E.parent=this}r.lines=r.lines.slice(0,d),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 bo(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 bo(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 d=Math.min(t,s-e);if(r.iterN(e,d,i))return!0;if((t-=d)==0)break;e=0}else e-=s}}};var Eo=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Eo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=Kt(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=vr(this);cn(i,Math.max(0,i.height-s)),e&&(Hi(e,function(){vs(e,i,-s),gr(e,n,"widget")}),ui(e,"lineWidgetCleared",e,this,n))},Eo.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=vr(this)-t;if(!r)return;Cn(this.doc,n)||cn(n,n.height+r),i&&Hi(i,function(){i.curOp.forceUpdate=!0,vs(i,n,r),ui(i,"lineWidgetChanged",i,e,Kt(n))})},ie(Eo);function vs(e,t,i){Gi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&aa(e,i)}function _l(e,t,i,n){var r=new Eo(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),go(e,t,"widget",function(d){var g=d.widgets||(d.widgets=[]);if(r.insertAt==null?g.push(r):g.splice(Math.min(g.length-1,Math.max(0,r.insertAt)),0,r),r.line=d,s&&!Cn(e,d)){var E=Gi(d)<e.scrollTop;cn(d,d.height+vr(r)),E&&aa(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&ui(s,"lineWidgetAdded",s,r,typeof t=="number"?t:Kt(t)),r}var gs=0,Cr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++gs};Cr.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Nr(e),ne(this,"clear")){var i=this.find();i&&ui(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var d=this.lines[s],g=ti(d.markedSpans,this);e&&!this.collapsed?gr(e,Kt(d),"text"):e&&(g.to!=null&&(r=Kt(d)),g.from!=null&&(n=Kt(d))),d.markedSpans=wi(d.markedSpans,g),g.from==null&&this.collapsed&&!Cn(this.doc,d)&&e&&cn(d,vi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var E=0;E<this.lines.length;++E){var R=Ci(this.lines[E]),te=sr(R);te>e.display.maxLineLength&&(e.display.maxLine=R,e.display.maxLineLength=te,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ni(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&as(e.doc)),e&&ui(e,"markerCleared",e,this,n,r),t&&jr(e),this.parent&&this.parent.clear()},Cr.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],d=ti(s.markedSpans,this);if(d.from!=null&&(i=Fe(t?s:Kt(s),d.from),e==-1))return i;if(d.to!=null&&(n=Fe(t?s:Kt(s),d.to),e==1))return n}return i&&{from:i,to:n}},Cr.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;Hi(n,function(){var r=t.line,s=Kt(t.line),d=Et(n,s);if(d&&(Sn(d),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Cn(i.doc,r)&&i.height!=null){var g=i.height;i.height=null;var E=vr(i)-g;E&&cn(r,r.height+E)}ui(n,"markerChanged",n,e)})},Cr.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)},Cr.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)}},ie(Cr);function Yr(e,t,i,n,r){if(n&&n.shared)return Cl(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return gi(e.cm,Yr)(e,t,i,n,r);var s=new Cr(e,r),d=it(t,i);if(n&&y(n,s,!1),d>0||d==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=Q("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Yn(e,t.line,t,i,s)||t.line!=i.line&&Yn(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ln()}s.addToHistory&&qa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var g=t.line,E=e.cm,R;if(e.iter(g,i.line+1,function(le){E&&s.collapsed&&!E.options.lineWrapping&&Ci(le)==E.display.maxLine&&(R=!0),s.collapsed&&g!=t.line&&cn(le,0),Xn(le,new Un(s,g==t.line?t.ch:null,g==i.line?i.ch:null)),++g}),s.collapsed&&e.iter(t.line,i.line+1,function(le){Cn(e,le)&&cn(le,0)}),s.clearOnEnter&&Le(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(_n(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++gs,s.atomic=!0),E){if(R&&(E.curOp.updateMaxLine=!0),s.collapsed)Ni(E,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var te=t.line;te<=i.line;te++)gr(E,te,"text");s.atomic&&as(E.doc),ui(E,"markerAdded",E,s)}return s}var _o=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};_o.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ui(this,"clear")},_o.prototype.find=function(e,t){return this.primary.find(e,t)},ie(_o);function Cl(e,t,i,n,r){n=y(n),n.shared=!1;var s=[Yr(e,t,i,n,r)],d=s[0],g=n.widgetNode;return _r(e,function(E){g&&(n.widgetNode=g.cloneNode(!0)),s.push(Yr(E,o(E,t),o(E,i),n,r));for(var R=0;R<E.linked.length;++R)if(E.linked[R].isParent)return;d=Ce(s)}),new _o(s,d)}function ys(e){return e.findMarks(Fe(e.first,0),e.clipPos(Fe(e.lastLine())),function(t){return t.parent})}function xl(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),d=e.clipPos(r.to);if(it(s,d)){var g=Yr(e,s,d,n.primary,n.primary.type);n.markers.push(g),g.parent=n}}}function wl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];_r(r.primary.doc,function(E){return s.push(E)});for(var d=0;d<r.markers.length;d++){var g=r.markers[d];De(s,g.doc)==-1&&(g.parent=null,r.markers.splice(d--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,ji=function(e,t,i,n,r){if(!(this instanceof ji))return new ji(e,t,i,n,r);i==null&&(i=0),bo.call(this,[new yo([new lr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=Fe(i,0);this.sel=br(s),this.history=new Fo(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),pa(this,{from:s,to:s,text:e}),Ri(this,br(s),Pe)};ji.prototype=H(bo.prototype,{constructor:ji,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=jt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:yi(function(e){var t=Fe(this.first,0),i=this.first+this.size-1;Xr(this,{from:t,to:Fe(i,_t(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&lo(this.cm,0,0),Ri(this,br(t),Pe)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,$r(this,e,t,i,n)},getRange:function(e,t,i){var n=an(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(Nn(this,e))return _t(this,e)},getLineNumber:function(e){return Kt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=_t(this,e)),Ci(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:yi(function(e,t,i){is(this,o(this,typeof e=="number"?Fe(e,t||0):e),null,i)}),setSelection:yi(function(e,t,i){is(this,o(this,e),o(this,t||e),i)}),extendSelection:yi(function(e,t,i){zo(this,o(this,e),t&&o(this,t),i)}),extendSelections:yi(function(e,t){ns(this,c(this,e),t)}),extendSelectionsBy:yi(function(e,t){var i=We(this.sel.ranges,e);ns(this,c(this,i),t)}),setSelections:yi(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new Tn(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ri(this,er(this.cm,n,t),i)}),addSelection:yi(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new Tn(o(this,e),o(this,t||e))),Ri(this,er(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=an(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=an(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:yi(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var d=r.ranges[s];n[s]={from:d.from(),to:d.to(),text:this.splitLines(e[s]),origin:i}}for(var g=t&&t!="end"&&hl(this,n,t),E=n.length-1;E>=0;E--)Xr(this,n[E]);g?rs(this,g):this.cm&&Hr(this.cm)}),undo:yi(function(){Go(this,"undo")}),redo:yi(function(){Go(this,"redo")}),undoSelection:yi(function(){Go(this,"undo",!0)}),redoSelection:yi(function(){Go(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 Fo(this.history.maxGeneration),_r(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:Gr(this.history.done),undone:Gr(this.history.undone)}},setHistory:function(e){var t=this.history=new Fo(this.history.maxGeneration);t.done=Gr(e.done.slice(0),null,!0),t.undone=Gr(e.undone.slice(0),null,!0)},setGutterMarker:yi(function(e,t,i){return go(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&Me(r)&&(n.gutterMarkers=null),!0})}),clearGutter:yi(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&go(t,i,"gutter",function(){return i.gutterMarkers[e]=null,Me(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Nn(this,e))return null;if(t=e,e=_t(this,e),!e)return null}else if(t=Kt(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:yi(function(e,t,i){return go(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(se(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:yi(function(e,t,i){return go(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 d=s.match(se(i));if(!d)return!1;var g=d.index+d[0].length;n[r]=s.slice(0,d.index)+(!d.index||g==s.length?"":" ")+s.slice(g)||null}else return!1;return!0})}),addLineWidget:yi(function(e,t,i){return _l(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Yr(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),Yr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=_t(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 d=s.markedSpans;if(d)for(var g=0;g<d.length;g++){var E=d[g];!(E.to!=null&&r==e.line&&e.ch>=E.to||E.from==null&&r!=e.line||E.from!=null&&r==t.line&&E.from>=t.ch)&&(!i||i(E.marker))&&n.push(E.marker.parent||E.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,Fe(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 ji(jt(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 ji(jt(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}],xl(n,ys(this)),n},unlinkDoc:function(e){if(e instanceof Vn&&(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),wl(ys(this));break}if(e.history==this.history){var n=[e.id];_r(e,function(r){return n.push(r.id)},!0),e.history=new Fo(null),e.history.done=Gr(this.history.done,n),e.history.undone=Gr(this.history.undone,n)}},iterLinkedDocs:function(e){_r(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ut(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:yi(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)})}),ji.prototype.eachLine=ji.prototype.iter;var bs=0;function kl(e){var t=this;if(Es(t),Xe(t,e)||Qi(t.display,e))return;P(e),Y&&(bs=+new Date);var i=Pr(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),d=0,g=function(){++d==r&&gi(t,function(){i=o(t.doc,i);var Se={from:i,to:i,text:t.doc.splitLines(s.filter(function(Qe){return Qe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Xr(t.doc,Se),rs(t.doc,br(o(t.doc,i),o(t.doc,Er(Se))))})()},E=function(Se,Qe){if(t.options.allowDropFileTypes&&De(t.options.allowDropFileTypes,Se.type)==-1){g();return}var at=new FileReader;at.onerror=function(){return g()},at.onload=function(){var mt=at.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(mt)){g();return}s[Qe]=mt,g()},at.readAsText(Se)},R=0;R<n.length;R++)E(n[R],R);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 te=e.dataTransfer.getData("Text");if(te){var le;if(t.state.draggingText&&!t.state.draggingText.copy&&(le=t.listSelections()),Ho(t.doc,br(i,i)),le)for(var Te=0;Te<le.length;++Te)$r(t.doc,"",le[Te].anchor,le[Te].head,"drag");t.replaceSelection(te,"around","paste"),t.display.input.focus()}}catch(Se){}}}function Rl(e,t){if(Y&&(!e.state.draggingText||+new Date-bs<100)){V(t);return}if(Xe(e,t)||Qi(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!O){var i=S("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",C&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),C&&i.parentNode.removeChild(i)}}function Ol(e,t){var i=Pr(e,t);if(!i)return;var n=document.createDocumentFragment();La(e,i,n),e.display.dragCursor||(e.display.dragCursor=S("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),k(e.display.dragCursor,n)}function Es(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function _s(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 Cs=!1;function Tl(){if(Cs)return;Al(),Cs=!0}function Al(){var e;Le(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,_s(Pl)},100))}),Le(window,"blur",function(){return _s(zr)})}function Pl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var xr={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"},Co=0;Co<10;Co++)xr[Co+48]=xr[Co+96]=String(Co);for(var Vo=65;Vo<=90;Vo++)xr[Vo]=String.fromCharCode(Vo);for(var xo=1;xo<=12;xo++)xr[xo+111]=xr[xo+63235]="F"+xo;var dr={};dr.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"},dr.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"},dr.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"},dr.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"]},dr.default=f?dr.macDefault:dr.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,d=0;d<t.length-1;d++){var g=t[d];if(/^(cmd|meta|m)$/i.test(g))s=!0;else if(/^a(lt)?$/i.test(g))i=!0;else if(/^(c|ctrl|control)$/i.test(g))n=!0;else if(/^s(hift)?$/i.test(g))r=!0;else throw new Error("Unrecognized modifier name: "+g)}return i&&(e="Alt-"+e),n&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ml(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=We(i.split(" "),Ll),s=0;s<r.length;s++){var d=void 0,g=void 0;s==r.length-1?(g=r.join(" "),d=n):(g=r.slice(0,s+1).join(" "),d="...");var E=t[g];if(!E)t[g]=d;else if(E!=d)throw new Error("Inconsistent bindings for "+g)}delete e[i]}for(var R in t)e[R]=t[R];return e}function Jr(e,t,i,n){t=Xo(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 Jr(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var d=Jr(e,t.fallthrough[s],i,n);if(d)return d}}}function xs(e){var t=typeof e=="string"?e:xr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ws(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(F?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(F?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Ss(e,t){if(C&&e.keyCode==34&&e.char)return!1;var i=xr[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),ws(i,e,t))}function Xo(e){return typeof e=="string"?dr[e]:e}function Zr(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&it(s.from,Ce(n).to)<=0;){var d=n.pop();if(it(d.from,s.from)<0){s.from=d.from;break}}n.push(s)}Hi(e,function(){for(var g=n.length-1;g>=0;g--)$r(e.doc,"",n[g].from,n[g].to,"+delete");Hr(e)})}function ya(e,t,i){var n=Ke(e.text,t+i,i);return n<0||n>e.text.length?null:n}function ba(e,t,i){var n=ya(e,t.ch,i);return n==null?null:new Fe(t.line,n,i<0?"after":"before")}function Ea(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=xt(i,t.doc.direction);if(s){var d=r<0?Ce(s):s[0],g=r<0==(d.level==1),E=g?"after":"before",R;if(d.level>0||t.doc.direction=="rtl"){var te=vt(t,i);R=r<0?i.text.length-1:0;var le=Ct(t,te,R).top;R=yt(function(Te){return Ct(t,te,Te).top==le},r<0==(d.level==1)?d.from:d.to-1,R),E=="before"&&(R=ya(i,R,1))}else R=r<0?d.to:d.from;return new Fe(n,R,E)}}return new Fe(n,r<0?i.text.length:0,r<0?"before":"after")}function Dl(e,t,i,n){var r=xt(t,e.doc.direction);if(!r)return ba(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=st(r,i.ch,i.sticky),d=r[s];if(e.doc.direction=="ltr"&&d.level%2==0&&(n>0?d.to>i.ch:d.from<i.ch))return ba(t,i,n);var g=function(kt,Bt){return ya(t,kt instanceof Fe?kt.ch:kt,Bt)},E,R=function(kt){return e.options.lineWrapping?(E=E||vt(e,t),Ai(e,t,E,kt)):{begin:0,end:t.text.length}},te=R(i.sticky=="before"?g(i,-1):i.ch);if(e.doc.direction=="rtl"||d.level==1){var le=d.level==1==n<0,Te=g(i,le?1:-1);if(Te!=null&&(le?Te<=d.to&&Te<=te.end:Te>=d.from&&Te>=te.begin)){var Se=le?"before":"after";return new Fe(i.line,Te,Se)}}var Qe=function(kt,Bt,Rt){for(var Ht=function(Bn,bi){return bi?new Fe(i.line,g(Bn,1),"before"):new Fe(i.line,Bn,"after")};kt>=0&&kt<r.length;kt+=Bt){var tn=r[kt],Qt=Bt>0==(tn.level!=1),pn=Qt?Rt.begin:g(Rt.end,-1);if(tn.from<=pn&&pn<tn.to)return Ht(pn,Qt);if(pn=Qt?tn.from:g(tn.to,-1),Rt.begin<=pn&&pn<Rt.end)return Ht(pn,Qt)}},at=Qe(s+n,n,te);if(at)return at;var mt=n>0?te.end:g(te.begin,-1);return mt!=null&&!(n>0&&mt==t.text.length)&&(at=Qe(n>0?0:r.length-1,n,R(mt)),at)?at:null}var wo={selectAll:us,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Pe)},killLine:function(e){return Zr(e,function(t){if(t.empty()){var i=_t(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Fe(t.head.line+1,0)}:{from:t.head,to:Fe(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Zr(e,function(t){return{from:Fe(t.from().line,0),to:o(e.doc,Fe(t.to().line+1,0))}})},delLineLeft:function(e){return Zr(e,function(t){return{from:Fe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Zr(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 Zr(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(Fe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Fe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return ks(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Rs(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")},Z)},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")},Z)},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/)?Rs(e,t.head):n},Z)},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(),d=pe(e.getLine(s.line),s.ch,n);t.push(T(n-d%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Hi(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=_t(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new Fe(r.line,r.ch-1)),r.ch>0)r=new Fe(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),Fe(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var d=_t(e.doc,r.line-1).text;d&&(r=new Fe(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+d.charAt(d.length-1),Fe(r.line-1,d.length-1),r,"+transpose"))}}i.push(new Tn(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return Hi(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);Hr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ks(e,t){var i=_t(e.doc,t),n=Ci(i);return n!=i&&(t=Kt(n)),Ea(!0,e,n,t,1)}function Nl(e,t){var i=_t(e.doc,t),n=pr(i);return n!=i&&(t=Kt(n)),Ea(!0,e,i,t,-1)}function Rs(e,t){var i=ks(e,t.line),n=_t(e.doc,i.line),r=xt(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),d=t.line==i.line&&t.ch<=s&&t.ch;return Fe(i.line,d?0:s,i.sticky)}return i}function $o(e,t,i){if(typeof t=="string"&&(t=wo[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)!=Ne}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=Jr(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&Jr(t,e.options.extraKeys,i,e)||Jr(t,e.options.keyMap,i,e)}var Ul=new Ue;function So(e,t,i,n){var r=e.state.keySeq;if(r){if(xs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ul.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),Os(e,r+" "+t,i,n))return!0}return Os(e,t,i,n)}function Os(e,t,i,n){var r=jl(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&ui(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(P(i),ia(e)),!!r}function Ts(e,t){var i=Ss(t,!0);return i?t.shiftKey&&!e.state.keySeq?So(e,"Shift-"+i,t,function(n){return $o(e,n,!0)})||So(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return $o(e,n)}):So(e,i,t,function(n){return $o(e,n)}):!1}function Il(e,t,i){return So(e,"'"+i+"'",t,function(n){return $o(e,n,!0)})}var _a=null;function As(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=K(),Xe(t,e))return;Y&&B<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=Ts(t,e);C&&(_a=n?i:null,!n&&i==88&&!$t&&(f?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),me&&!f&&!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;de(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(j(t,"CodeMirror-crosshair"),At(document,"keyup",i),At(document,"mouseover",i))}Le(document,"keyup",i),Le(document,"mouseover",i)}function Ps(e){e.keyCode==16&&(this.doc.sel.shift=!1),Xe(this,e)}function Ls(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Qi(t.display,e)||Xe(t,e)||e.ctrlKey&&!e.altKey||f&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(C&&i==_a){_a=null,P(e);return}if(C&&(!e.which||e.which<10)&&Ts(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Il(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,Ca=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ca.prototype.compare=function(e,t,i){return this.time+Fl>e&&it(t,this.pos)==0&&i==this.button};var ko,Ro;function Wl(e,t){var i=+new Date;return Ro&&Ro.compare(i,e,t)?(ko=Ro=null,"triple"):ko&&ko.compare(i,e,t)?(Ro=new Ca(i,e,t),ko=null,"double"):(ko=new Ca(i,e,t),Ro=null,"single")}function Ms(e){var t=this,i=t.display;if(Xe(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Qi(i,e)){N||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(xa(t,e))return;var n=Pr(t,e),r=ve(e),s=n?Wl(n,r):"single";if(window.focus(),r==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,r,n,s,e))return;r==1?n?Kl(t,n,s,e):xe(e)==i.scroller&&P(e):r==2?(n&&zo(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(b?t.display.input.onContextMenu(e):Da(t))}function zl(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,So(e,ws(s,r),r,function(d){if(typeof d=="string"&&(d=wo[d]),!d)return!1;var g=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),g=d(e,i)!=Ne}finally{e.state.suppressEdits=!1}return g})}function Hl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=L?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=f?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(f?i.altKey:i.ctrlKey)),r}function Kl(e,t,i,n){Y?setTimeout(I(Ma,e),0):e.curOp.focus=K();var r=Hl(e,i,n),s=e.doc.sel,d;e.options.dragDrop&&Oe&&!e.isReadOnly()&&i=="single"&&(d=s.contains(t))>-1&&(it((d=s.ranges[d]).from(),t)<0||t.xRel>0)&&(it(d.to(),t)>0||t.xRel<0)?Gl(e,n,t,r):Vl(e,n,t,r)}function Gl(e,t,i,n){var r=e.display,s=!1,d=gi(e,function(R){N&&(r.scroller.draggable=!1),e.state.draggingText=!1,At(r.wrapper.ownerDocument,"mouseup",d),At(r.wrapper.ownerDocument,"mousemove",g),At(r.scroller,"dragstart",E),At(r.scroller,"drop",d),s||(P(R),n.addNew||zo(e.doc,i,null,null,n.extend),N&&!O||Y&&B==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),g=function(R){s=s||Math.abs(t.clientX-R.clientX)+Math.abs(t.clientY-R.clientY)>=10},E=function(){return s=!0};N&&(r.scroller.draggable=!0),e.state.draggingText=d,d.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),Le(r.wrapper.ownerDocument,"mouseup",d),Le(r.wrapper.ownerDocument,"mousemove",g),Le(r.scroller,"dragstart",E),Le(r.scroller,"drop",d),Da(e),setTimeout(function(){return r.input.focus()},20)}function Ds(e,t,i){if(i=="char")return new Tn(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Tn(Fe(t.line,0),o(e.doc,Fe(t.line+1,0)));var n=i(e,t);return new Tn(n.from,n.to)}function Vl(e,t,i,n){var r=e.display,s=e.doc;P(t);var d,g,E=s.sel,R=E.ranges;if(n.addNew&&!n.extend?(g=s.sel.contains(i),g>-1?d=R[g]:d=new Tn(i,i)):(d=s.sel.primary(),g=s.sel.primIndex),n.unit=="rectangle")n.addNew||(d=new Tn(i,i)),i=Pr(e,t,!0,!0),g=-1;else{var te=Ds(e,i,n.unit);n.extend?d=va(d,te.anchor,te.head,n.extend):d=te}n.addNew?g==-1?(g=R.length,Ri(s,er(e,R.concat([d]),g),{scroll:!1,origin:"*mouse"})):R.length>1&&R[g].empty()&&n.unit=="char"&&!n.extend?(Ri(s,er(e,R.slice(0,g).concat(R.slice(g+1)),0),{scroll:!1,origin:"*mouse"}),E=s.sel):ga(s,g,d,ae):(g=0,Ri(s,new Xi([d],0),ae),E=s.sel);var le=i;function Te(Rt){if(it(le,Rt)==0)return;if(le=Rt,n.unit=="rectangle"){for(var Ht=[],tn=e.options.tabSize,Qt=pe(_t(s,i.line).text,i.ch,tn),pn=pe(_t(s,Rt.line).text,Rt.ch,tn),Bn=Math.min(Qt,pn),bi=Math.max(Qt,pn),Qn=Math.min(i.line,Rt.line),Ki=Math.min(e.lastLine(),Math.max(i.line,Rt.line));Qn<=Ki;Qn++){var Ui=_t(s,Qn).text,ai=ye(Ui,Bn,tn);Bn==bi?Ht.push(new Tn(Fe(Qn,ai),Fe(Qn,ai))):Ui.length>ai&&Ht.push(new Tn(Fe(Qn,ai),Fe(Qn,ye(Ui,bi,tn))))}Ht.length||Ht.push(new Tn(i,i)),Ri(s,er(e,E.ranges.slice(0,g).concat(Ht),g),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Rt)}else{var Ii=d,xi=Ds(e,Rt,n.unit),ci=Ii.anchor,si;it(xi.anchor,ci)>0?(si=xi.head,ci=ln(Ii.from(),xi.anchor)):(si=xi.anchor,ci=nn(Ii.to(),xi.head));var ei=E.ranges.slice(0);ei[g]=Xl(e,new Tn(o(s,ci),si)),Ri(s,er(e,ei,g),ae)}}var Se=r.wrapper.getBoundingClientRect(),Qe=0;function at(Rt){var Ht=++Qe,tn=Pr(e,Rt,!0,n.unit=="rectangle");if(!tn)return;if(it(tn,le)!=0){e.curOp.focus=K(),Te(tn);var Qt=jo(r,s);(tn.line>=Qt.to||tn.line<Qt.from)&&setTimeout(gi(e,function(){Qe==Ht&&at(Rt)}),150)}else{var pn=Rt.clientY<Se.top?-20:Rt.clientY>Se.bottom?20:0;pn&&setTimeout(gi(e,function(){if(Qe!=Ht)return;r.scroller.scrollTop+=pn,at(Rt)}),50)}}function mt(Rt){e.state.selectingText=!1,Qe=Infinity,Rt&&(P(Rt),r.input.focus()),At(r.wrapper.ownerDocument,"mousemove",kt),At(r.wrapper.ownerDocument,"mouseup",Bt),s.history.lastSelOrigin=null}var kt=gi(e,function(Rt){Rt.buttons===0||!ve(Rt)?mt(Rt):at(Rt)}),Bt=gi(e,mt);e.state.selectingText=Bt,Le(r.wrapper.ownerDocument,"mousemove",kt),Le(r.wrapper.ownerDocument,"mouseup",Bt)}function Xl(e,t){var i=t.anchor,n=t.head,r=_t(e.doc,i.line);if(it(i,n)==0&&i.sticky==n.sticky)return t;var s=xt(r);if(!s)return t;var d=st(s,i.ch,i.sticky),g=s[d];if(g.from!=i.ch&&g.to!=i.ch)return t;var E=d+(g.from==i.ch==(g.level!=1)?0:1);if(E==0||E==s.length)return t;var R;if(n.line!=i.line)R=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var te=st(s,n.ch,n.sticky),le=te-d||(n.ch-i.ch)*(g.level==1?-1:1);te==E-1||te==E?R=le<0:R=le>0}var Te=s[E+(R?-1:0)],Se=R==(Te.level==1),Qe=Se?Te.from:Te.to,at=Se?"after":"before";return i.ch==Qe&&i.sticky==at?t:new Tn(new Fe(i.line,Qe,at),n)}function Ns(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(Te){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&P(t);var d=e.display,g=d.lineDiv.getBoundingClientRect();if(s>g.bottom||!ne(e,i))return X(t);s-=g.top-d.viewOffset;for(var E=0;E<e.display.gutterSpecs.length;++E){var R=d.gutters.childNodes[E];if(R&&R.getBoundingClientRect().right>=r){var te=dn(e.doc,s),le=e.display.gutterSpecs[E];return He(e,i,e,te,le.className,t),X(t)}}}function xa(e,t){return Ns(e,t,"gutterClick",!0)}function js(e,t){if(Qi(e.display,t)||$l(e,t))return;if(Xe(e,t,"contextmenu"))return;b||e.display.input.onContextMenu(t)}function $l(e,t){return ne(e,"gutterContextMenu")?Ns(e,t,"gutterContextMenu",!1):!1}function Us(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(e)}var Qr={toString:function(){return"CodeMirror.Init"}},Is={},Yo={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,d){e.defaults[n]=r,s&&(t[n]=d?function(g,E,R){R!=Qr&&s(g,E,R)}:s)}e.defineOption=i,e.Init=Qr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,fa(n)},!0),i("indentUnit",2,fa,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){mo(n),Fn(n),Ni(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],d=n.doc.first;n.doc.iter(function(E){for(var R=0;;){var te=E.text.indexOf(r,R);if(te==-1)break;R=te+r.length,s.push(Fe(d,te))}d++});for(var g=s.length-1;g>=0;g--)$r(n.doc,r,s[g],Fe(s[g].line,s[g].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!=Qr&&n.refresh()}),i("specialCharPlaceholder",bn,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",v?"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",!ee),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){Us(n),po(n)},!0),i("keyMap","default",function(n,r,s){var d=Xo(r),g=s!=Qr&&Xo(s);g&&g.detach&&g.detach(n,d),d.attach&&d.attach(n,g||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Zl,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=da(r,n.options.lineNumbers),po(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?ao(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return Kr(n)},!0),i("scrollbarStyle","native",function(n){Fa(n),Kr(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=da(n.options.gutters,r),po(n)},!0),i("firstLineNumber",1,po,!0),i("lineNumberFormatter",function(n){return n},po,!0),i("showCursorWhenSelecting",!1,so,!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,so,!0),i("singleCursorHeightPerLine",!0,so,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,mo,!0),i("addModeClass",!1,mo,!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,mo,!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!=Qr;if(!t!=!n){var r=e.display.dragFunctions,s=t?Le:At;s(e.display.scroller,"dragstart",r.start),s(e.display.scroller,"dragenter",r.enter),s(e.display.scroller,"dragover",r.over),s(e.display.scroller,"dragleave",r.leave),s(e.display.scroller,"drop",r.drop)}}function Zl(e){e.options.lineWrapping?(de(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(j(e.display.wrapper,"CodeMirror-wrap"),Zi(e)),na(e),Ni(e),Fn(e),setTimeout(function(){return Kr(e)},100)}function Vn(e,t){var i=this;if(!(this instanceof Vn))return new Vn(e,t);this.options=t=t?y(t):{},y(Is,t,!1);var n=t.value;typeof n=="string"?n=new ji(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new Vn.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,r,t);s.wrapper.CodeMirror=this,Us(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Fa(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 Ue,keySeq:null,specialChars:null},t.autofocus&&!v&&s.input.focus(),Y&&B<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Tl(),Nr(this),this.curOp.forceUpdate=!0,Ja(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ra(i)},20):zr(this);for(var d in Yo)Yo.hasOwnProperty(d)&&Yo[d](this,t[d],Qr);Ha(this),t.finishInit&&t.finishInit(this);for(var g=0;g<wa.length;++g)wa[g](this);jr(this),N&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}Vn.defaults=Is,Vn.optionHandlers=Yo;function Ql(e){var t=e.display;Le(t.scroller,"mousedown",gi(e,Ms)),Y&&B<11?Le(t.scroller,"dblclick",gi(e,function(E){if(Xe(e,E))return;var R=Pr(e,E);if(!R||xa(e,E)||Qi(e.display,E))return;P(E);var te=e.findWordAt(R);zo(e.doc,te.anchor,te.head)})):Le(t.scroller,"dblclick",function(E){return Xe(e,E)||P(E)}),Le(t.scroller,"contextmenu",function(E){return js(e,E)}),Le(t.input.getField(),"contextmenu",function(E){t.scroller.contains(E.target)||js(e,E)});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(E){if(E.touches.length!=1)return!1;var R=E.touches[0];return R.radiusX<=1&&R.radiusY<=1}function d(E,R){if(R.left==null)return!0;var te=R.left-E.left,le=R.top-E.top;return te*te+le*le>20*20}Le(t.scroller,"touchstart",function(E){if(!Xe(e,E)&&!s(E)&&!xa(e,E)){t.input.ensurePolled(),clearTimeout(i);var R=+new Date;t.activeTouch={start:R,moved:!1,prev:R-n.end<=300?n:null},E.touches.length==1&&(t.activeTouch.left=E.touches[0].pageX,t.activeTouch.top=E.touches[0].pageY)}}),Le(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Le(t.scroller,"touchend",function(E){var R=t.activeTouch;if(R&&!Qi(t,E)&&R.left!=null&&!R.moved&&new Date-R.start<300){var te=e.coordsChar(t.activeTouch,"page"),le;!R.prev||d(R,R.prev)?le=new Tn(te,te):!R.prev.prev||d(R,R.prev.prev)?le=e.findWordAt(te):le=new Tn(Fe(te.line,0),o(e.doc,Fe(te.line+1,0))),e.setSelection(le.anchor,le.head),e.focus(),P(E)}r()}),Le(t.scroller,"touchcancel",r),Le(t.scroller,"scroll",function(){t.scroller.clientHeight&&(uo(e,t.scroller.scrollTop),Mr(e,t.scroller.scrollLeft,!0),He(e,"scroll",e))}),Le(t.scroller,"mousewheel",function(E){return Va(e,E)}),Le(t.scroller,"DOMMouseScroll",function(E){return Va(e,E)}),Le(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(E){Xe(e,E)||V(E)},over:function(E){Xe(e,E)||(Ol(e,E),V(E))},start:function(E){return Rl(e,E)},drop:gi(e,kl),leave:function(E){Xe(e,E)||Es(e)}};var g=t.input.getField();Le(g,"keyup",function(E){return Ps.call(e,E)}),Le(g,"keydown",gi(e,As)),Le(g,"keypress",gi(e,Ls)),Le(g,"focus",function(E){return ra(e,E)}),Le(g,"blur",function(E){return zr(e,E)})}var wa=[];Vn.defineInitHook=function(e){return wa.push(e)};function Oo(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=ht(e,t).state:i="prev");var d=e.options.tabSize,g=_t(r,t),E=pe(g.text,null,d);g.stateAfter&&(g.stateAfter=null);var R=g.text.match(/^\s*/)[0],te;if(!n&&!/\S/.test(g.text))te=0,i="not";else if(i=="smart"&&(te=r.mode.indent(s,g.text.slice(R.length),g.text),te==Ne||te>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?te=pe(_t(r,t-1).text,null,d):te=0:i=="add"?te=E+e.options.indentUnit:i=="subtract"?te=E-e.options.indentUnit:typeof i=="number"&&(te=E+i),te=Math.max(0,te);var le="",Te=0;if(e.options.indentWithTabs)for(var Se=Math.floor(te/d);Se;--Se)Te+=d,le+=" ";if(Te<te&&(le+=T(te-Te)),le!=R)return $r(r,le,Fe(t,0),Fe(t,R.length),"+input"),g.stateAfter=null,!0;for(var Qe=0;Qe<r.sel.ranges.length;Qe++){var at=r.sel.ranges[Qe];if(at.head.line==t&&at.head.ch<R.length){var mt=Fe(t,R.length);ga(r,Qe,new Tn(mt,mt));break}}}var tr=null;function Jo(e){tr=e}function Sa(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var d=+new Date-200,g=r=="paste"||e.state.pasteIncoming>d,E=Ut(t),R=null;if(g&&n.ranges.length>1)if(tr&&tr.text.join(`
`)==t){if(n.ranges.length%tr.text.length==0){R=[];for(var te=0;te<tr.text.length;te++)R.push(s.splitLines(tr.text[te]))}}else E.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(R=We(E,function(kt){return[kt]}));for(var le=e.curOp.updateInput,Te=n.ranges.length-1;Te>=0;Te--){var Se=n.ranges[Te],Qe=Se.from(),at=Se.to();Se.empty()&&(i&&i>0?Qe=Fe(Qe.line,Qe.ch-i):e.state.overwrite&&!g?at=Fe(at.line,Math.min(_t(s,at.line).text.length,at.ch+Ce(E).length)):g&&tr&&tr.lineWise&&tr.text.join(`
`)==E.join(`
`)&&(Qe=at=Fe(Qe.line,0)));var mt={from:Qe,to:at,text:R?R[Te%R.length]:E,origin:r||(g?"paste":e.state.cutIncoming>d?"cut":"+input")};Xr(e.doc,mt),ui(e,"inputRead",e,mt)}t&&!g&&Fs(e,t),Hr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=le),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Bs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Hi(t,function(){return Sa(t,i,0,null,"paste")}),!0}function Fs(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),d=!1;if(s.electricChars){for(var g=0;g<s.electricChars.length;g++)if(t.indexOf(s.electricChars.charAt(g))>-1){d=Oo(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(_t(e.doc,r.head.line).text.slice(0,r.head.ch))&&(d=Oo(e,r.head.line,"smart")));d&&ui(e,"electricInput",e,r.head.line)}}function Ws(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:Fe(r,0),head:Fe(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function zs(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Hs(){var e=S("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=S("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return N?e.style.width="1000px":e.setAttribute("wrap","off"),M&&(e.style.border="1px solid black"),zs(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,d=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&gi(this,t[n])(this,r,d),He(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"](Xo(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:Li(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");Ze(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(d){return d.priority}),this.state.modeGen++,Ni(this)}),removeOverlay:Li(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var d=r[s].modeSpec;if(d==n||typeof n=="string"&&d.name==n){r.splice(s,1),this.state.modeGen++,Ni(this);return}}}),indentLine:Li(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),Nn(this.doc,n)&&Oo(this,n,r,s)}),indentSelection:Li(function(n){for(var r=this.doc.sel.ranges,s=-1,d=0;d<r.length;d++){var g=r[d];if(g.empty())g.head.line>s&&(Oo(this,g.head.line,n,!0),s=g.head.line,d==this.doc.sel.primIndex&&Hr(this));else{var E=g.from(),R=g.to(),te=Math.max(s,E.line);s=Math.min(this.lastLine(),R.line-(R.ch?0:1))+1;for(var le=te;le<s;++le)Oo(this,le,n);var Te=this.doc.sel.ranges;E.ch==0&&r.length==Te.length&&Te[d].from().ch>0&&ga(this.doc,d,new Tn(E,Te[d].to()),Pe)}}}),getTokenAt:function(n,r){return Lt(this,n,r)},getLineTokens:function(n,r){return Lt(this,Fe(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=tt(this,_t(this.doc,n.line)),s=0,d=(r.length-1)/2,g=n.ch,E;if(g==0)E=r[2];else for(;;){var R=s+d>>1;if((R?r[R*2-1]:0)>=g)d=R;else if(r[R*2+1]<g)s=R+1;else{E=r[R*2+2];break}}var te=E?E.indexOf("overlay "):-1;return te<0?E:te==0?null:E.slice(0,te-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 d=i[r],g=this.getModeAt(n);if(typeof g[r]=="string")d[g[r]]&&s.push(d[g[r]]);else if(g[r])for(var E=0;E<g[r].length;E++){var R=d[g[r][E]];R&&s.push(R)}else g.helperType&&d[g.helperType]?s.push(d[g.helperType]):d[g.name]&&s.push(d[g.name]);for(var te=0;te<d._global.length;te++){var le=d._global[te];le.pred(g,this)&&De(s,le.val)==-1&&s.push(le.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=u(s,n==null?s.first+s.size-1:n),ht(this,n+1,r).state},cursorCoords:function(n,r){var s,d=this.doc.sel.primary();return n==null?s=d.head:typeof n=="object"?s=o(this.doc,n):s=n?d.from():d.to(),on(this,s,r||"page")},charCoords:function(n,r){return Ti(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=fi(this,n,r||"page"),pi(this,n.left,n.top)},lineAtHeight:function(n,r){return n=fi(this,{top:n,left:0},r||"page").top,dn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var d=!1,g;if(typeof n=="number"){var E=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>E&&(n=E,d=!0),g=_t(this.doc,n)}else g=n;return qn(this,g,{top:0,left:0},r||"page",s||d).top+(d?this.doc.height-Gi(g):0)},defaultTextHeight:function(){return vi(this.display)},defaultCharWidth:function(){return Di(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,d,g){var E=this.display;n=on(this,o(this.doc,n));var R=n.bottom,te=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),E.sizer.appendChild(r),d=="over")R=n.top;else if(d=="above"||d=="near"){var le=Math.max(E.wrapper.clientHeight,this.doc.height),Te=Math.max(E.sizer.clientWidth,E.lineSpace.clientWidth);(d=="above"||n.bottom+r.offsetHeight>le)&&n.top>r.offsetHeight?R=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=le&&(R=n.bottom),te+r.offsetWidth>Te&&(te=Te-r.offsetWidth)}r.style.top=R+"px",r.style.left=r.style.right="",g=="right"?(te=E.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(g=="left"?te=0:g=="middle"&&(te=(E.sizer.clientWidth-r.offsetWidth)/2),r.style.left=te+"px"),s&&Js(this,{left:te,top:R,right:te+r.offsetWidth,bottom:R+r.offsetHeight})},triggerOnKeyDown:Li(As),triggerOnKeyPress:Li(Ls),triggerOnKeyUp:Ps,triggerOnMouseDown:Li(Ms),execCommand:function(n){if(wo.hasOwnProperty(n))return wo[n].call(null,this)},triggerElectric:Li(function(n){Fs(this,n)}),findPosH:function(n,r,s,d){var g=1;r<0&&(g=-1,r=-r);for(var E=o(this.doc,n),R=0;R<r&&!(E=ka(this.doc,E,g,s,d),E.hitSide);++R);return E},moveH:Li(function(n,r){var s=this;this.extendSelectionsBy(function(d){return s.display.shift||s.doc.extend||d.empty()?ka(s.doc,d.head,n,r,s.options.rtlMoveVisually):n<0?d.from():d.to()},Z)}),deleteH:Li(function(n,r){var s=this.doc.sel,d=this.doc;s.somethingSelected()?d.replaceSelection("",null,"+delete"):Zr(this,function(g){var E=ka(d,g.head,n,r,!1);return n<0?{from:E,to:g.head}:{from:g.head,to:E}})}),findPosV:function(n,r,s,d){var g=1,E=d;r<0&&(g=-1,r=-r);for(var R=o(this.doc,n),te=0;te<r;++te){var le=on(this,R,"div");if(E==null?E=le.left:le.left=E,R=Ks(this,le,g,s),R.hitSide)break}return R},moveV:Li(function(n,r){var s=this,d=this.doc,g=[],E=!this.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(te){if(E)return n<0?te.from():te.to();var le=on(s,te.head,"div");te.goalColumn!=null&&(le.left=te.goalColumn),g.push(le.left);var Te=Ks(s,le,n,r);return r=="page"&&te==d.sel.primary()&&aa(s,Ti(s,Te,"div").top-le.top),Te},Z),g.length)for(var R=0;R<d.sel.ranges.length;R++)d.sel.ranges[R].goalColumn=g[R]}),findWordAt:function(n){var r=this.doc,s=_t(r,n.line).text,d=n.ch,g=n.ch;if(s){var E=this.getHelper(n,"wordChars");(n.sticky=="before"||g==s.length)&&d?--d:++g;for(var R=s.charAt(d),te=ke(R,E)?function(le){return ke(le,E)}:/\s/.test(R)?function(le){return/\s/.test(le)}:function(le){return!/\s/.test(le)&&!ke(le)};d>0&&te(s.charAt(d-1));)--d;for(;g<s.length&&te(s.charAt(g));)++g}return new Tn(Fe(n.line,d),Fe(n.line,g))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?de(this.display.cursorDiv,"CodeMirror-overwrite"):j(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==K()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Li(function(n,r){lo(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Yi(this)-this.display.barHeight,width:n.scrollWidth-Yi(this)-this.display.barWidth,clientHeight:Ar(this),clientWidth:qi(this)}},scrollIntoView:Li(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:Fe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=r||0,n.from.line!=null?Zs(this,n):ja(this,n.from,n.to,n.margin)}),setSize:Li(function(n,r){var s=this,d=function(E){return typeof E=="number"||/^\d+$/.test(String(E))?E+"px":E};n!=null&&(this.display.wrapper.style.width=d(n)),r!=null&&(this.display.wrapper.style.height=d(r)),this.options.lineWrapping&&ni(this);var g=this.display.viewFrom;this.doc.iter(g,this.display.viewTo,function(E){if(E.widgets){for(var R=0;R<E.widgets.length;R++)if(E.widgets[R].noHScroll){gr(s,g,"widget");break}}++g}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(n){return Hi(this,n)},startOperation:function(){return Nr(this)},endOperation:function(){return jr(this)},refresh:Li(function(){var n=this.display.cachedTextHeight;Ni(this),this.curOp.forceUpdate=!0,Fn(this),lo(this,this.doc.scrollLeft,this.doc.scrollTop),ua(this.display),(n==null||Math.abs(n-vi(this.display))>.5||this.options.lineWrapping)&&na(this),He(this,"refresh",this)}),swapDoc:Li(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),Ja(this,n),Fn(this),this.display.input.reset(),lo(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,ui(this,"swapDoc",this,r),r}),phrase:function(n){var r=this.options.phrases;return r&&Object.prototype.hasOwnProperty.call(r,n)?r[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ie(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,d){e.registerHelper(n,r,d),i[n]._global.push({pred:s,val:d})}}function ka(e,t,i,n,r){var s=t,d=i,g=_t(e,t.line),E=r&&e.direction=="rtl"?-i:i;function R(){var Bt=t.line+E;return Bt<e.first||Bt>=e.first+e.size?!1:(t=new Fe(Bt,t.ch,t.sticky),g=_t(e,Bt))}function te(Bt){var Rt;if(n=="codepoint"){var Ht=g.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Ht)?Rt=null:Rt=new Fe(t.line,Math.max(0,Math.min(g.text.length,t.ch+i*(Ht>=55296&&Ht<56320?2:1))),-i)}else r?Rt=Dl(e.cm,g,t,i):Rt=ba(g,t,i);if(Rt==null)if(!Bt&&R())t=Ea(r,e.cm,g,t.line,E);else return!1;else t=Rt;return!0}if(n=="char"||n=="codepoint")te();else if(n=="column")te(!0);else if(n=="word"||n=="group")for(var le=null,Te=n=="group",Se=e.cm&&e.cm.getHelper(t,"wordChars"),Qe=!0;!(i<0&&!te(!Qe));Qe=!1){var at=g.text.charAt(t.ch)||`
`,mt=ke(at,Se)?"w":Te&&at==`
`?"n":!Te||/\s/.test(at)?null:"p";if(Te&&!Qe&&!mt&&(mt="s"),le&&le!=mt){i<0&&(i=1,te(),t.sticky="after");break}if(mt&&(le=mt),i>0&&!te(!Qe))break}var kt=Ko(e,t,s,d,!0);return Gt(s,kt)&&(kt.hitSide=!0),kt}function Ks(e,t,i,n){var r=e.doc,s=t.left,d;if(n=="page"){var g=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),E=Math.max(g-.5*vi(e.display),3);d=(i>0?t.bottom:t.top)+i*E}else n=="line"&&(d=i>0?t.bottom+3:t.top-3);for(var R;!(R=pi(e,s,d),!R.outside);){if(i<0?d<=0:d>=r.height){R.hitSide=!0;break}d+=i*5}return R}var Dn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ue,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Dn.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;zs(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(g){for(var E=g.target;E;E=E.parentNode){if(E==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(E.className))break}return!1}Le(r,"paste",function(g){if(!s(g)||Xe(n,g)||Bs(g,n))return;B<=11&&setTimeout(gi(n,function(){return t.updateFromDOM()}),20)}),Le(r,"compositionstart",function(g){t.composing={data:g.data,done:!1}}),Le(r,"compositionupdate",function(g){t.composing||(t.composing={data:g.data,done:!1})}),Le(r,"compositionend",function(g){t.composing&&(g.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Le(r,"touchstart",function(){return i.forceCompositionEnd()}),Le(r,"input",function(){t.composing||t.readFromDOMSoon()});function d(g){if(!s(g)||Xe(n,g))return;if(n.somethingSelected())Jo({lineWise:!1,text:n.getSelections()}),g.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var E=Ws(n);Jo({lineWise:!0,text:E.text}),g.type=="cut"&&n.operation(function(){n.setSelections(E.ranges,0,Pe),n.replaceSelection("",null,"cut")})}else return;if(g.clipboardData){g.clipboardData.clearData();var R=tr.text.join(`
`);if(g.clipboardData.setData("Text",R),g.clipboardData.getData("Text")==R){g.preventDefault();return}}var te=Hs(),le=te.firstChild;n.display.lineSpace.insertBefore(te,n.display.lineSpace.firstChild),le.value=tr.text.join(`
`);var Te=document.activeElement;be(le),setTimeout(function(){n.display.lineSpace.removeChild(te),Te.focus(),Te==r&&i.showPrimarySelection()},50)}Le(r,"copy",d),Le(r,"cut",d)},Dn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Dn.prototype.prepareSelection=function(){var e=Pa(this.cm,!1);return e.focus=document.activeElement==this.div,e},Dn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Dn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Dn.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=Zo(t,e.anchorNode,e.anchorOffset),d=Zo(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&d&&!d.bad&&it(ln(s,d),n)==0&&it(nn(s,d),r)==0)return;var g=t.display.view,E=n.line>=t.display.viewFrom&&Gs(t,n)||{node:g[0].measure.map[2],offset:0},R=r.line<t.display.viewTo&&Gs(t,r);if(!R){var te=g[g.length-1].measure,le=te.maps?te.maps[te.maps.length-1]:te.map;R={node:le[le.length-1],offset:le[le.length-2]-le[le.length-3]}}if(!E||!R){e.removeAllRanges();return}var Te=e.rangeCount&&e.getRangeAt(0),Se;try{Se=z(E.node,E.offset,R.offset,R.node)}catch(Qe){}Se&&(!me&&t.state.focused?(e.collapse(E.node,E.offset),Se.collapsed||(e.removeAllRanges(),e.addRange(Se))):(e.removeAllRanges(),e.addRange(Se)),Te&&e.anchorNode==null?e.addRange(Te):me&&this.startGracePeriod()),this.rememberSelection()},Dn.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)},Dn.prototype.showMultipleSelections=function(e){k(this.cm.display.cursorDiv,e.cursors),k(this.cm.display.selectionDiv,e.selection)},Dn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Dn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return U(this.div,t)},Dn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Dn.prototype.blur=function(){this.div.blur()},Dn.prototype.getField=function(){return this.div},Dn.prototype.supportsTouch=function(){return!0},Dn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Hi(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)},Dn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Dn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(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=Zo(t,e.anchorNode,e.anchorOffset),n=Zo(t,e.focusNode,e.focusOffset);i&&n&&Hi(t,function(){Ri(t.doc,br(i,n),Pe),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},Dn.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=Fe(n.line-1,_t(e.doc,n.line-1).length)),r.ch==_t(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=Fe(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,d,g;n.line==t.viewFrom||(s=Lr(e,n.line))==0?(d=Kt(t.view[0].line),g=t.view[0].node):(d=Kt(t.view[s].line),g=t.view[s-1].node.nextSibling);var E=Lr(e,r.line),R,te;if(E==t.view.length-1?(R=t.viewTo-1,te=t.lineDiv.lastChild):(R=Kt(t.view[E+1].line)-1,te=t.view[E+1].node.previousSibling),!g)return!1;for(var le=e.doc.splitLines(tu(e,g,te,d,R)),Te=an(e.doc,Fe(d,0),Fe(R,_t(e.doc,R).text.length));le.length>1&&Te.length>1;)if(Ce(le)==Ce(Te))le.pop(),Te.pop(),R--;else if(le[0]==Te[0])le.shift(),Te.shift(),d++;else break;for(var Se=0,Qe=0,at=le[0],mt=Te[0],kt=Math.min(at.length,mt.length);Se<kt&&at.charCodeAt(Se)==mt.charCodeAt(Se);)++Se;for(var Bt=Ce(le),Rt=Ce(Te),Ht=Math.min(Bt.length-(le.length==1?Se:0),Rt.length-(Te.length==1?Se:0));Qe<Ht&&Bt.charCodeAt(Bt.length-Qe-1)==Rt.charCodeAt(Rt.length-Qe-1);)++Qe;if(le.length==1&&Te.length==1&&d==n.line)for(;Se&&Se>n.ch&&Bt.charCodeAt(Bt.length-Qe-1)==Rt.charCodeAt(Rt.length-Qe-1);)Se--,Qe++;le[le.length-1]=Bt.slice(0,Bt.length-Qe).replace(/^\u200b+/,""),le[0]=le[0].slice(Se).replace(/\u200b+$/,"");var tn=Fe(d,Se),Qt=Fe(R,Te.length?Ce(Te).length-Qe:0);if(le.length>1||le[0]||it(tn,Qt))return $r(e.doc,le,tn,Qt,"+input"),!0},Dn.prototype.ensurePolled=function(){this.forceCompositionEnd()},Dn.prototype.reset=function(){this.forceCompositionEnd()},Dn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Dn.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)},Dn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Hi(this.cm,function(){return Ni(e.cm)})},Dn.prototype.setUneditable=function(e){e.contentEditable="false"},Dn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||gi(this.cm,Sa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Dn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Dn.prototype.onContextMenu=function(){},Dn.prototype.resetPosition=function(){},Dn.prototype.needsContentAttribute=!0;function Gs(e,t){var i=Et(e,t.line);if(!i||i.hidden)return null;var n=_t(e.doc,t.line),r=dt(i,n,t.line),s=xt(n,e.doc.direction),d="left";if(s){var g=st(s,t.ch);d=g%2?"right":"left"}var E=un(r.map,t.ch,d);return E.offset=E.collapse=="right"?E.end:E.start,E}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function qr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",d=!1,g=e.doc.lineSeparator(),E=!1;function R(Se){return function(Qe){return Qe.id==Se}}function te(){d&&(s+=g,E&&(s+=g),d=E=!1)}function le(Se){Se&&(te(),s+=Se)}function Te(Se){if(Se.nodeType==1){var Qe=Se.getAttribute("cm-text");if(Qe){le(Qe);return}var at=Se.getAttribute("cm-marker"),mt;if(at){var kt=e.findMarks(Fe(n,0),Fe(r+1,0),R(+at));kt.length&&(mt=kt[0].find(0))&&le(an(e.doc,mt.from,mt.to).join(g));return}if(Se.getAttribute("contenteditable")=="false")return;var Bt=/^(pre|div|p|li|table|br)$/i.test(Se.nodeName);if(!/^br$/i.test(Se.nodeName)&&Se.textContent.length==0)return;Bt&&te();for(var Rt=0;Rt<Se.childNodes.length;Rt++)Te(Se.childNodes[Rt]);/^(pre|p)$/i.test(Se.nodeName)&&(E=!0),Bt&&(d=!0)}else Se.nodeType==3&&le(Se.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(Te(t),t==i);)t=t.nextSibling,E=!1;return s}function Zo(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return qr(e.clipPos(Fe(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||!U(n,t))return qr(Fe(Kt(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?Ce(e.rest):e.line;return qr(Fe(Kt(s),s.text.length),r)}var d=t.nodeType==3?t:null,g=t;for(!d&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(d=t.firstChild,i&&(i=d.nodeValue.length));g.parentNode!=n;)g=g.parentNode;var E=e.measure,R=E.maps;function te(mt,kt,Bt){for(var Rt=-1;Rt<(R?R.length:0);Rt++)for(var Ht=Rt<0?E.map:R[Rt],tn=0;tn<Ht.length;tn+=3){var Qt=Ht[tn+2];if(Qt==mt||Qt==kt){var pn=Kt(Rt<0?e.line:e.rest[Rt]),Bn=Ht[tn]+Bt;return(Bt<0||Qt!=mt)&&(Bn=Ht[tn+(Bt?1:0)]),Fe(pn,Bn)}}}var le=te(d,g,i);if(le)return qr(le,r);for(var Te=g.nextSibling,Se=d?d.nodeValue.length-i:0;Te;Te=Te.nextSibling){if(le=te(Te,Te.firstChild,0),le)return qr(Fe(le.line,le.ch-Se),r);Se+=Te.textContent.length}for(var Qe=g.previousSibling,at=i;Qe;Qe=Qe.previousSibling){if(le=te(Qe,Qe.firstChild,-1),le)return qr(Fe(le.line,le.ch+at),r);at+=Qe.textContent.length}}var ii=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Ue,this.hasSelection=!1,this.composing=null};ii.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),M&&(r.style.width="0px"),Le(r,"input",function(){Y&&B>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Le(r,"paste",function(d){if(Xe(n,d)||Bs(d,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(d){if(Xe(n,d))return;if(n.somethingSelected())Jo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var g=Ws(n);Jo({lineWise:!0,text:g.text}),d.type=="cut"?n.setSelections(g.ranges,null,Pe):(i.prevInput="",r.value=g.text.join(`
`),be(r))}else return;d.type=="cut"&&(n.state.cutIncoming=+new Date)}Le(r,"cut",s),Le(r,"copy",s),Le(e.scroller,"paste",function(d){if(Qi(e,d)||Xe(n,d))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var g=new Event("paste");g.clipboardData=d.clipboardData,r.dispatchEvent(g)}),Le(e.lineSpace,"selectstart",function(d){Qi(e,d)||P(d)}),Le(r,"compositionstart",function(){var d=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:d,range:n.markText(d,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Le(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},ii.prototype.createField=function(e){this.wrapper=Hs(),this.textarea=this.wrapper.firstChild},ii.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ii.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=Pa(e);if(e.options.moveInputWithCursor){var r=on(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+d.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+d.left-s.left))}return n},ii.prototype.showSelection=function(e){var t=this.cm,i=t.display;k(i.cursorDiv,e.cursors),k(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ii.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&&be(this.textarea),Y&&B>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",Y&&B>=9&&(this.hasSelection=null))},ii.prototype.getField=function(){return this.textarea},ii.prototype.supportsTouch=function(){return!1},ii.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!v||K()!=this.textarea))try{this.textarea.focus()}catch(e){}},ii.prototype.blur=function(){this.textarea.blur()},ii.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ii.prototype.receivedFocus=function(){this.slowPoll()},ii.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()})},ii.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)},ii.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||ut(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(Y&&B>=9&&this.hasSelection===r||f&&/[\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 d=0,g=Math.min(n.length,r.length);d<g&&n.charCodeAt(d)==r.charCodeAt(d);)++d;return Hi(t,function(){Sa(t,r.slice(d),n.length-d,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},ii.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ii.prototype.onKeyPress=function(){Y&&B>=9&&(this.hasSelection=null),this.fastPoll()},ii.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Pr(i,e),d=n.scroller.scrollTop;if(!s||C)return;var g=i.options.resetSelectionOnContextMenu;g&&i.doc.sel.contains(s)==-1&&gi(i,Ri)(i.doc,br(s),Pe);var E=r.style.cssText,R=t.wrapper.style.cssText,te=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-te.top-5)+"px; left: "+(e.clientX-te.left-5)+`px;
z-index: 1000; background: `+(Y?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var le;N&&(le=window.scrollY),n.input.focus(),N&&window.scrollTo(null,le),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=Se,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function Te(){if(r.selectionStart!=null){var at=i.somethingSelected(),mt="\u200B"+(at?r.value:"");r.value="\u21DA",r.value=mt,t.prevInput=at?"":"\u200B",r.selectionStart=1,r.selectionEnd=mt.length,n.selForContextMenu=i.doc.sel}}function Se(){if(t.contextMenuPending!=Se)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=R,r.style.cssText=E,Y&&B<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=d),r.selectionStart!=null){(!Y||Y&&B<9)&&Te();var at=0,mt=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?gi(i,us)(i):at++<10?n.detectingSelectAll=setTimeout(mt,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(mt,200)}}if(Y&&B>=9&&Te(),b){V(e);var Qe=function(){At(window,"mouseup",Qe),setTimeout(Se,20)};Le(window,"mouseup",Qe)}else setTimeout(Se,50)},ii.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ii.prototype.setUneditable=function(){},ii.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?y(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=K();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function n(){e.value=g.getValue()}var r;if(e.form&&(Le(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var d=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=d}}catch(E){}}t.finishInit=function(E){E.save=n,E.getTextArea=function(){return e},E.toTextArea=function(){E.toTextArea=isNaN,n(),e.parentNode.removeChild(E.getWrapperElement()),e.style.display="",e.form&&(At(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var g=Vn(function(E){return e.parentNode.insertBefore(E,e.nextSibling)},t);return g}function ru(e){e.off=At,e.on=Le,e.wheelEventPixels=dl,e.Doc=ji,e.splitLines=Ut,e.countColumn=pe,e.findColumn=ye,e.isWordChar=he,e.Pass=Ne,e.signal=He,e.Line=lr,e.changeEnd=Er,e.scrollbarModel=Ba,e.Pos=Fe,e.cmpPos=it,e.modes=Wt,e.mimeModes=St,e.resolveMode=Je,e.getMode=ze,e.modeExtensions=Ae,e.extendMode=$e,e.copyState=Dt,e.startState=Jt,e.innerMode=Nt,e.commands=wo,e.keyMap=dr,e.keyName=Ss,e.isModifierKey=xs,e.lookupKey=Jr,e.normalizeKeyMap=Ml,e.StringStream=Ft,e.SharedTextMarker=_o,e.TextMarker=Cr,e.LineWidget=Eo,e.e_preventDefault=P,e.e_stopPropagation=D,e.e_stop=V,e.addClass=de,e.contains=U,e.rmClass=j,e.keyNames=xr}Yl(Vn),ql(Vn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var Qo in ji.prototype)ji.prototype.hasOwnProperty(Qo)&&De(ou,Qo)<0&&(Vn.prototype[Qo]=function(e){return function(){return e.apply(this.doc,arguments)}}(ji.prototype[Qo]));return ie(ji),Vn.inputStyles={textarea:ii,contenteditable:Dn},Vn.defineMode=function(e){!Vn.defaults.mode&&e!="null"&&(Vn.defaults.mode=e),Yt.apply(this,arguments)},Vn.defineMIME=zt,Vn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Vn.defineMIME("text/plain","null"),Vn.defineExtension=function(e,t){Vn.prototype[e]=t},Vn.defineDocExtension=function(e,t){ji.prototype[e]=t},Vn.fromTextArea=iu,ru(Vn),Vn.version="5.58.2",Vn})},WaYH:function(rt,ue,l){"use strict";var q=l("rePB"),_e=l("Ff2n"),me=l("VTBJ"),we=l("1OyB"),Ee=l("vuIU"),fe=l("JX7q"),Y=l("Ji7U"),B=l("LK+K"),N=l("q1tI"),A=l("TSYQ"),_=l.n(A),C=l("sboe"),O=l("OZM5"),x=function(b){var se=b.prefixCls,j=b.level,re=b.isStart,k=b.isEnd;if(!j)return null;for(var S="".concat(se,"-indent-unit"),Q=[],z=0;z<j;z+=1){var U;Q.push(N.createElement("span",{key:z,className:_()(S,(U={},Object(q.a)(U,"".concat(S,"-start"),re[z+1]),Object(q.a)(U,"".concat(S,"-end"),k[z+1]),Object(q.a)(U,"".concat(S,"-end-first-level"),!z&&k[0]),U))}))}return N.createElement("span",{"aria-hidden":"true",className:"".concat(se,"-indent")},Q)},w=x,M=l("815F"),m="open",v="close",f="---",L=function(F){Object(Y.a)(se,F);var b=Object(B.a)(se);function se(){var j;return Object(we.a)(this,se),j=b.apply(this,arguments),j.state={dragNodeHighlight:!1},j.onSelectorClick=function(re){var k=j.props.context.onNodeClick;k(re,Object(M.b)(j.props)),j.isSelectable()?j.onSelect(re):j.onCheck(re)},j.onSelectorDoubleClick=function(re){var k=j.props.context.onNodeDoubleClick;k(re,Object(M.b)(j.props))},j.onSelect=function(re){if(j.isDisabled())return;var k=j.props.context.onNodeSelect;re.preventDefault(),k(re,Object(M.b)(j.props))},j.onCheck=function(re){if(j.isDisabled())return;var k=j.props,S=k.disableCheckbox,Q=k.checked,z=j.props.context.onNodeCheck;if(!j.isCheckable()||S)return;re.preventDefault();var U=!Q;z(re,Object(M.b)(j.props),U)},j.onMouseEnter=function(re){var k=j.props.context.onNodeMouseEnter;k(re,Object(M.b)(j.props))},j.onMouseLeave=function(re){var k=j.props.context.onNodeMouseLeave;k(re,Object(M.b)(j.props))},j.onContextMenu=function(re){var k=j.props.context.onNodeContextMenu;k(re,Object(M.b)(j.props))},j.onDragStart=function(re){var k=j.props.context.onNodeDragStart;re.stopPropagation(),j.setState({dragNodeHighlight:!0}),k(re,Object(fe.a)(j));try{re.dataTransfer.setData("text/plain","")}catch(S){}},j.onDragEnter=function(re){var k=j.props.context.onNodeDragEnter;re.preventDefault(),re.stopPropagation(),k(re,Object(fe.a)(j))},j.onDragOver=function(re){var k=j.props.context.onNodeDragOver;re.preventDefault(),re.stopPropagation(),k(re,Object(fe.a)(j))},j.onDragLeave=function(re){var k=j.props.context.onNodeDragLeave;re.stopPropagation(),k(re,Object(fe.a)(j))},j.onDragEnd=function(re){var k=j.props.context.onNodeDragEnd;re.stopPropagation(),j.setState({dragNodeHighlight:!1}),k(re,Object(fe.a)(j))},j.onDrop=function(re){var k=j.props.context.onNodeDrop;re.preventDefault(),re.stopPropagation(),j.setState({dragNodeHighlight:!1}),k(re,Object(fe.a)(j))},j.onExpand=function(re){var k=j.props.context.onNodeExpand;k(re,Object(M.b)(j.props))},j.setSelectHandle=function(re){j.selectHandle=re},j.getNodeState=function(){var re=j.props.expanded;return j.isLeaf()?null:re?m:v},j.hasChildren=function(){var re=j.props.eventKey,k=j.props.context.keyEntities,S=k[re]||{},Q=S.children;return!!(Q||[]).length},j.isLeaf=function(){var re=j.props,k=re.isLeaf,S=re.loaded,Q=j.props.context.loadData,z=j.hasChildren();return k===!1?!1:k||!Q&&!z||Q&&S&&!z},j.isDisabled=function(){var re=j.props.disabled,k=j.props.context.disabled;return!!(k||re)},j.isCheckable=function(){var re=j.props.checkable,k=j.props.context.checkable;return!k||re===!1?!1:k},j.syncLoadData=function(re){var k=re.expanded,S=re.loading,Q=re.loaded,z=j.props.context,U=z.loadData,K=z.onNodeLoad;if(S)return;U&&k&&!j.isLeaf()&&(!j.hasChildren()&&!Q&&K(Object(M.b)(j.props)))},j.renderSwitcher=function(){var re=j.props,k=re.expanded,S=re.switcherIcon,Q=j.props.context,z=Q.prefixCls,U=Q.switcherIcon,K=S||U;if(j.isLeaf())return N.createElement("span",{className:_()("".concat(z,"-switcher"),"".concat(z,"-switcher-noop"))},typeof K=="function"?K(Object(me.a)(Object(me.a)({},j.props),{},{isLeaf:!0})):K);var de=_()("".concat(z,"-switcher"),"".concat(z,"-switcher_").concat(k?m:v));return N.createElement("span",{onClick:j.onExpand,className:de},typeof K=="function"?K(Object(me.a)(Object(me.a)({},j.props),{},{isLeaf:!1})):K)},j.renderCheckbox=function(){var re=j.props,k=re.checked,S=re.halfChecked,Q=re.disableCheckbox,z=j.props.context.prefixCls,U=j.isDisabled(),K=j.isCheckable();if(!K)return null;var de=typeof K!="boolean"?K:null;return N.createElement("span",{className:_()("".concat(z,"-checkbox"),k&&"".concat(z,"-checkbox-checked"),!k&&S&&"".concat(z,"-checkbox-indeterminate"),(U||Q)&&"".concat(z,"-checkbox-disabled")),onClick:j.onCheck},de)},j.renderIcon=function(){var re=j.props.loading,k=j.props.context.prefixCls;return N.createElement("span",{className:_()("".concat(k,"-iconEle"),"".concat(k,"-icon__").concat(j.getNodeState()||"docu"),re&&"".concat(k,"-icon_loading"))})},j.renderSelector=function(){var re=j.state.dragNodeHighlight,k=j.props,S=k.title,Q=k.selected,z=k.icon,U=k.loading,K=k.data,de=j.props.context,J=de.prefixCls,be=de.showIcon,I=de.icon,y=de.draggable,pe=de.loadData,Ue=de.titleRender,De=j.isDisabled(),nt="".concat(J,"-node-content-wrapper"),Ne;if(be){var Pe=z||I;Ne=Pe?N.createElement("span",{className:_()("".concat(J,"-iconEle"),"".concat(J,"-icon__customize"))},typeof Pe=="function"?Pe(j.props):Pe):j.renderIcon()}else pe&&U&&(Ne=j.renderIcon());var ae;typeof S=="function"?ae=S(K):Ue?ae=Ue(K):ae=S;var Z=N.createElement("span",{className:"".concat(J,"-title")},ae);return N.createElement("span",{ref:j.setSelectHandle,title:typeof S=="string"?S:"",className:_()("".concat(nt),"".concat(nt,"-").concat(j.getNodeState()||"normal"),!De&&(Q||re)&&"".concat(J,"-node-selected"),!De&&y&&"draggable"),draggable:!De&&y||void 0,"aria-grabbed":!De&&y||void 0,onMouseEnter:j.onMouseEnter,onMouseLeave:j.onMouseLeave,onContextMenu:j.onContextMenu,onClick:j.onSelectorClick,onDoubleClick:j.onSelectorDoubleClick,onDragStart:y?j.onDragStart:void 0},Ne,Z)},j}return Object(Ee.a)(se,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var re=this.props.selectable,k=this.props.context.selectable;return typeof re=="boolean"?re:k}},{key:"render",value:function(){var re,k=this.props,S=k.eventKey,Q=k.className,z=k.style,U=k.dragOver,K=k.dragOverGapTop,de=k.dragOverGapBottom,J=k.isLeaf,be=k.isStart,I=k.isEnd,y=k.expanded,pe=k.selected,Ue=k.checked,De=k.halfChecked,nt=k.loading,Ne=k.domRef,Pe=k.active,ae=k.onMouseMove,Z=Object(_e.a)(k,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),ye=this.props.context,W=ye.prefixCls,T=ye.filterTreeNode,Ce=ye.draggable,We=ye.keyEntities,Ze=this.isDisabled(),Be=Object(O.f)(Z),H=We[S]||{},G=H.level,he=I[I.length-1];return N.createElement("div",Object.assign({ref:Ne,className:_()(Q,"".concat(W,"-treenode"),(re={},Object(q.a)(re,"".concat(W,"-treenode-disabled"),Ze),Object(q.a)(re,"".concat(W,"-treenode-switcher-").concat(y?"open":"close"),!J),Object(q.a)(re,"".concat(W,"-treenode-checkbox-checked"),Ue),Object(q.a)(re,"".concat(W,"-treenode-checkbox-indeterminate"),De),Object(q.a)(re,"".concat(W,"-treenode-selected"),pe),Object(q.a)(re,"".concat(W,"-treenode-loading"),nt),Object(q.a)(re,"".concat(W,"-treenode-active"),Pe),Object(q.a)(re,"".concat(W,"-treenode-leaf-last"),he),Object(q.a)(re,"drag-over",!Ze&&U),Object(q.a)(re,"drag-over-gap-top",!Ze&&K),Object(q.a)(re,"drag-over-gap-bottom",!Ze&&de),Object(q.a)(re,"filter-node",T&&T(Object(M.b)(this.props))),re)),style:z,onDragEnter:Ce?this.onDragEnter:void 0,onDragOver:Ce?this.onDragOver:void 0,onDragLeave:Ce?this.onDragLeave:void 0,onDrop:Ce?this.onDrop:void 0,onDragEnd:Ce?this.onDragEnd:void 0,onMouseMove:ae},Be),N.createElement(w,{prefixCls:W,level:G,isStart:be,isEnd:I}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),se}(N.Component),ee=function(b){return N.createElement(C.a.Consumer,null,function(se){return N.createElement(L,Object.assign({},b,{context:se}))})};ee.displayName="TreeNode",ee.defaultProps={title:f},ee.isTreeNode=1;var oe=ue.a=ee},Y1PL:function(rt,ue,l){"use strict";l.r(ue),l.d(ue,"ResizableTextArea",function(){return De});var q=l("wx14"),_e=l("1OyB"),me=l("vuIU"),we=l("Ji7U"),Ee=l("LK+K"),fe=l("q1tI"),Y=l("VTBJ"),B=l("rePB"),N=l("Zm9Q"),A=l("Kwbf"),_=l("c+Xe"),C=l("m+aA"),O=l("bdgK"),x=new Map;function w(Pe){Pe.forEach(function(ae){var Z,ye=ae.target;(Z=x.get(ye))===null||Z===void 0||Z.forEach(function(W){return W(ye)})})}var M=new O.default(w),m=null,v=null;function f(Pe,ae){x.has(Pe)||(x.set(Pe,new Set),M.observe(Pe)),x.get(Pe).add(ae)}function L(Pe,ae){x.has(Pe)&&(x.get(Pe).delete(ae),x.get(Pe).size||(M.unobserve(Pe),x.delete(Pe)))}var ee=function(Pe){Object(we.a)(Z,Pe);var ae=Object(Ee.a)(Z);function Z(){return Object(_e.a)(this,Z),ae.apply(this,arguments)}return Object(me.a)(Z,[{key:"render",value:function(){return this.props.children}}]),Z}(fe.Component),oe=fe.createContext(null);function F(Pe){var ae=Pe.children,Z=Pe.onBatchResize,ye=fe.useRef(0),W=fe.useRef([]),T=fe.useContext(oe),Ce=fe.useCallback(function(We,Ze,Be){ye.current+=1;var H=ye.current;W.current.push({size:We,element:Ze,data:Be}),Promise.resolve().then(function(){H===ye.current&&(Z==null||Z(W.current),W.current=[])}),T==null||T(We,Ze,Be)},[Z,T]);return fe.createElement(oe.Provider,{value:Ce},ae)}function b(Pe){var ae=Pe.children,Z=Pe.disabled,ye=fe.useRef(null),W=fe.useRef(null),T=fe.useContext(oe),Ce=fe.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),We=fe.isValidElement(ae)&&Object(_.c)(ae),Ze=We?ae.ref:null,Be=fe.useMemo(function(){return Object(_.a)(Ze,ye)},[Ze,ye]),H=fe.useRef(Pe);H.current=Pe;var G=fe.useCallback(function(he){var ke=H.current,Me=ke.onResize,Ge=ke.data,et=he.getBoundingClientRect(),Ke=et.width,yt=et.height,ct=he.offsetWidth,gt=he.offsetHeight,st=Math.floor(Ke),Ot=Math.floor(yt);if(Ce.current.width!==st||Ce.current.height!==Ot||Ce.current.offsetWidth!==ct||Ce.current.offsetHeight!==gt){var xt={width:st,height:Ot,offsetWidth:ct,offsetHeight:gt};Ce.current=xt;var wt=ct===Math.round(Ke)?Ke:ct,Le=gt===Math.round(yt)?yt:gt,ft=Object(Y.a)(Object(Y.a)({},xt),{},{offsetWidth:wt,offsetHeight:Le});T==null||T(ft,he,Ge),Me&&Promise.resolve().then(function(){Me(ft,he)})}},[]);return fe.useEffect(function(){var he=Object(C.a)(ye.current)||Object(C.a)(W.current);return he&&!Z&&f(he,G),function(){return L(he,G)}},[ye.current,Z]),fe.createElement(ee,{ref:W},We?fe.cloneElement(ae,{ref:Be}):ae)}var se="rc-observer-key";function j(Pe){var ae=Pe.children,Z=Object(N.a)(ae);return Z.map(function(ye,W){var T=(ye==null?void 0:ye.key)||"".concat(se,"-").concat(W);return fe.createElement(b,Object(q.a)({},Pe,{key:T}),ye)})}j.Collection=F;var re=j,k=l("bT9E"),S=l("TSYQ"),Q=l.n(S),z=`
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
`,U=["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"],K={},de;function J(Pe){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Z=Pe.getAttribute("id")||Pe.getAttribute("data-reactid")||Pe.getAttribute("name");if(ae&&K[Z])return K[Z];var ye=window.getComputedStyle(Pe),W=ye.getPropertyValue("box-sizing")||ye.getPropertyValue("-moz-box-sizing")||ye.getPropertyValue("-webkit-box-sizing"),T=parseFloat(ye.getPropertyValue("padding-bottom"))+parseFloat(ye.getPropertyValue("padding-top")),Ce=parseFloat(ye.getPropertyValue("border-bottom-width"))+parseFloat(ye.getPropertyValue("border-top-width")),We=U.map(function(Be){return"".concat(Be,":").concat(ye.getPropertyValue(Be))}).join(";"),Ze={sizingStyle:We,paddingSize:T,borderSize:Ce,boxSizing:W};return ae&&Z&&(K[Z]=Ze),Ze}function be(Pe){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ye=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;de||(de=document.createElement("textarea"),de.setAttribute("tab-index","-1"),de.setAttribute("aria-hidden","true"),document.body.appendChild(de)),Pe.getAttribute("wrap")?de.setAttribute("wrap",Pe.getAttribute("wrap")):de.removeAttribute("wrap");var W=J(Pe,ae),T=W.paddingSize,Ce=W.borderSize,We=W.boxSizing,Ze=W.sizingStyle;de.setAttribute("style","".concat(Ze,";").concat(z)),de.value=Pe.value||Pe.placeholder||"";var Be=Number.MIN_SAFE_INTEGER,H=Number.MAX_SAFE_INTEGER,G=de.scrollHeight,he;if(We==="border-box"?G+=Ce:We==="content-box"&&(G-=T),Z!==null||ye!==null){de.value=" ";var ke=de.scrollHeight-T;Z!==null&&(Be=ke*Z,We==="border-box"&&(Be=Be+T+Ce),G=Math.max(Be,G)),ye!==null&&(H=ke*ye,We==="border-box"&&(H=H+T+Ce),he=G>H?"":"hidden",G=Math.min(H,G))}return{height:G,minHeight:Be,maxHeight:H,overflowY:he,resize:"none"}}var I=l("Gytx"),y=l.n(I),pe;(function(Pe){Pe[Pe.NONE=0]="NONE",Pe[Pe.RESIZING=1]="RESIZING",Pe[Pe.RESIZED=2]="RESIZED"})(pe||(pe={}));var Ue=function(Pe){Object(we.a)(Z,Pe);var ae=Object(Ee.a)(Z);function Z(ye){var W;return Object(_e.a)(this,Z),W=ae.call(this,ye),W.nextFrameActionId=void 0,W.resizeFrameId=void 0,W.textArea=void 0,W.saveTextArea=function(T){W.textArea=T},W.handleResize=function(T){var Ce=W.state.resizeStatus,We=W.props,Ze=We.autoSize,Be=We.onResize;if(Ce!==pe.NONE)return;typeof Be=="function"&&Be(T),Ze&&W.resizeOnNextFrame()},W.resizeOnNextFrame=function(){cancelAnimationFrame(W.nextFrameActionId),W.nextFrameActionId=requestAnimationFrame(W.resizeTextarea)},W.resizeTextarea=function(){var T=W.props.autoSize;if(!T||!W.textArea)return;var Ce=T.minRows,We=T.maxRows,Ze=be(W.textArea,!1,Ce,We);W.setState({textareaStyles:Ze,resizeStatus:pe.RESIZING},function(){cancelAnimationFrame(W.resizeFrameId),W.resizeFrameId=requestAnimationFrame(function(){W.setState({resizeStatus:pe.RESIZED},function(){W.resizeFrameId=requestAnimationFrame(function(){W.setState({resizeStatus:pe.NONE}),W.fixFirefoxAutoScroll()})})})})},W.renderTextArea=function(){var T=W.props,Ce=T.prefixCls,We=Ce===void 0?"rc-textarea":Ce,Ze=T.autoSize,Be=T.onResize,H=T.className,G=T.disabled,he=W.state,ke=he.textareaStyles,Me=he.resizeStatus,Ge=Object(k.a)(W.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),et=Q()(We,H,Object(B.a)({},"".concat(We,"-disabled"),G));"value"in Ge&&(Ge.value=Ge.value||"");var Ke=Object(Y.a)(Object(Y.a)(Object(Y.a)({},W.props.style),ke),Me===pe.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return fe.createElement(re,{onResize:W.handleResize,disabled:!(Ze||Be)},fe.createElement("textarea",Object(q.a)({},Ge,{className:et,style:Ke,ref:W.saveTextArea})))},W.state={textareaStyles:{},resizeStatus:pe.NONE},W}return Object(me.a)(Z,[{key:"componentDidUpdate",value:function(W){(W.value!==this.props.value||!y()(W.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 W=this.textArea.selectionStart,T=this.textArea.selectionEnd;this.textArea.setSelectionRange(W,T)}}catch(Ce){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Z}(fe.Component),De=Ue,nt=function(Pe){Object(we.a)(Z,Pe);var ae=Object(Ee.a)(Z);function Z(ye){var W;Object(_e.a)(this,Z),W=ae.call(this,ye),W.resizableTextArea=void 0,W.focus=function(){W.resizableTextArea.textArea.focus()},W.saveTextArea=function(Ce){W.resizableTextArea=Ce},W.handleChange=function(Ce){var We=W.props.onChange;W.setValue(Ce.target.value,function(){W.resizableTextArea.resizeTextarea()}),We&&We(Ce)},W.handleKeyDown=function(Ce){var We=W.props,Ze=We.onPressEnter,Be=We.onKeyDown;Ce.keyCode===13&&Ze&&Ze(Ce),Be&&Be(Ce)};var T=typeof ye.value=="undefined"||ye.value===null?ye.defaultValue:ye.value;return W.state={value:T},W}return Object(me.a)(Z,[{key:"setValue",value:function(W,T){"value"in this.props||this.setState({value:W},T)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return fe.createElement(De,Object(q.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(W){return"value"in W?{value:W.value}:null}}]),Z}(fe.Component),Ne=ue.default=nt},YBdh:function(rt,ue,l){rt.exports=l.p+"static/xiren.a6554bc1.svg"},ZW9T:function(rt,ue,l){"use strict";l.d(ue,"a",function(){return re});var q=l("k1fw"),_e=l("oBTY"),me=l("9og8"),we=l("miYZ"),Ee=l("tsqr"),fe=l("rAM+"),Y=l("tJVT"),B=l("PpiC"),N=l("WmNS"),A=l.n(N),_=l("q1tI"),C=l.n(_),O=l("bdgK");function x(k,S,Q,z,U){var K=S.getWordUntilPosition(Q),de={startLineNumber:Q.lineNumber,endLineNumber:Q.lineNumber,startColumn:K.startColumn,endColumn:K.endColumn},J=z.map(function(be){return{label:be,kind:k.languages.CompletionItemKind.Keyword,insertText:be,insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:de}});return U.map(function(be){J.push(Object(q.a)(Object(q.a)({},be),{},{range:de}))}),J}var w=function(k){var S={label:"ifelse",kind:k.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet},Q=["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"];k.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(de,J){var be=x(k,de,J,Q,[S]);return{suggestions:be}}});var z=["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"];k.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(de,J){var be=[{label:"print",kind:k.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}],I=x(k,de,J,z,be);return{suggestions:I}}});var U=["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"];k.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(de,J){var be=[S,{label:"main",kind:k.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:k.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:k.languages.CompletionItemInsertTextRule.InsertAsSnippet}],I=x(k,de,J,U,be);return{suggestions:I}}})},M="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",m=l("fjLI"),v=l("LvDl"),f=l("+ua5");function L(k){return/^\d+$/.test(k)?"".concat(k,"px"):k}function ee(){}var oe=!1,F={"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",Scala:"scale"};function b(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],S=k;if(Array.isArray(k)){for(var Q=0;Q<k.length;Q++){var z=F[k[Q]];if(z)return z}return S[0]}return F[S]||S}var se=null,j=ue.b=function(k){var S=k.width,Q=S===void 0?"100%":S,z=k.height,U=z===void 0?"100%":z,K=k.value,de=k.language,J=de===void 0?"javascript":de,be=k.style,I=be===void 0?{}:be,y=k.options,pe=y===void 0?{}:y,Ue=k.overrideServices,De=Ue===void 0?{}:Ue,nt=k.theme,Ne=nt===void 0?"vs-dark":nt,Pe=k.onEditBlur,ae=k.onSave,Z=k.autoHeight,ye=Z===void 0?!1:Z,W=k.forbidCopy,T=W===void 0?!1:W,Ce=k.onChange,We=Ce===void 0?ee:Ce,Ze=k.editorDidMount,Be=Ze===void 0?ee:Ze,H=k.onFocus,G=H===void 0?ee:H,he=k.onBreakPoint,ke=he===void 0?ee:he,Me=k.breakPointValue,Ge=Me===void 0?[]:Me,et=k.filename,Ke=et===void 0?"educoder.txt":et,yt=k.errorLine,ct=k.errorContent,gt=ct===void 0?"":ct,st=k.highlightLine,Ot=k.openBreakPoint,xt=Ot===void 0?!1:Ot,wt=Object(B.a)(k,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint"]),Le=Object(_.useRef)(),ft=Object(_.useRef)({}),At=Object(_.useRef)(),He=Object(_.useRef)(),Xe=Object(_.useRef)([]),$=Object(_.useRef)(!1),ne=Object(_.useRef)(),ie=Object(_.useState)(!1),P=Object(Y.a)(ie,2),D=P[0],X=P[1];function V(){var ze;return Le.current&&(ze=new O.default(function(Ae){var $e=Object(fe.a)(Ae),Dt;try{for($e.s();!(Dt=$e.n()).done;){var Nt=Dt.value;(Nt.target.offsetHeight>0||Nt.target.offsetWidth>0)&&ft.current.instance.layout()}}catch(Jt){$e.e(Jt)}finally{$e.f()}}),ze.observe(Le.current)),ze}function xe(){Ee.b.warn({content:decodeURIComponent(M),key:"monaco-editor-tip"})}var ve=function(){var Ae=ft.current.instance;if(K!=null&&Ae&&D){var $e=Ae.getModel();$e&&K!==$e.getValue()&&(oe=!0,$e.setValue(K),Ae.layout(),oe=!1)}};Object(_.useEffect)(function(){try{var ze,Ae=ft.current.instance;He.current&&clearTimeout(He.current),He.current=setTimeout(function(){ve()},500),Ae==null||((ze=Ae.updateOptions)===null||ze===void 0)||ze.call(Ae,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(K.split(/\r\n|\r|\n/g).length))+3,5)})}catch($e){debugger}},[K,D,ft.current]),Object(_.useEffect)(function(){try{if(yt&&ft.current&&ft.current.instance){var ze=ft.current.instance;ze.changeViewZones(function($e){var Dt=document.createElement("div");Dt.style.padding="10px 20px",Dt.style.width="calc(100% - 20px)",Dt.className="my-error-line-wrp",Dt.innerHTML=gt,$e.addZone({afterLineNumber:yt||11,heightInLines:3,domNode:Dt})});var Ae={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};ze.addOverlayWidget(Ae),ze.revealPositionInCenter({lineNumber:20,column:1})}}catch($e){debugger}},[yt,ft.current,D]),Object(_.useEffect)(function(){var ze;if((ze=ft.current)!==null&&ze!==void 0&&ze.instance&&D&&xt){var Ae=ft.current.instance,$e=Ae.getModel();if(!$e)return;var Dt=function(){var it=[],Gt=[],qt=$e.getAllDecorations(),nn=Object(fe.a)(qt),ln;try{for(nn.s();!(ln=nn.n()).done;){var u=ln.value;if(u.options.className==="highlighted-line"){var o;it.push(u==null||((o=u.range)===null||o===void 0)?void 0:o.startLineNumber),Gt.push(u==null?void 0:u.id)}}}catch(c){nn.e(c)}finally{nn.f()}$e.deltaDecorations(Gt,[]);var a=$e.getLineCount();!!st&&st<=a&&(Ae.deltaDecorations([],[{range:new se.Range(st,1,st,$e.getLineMaxColumn(st)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ae.revealLineInCenter(st))};Dt();var Nt=function(){var it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,Gt=[],qt=[],nn=$e.getAllDecorations(),ln=Object(fe.a)(nn),u;try{for(ln.s();!(u=ln.n()).done;){var o=u.value;if(o.options.linesDecorationsClassName==="breakpoints"){var a;Gt.push(o==null||((a=o.range)===null||a===void 0)?void 0:a.startLineNumber),qt.push(o==null?void 0:o.id)}}}catch(c){ln.e(c)}finally{ln.f()}if(it)return{lines:Gt,ids:qt};ke(Gt)},Jt=function(){var Fe=Object(me.a)(A.a.mark(function it(Gt){var qt;return A.a.wrap(function(ln){for(;;)switch(ln.prev=ln.next){case 0:return qt={range:new se.Range(Gt,1,Gt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}},ln.next=3,$e.deltaDecorations([],[qt]);case 3:Nt();case 4:case"end":return ln.stop()}},it)}));return function(Gt){return Fe.apply(this,arguments)}}(),Ft=function(){var Fe=Object(me.a)(A.a.mark(function it(Gt){var qt,nn,ln,u,o;return A.a.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:qt=[],nn=Ae.getLineDecorations(Gt),ln=Object(fe.a)(nn);try{for(ln.s();!(u=ln.n()).done;)o=u.value,o.options.linesDecorationsClassName==="breakpoints"&&qt.push(o.id)}catch(p){ln.e(p)}finally{ln.f()}return c.next=6,$e.deltaDecorations(qt,[]);case 6:Nt();case 7:case"end":return c.stop()}},it)}));return function(Gt){return Fe.apply(this,arguments)}}(),_t=function(it){var Gt=Ae.getLineDecorations(it),qt=Object(fe.a)(Gt),nn;try{for(qt.s();!(nn=qt.n()).done;){var ln=nn.value;if(ln.options.linesDecorationsClassName==="breakpoints")return!0}}catch(u){qt.e(u)}finally{qt.f()}return!1};if(!Object(v.isEqual)(Ge,Nt(!0).lines)){$e.deltaDecorations(Nt(!0).ids,[]);var an=Ge.map(function(Fe){return{range:new se.Range(Fe,1,Fe,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints"}}});$e.deltaDecorations([],an)}var jt=Ae.onDidChangeModelContent(function(Fe){var it=Ae.getPosition();if(it){var Gt=it.lineNumber;$e.getLineContent(Gt).trim()===""?Ft(Gt):_t(Gt)&&(Ft(Gt),Jt(Gt))}}),cn=Ae.onMouseDown(function(Fe){var it,Gt,qt;if(Fe.target.detail&&(it=Fe.target)!==null&&it!==void 0&&(Gt=it.element)!==null&&Gt!==void 0&&(qt=Gt.className)!==null&&qt!==void 0&&qt.includes("line-numbers")){var nn=Fe.target.position.lineNumber;if($e.getLineContent(nn).trim()==="")return;_t(nn)?Ft(nn):Jt(nn)}}),Kt=function(it){var Gt={range:new se.Range(it,1,it,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Xe.current=Ae.deltaDecorations(Xe.current,[Gt])},dn=function(){Xe.current=Ae.deltaDecorations(Xe.current,[])},Nn=Ae.onMouseMove(function(Fe){var it,Gt,qt;if(dn(),Fe.target.detail&&(it=Fe.target)!==null&&it!==void 0&&(Gt=it.element)!==null&&Gt!==void 0&&(qt=Gt.className)!==null&&qt!==void 0&&qt.includes("line-numbers")){var nn=Fe.target.position.lineNumber;if($e.getLineContent(nn).trim()==="")return;Kt(nn)}}),sn=Ae.onMouseLeave(function(){dn()});return function(){jt.dispose(),cn.dispose(),Nn.dispose(),sn.dispose()}}},[ft.current,D,Ge,st,xt]);function Oe(){var ze=ft.current.instance;if(ze){var Ae=ze.getSelection(),$e=ft.current.pastePos||{},Dt=new se.Range($e.startLineNumber||Ae.endLineNumber,$e.startColumn||Ae.endColumn,$e.endLineNumber||Ae.endLineNumber,$e.endColumn||Ae.endColumn);setTimeout(function(){ze.executeEdits("",[{range:Dt,text:""}])},300)}}function lt(ze){(window.navigator.platform.match("Mac")?ze.metaKey:ze.ctrlKey)&&ze.keyCode==83&&(ze.preventDefault(),ae())}var Ye=function(){if(ye&&ft.current.instance){var Ae=ft.current.instance.getContentHeight();zt(Ae<U?U:Ae)}else zt(U)};function je(ze){var Ae=document.createEvent("MouseEvents");Ae.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),ze.dispatchEvent(Ae)}var pt=function(Ae){var $e=Ae.keyCode,Dt=Ae.ctrlKey,Nt=Ae.metaKey,Jt=Ae.target,Ft=Ae.type;return(Ft==="paste"||($e===67||$e===86)&&(Nt||Dt))&&Jt.nodeName==="TEXTAREA"&&(xe(),Ae.preventDefault()),!1};function Ut(ze,Ae){var $e=window.URL||window.webkitURL||window,Dt=new Blob([Ae]),Nt=document.createElementNS("http://www.w3.org/1999/xhtml","a");Nt.href=$e.createObjectURL(Dt),Nt.download=ze,je(Nt)}Object(_.useEffect)(function(){Ye()},[Ye]),Object(_.useEffect)(function(){Le.current&&!D&&l.e(27).then(l.t.bind(null,"M/lh",7)).then(function(ze){try{se=ze,ft.current.instance=se.editor.create(Le.current,{value:K,language:b(J),theme:Ne,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},De);var Ae=ft.current.instance,$e=m.c._menuItems,Dt=Object(_e.a)($e).find(function(Jt){return Jt[0]._debugName=="EditorContext"});if(Be(Ae,se),setTimeout(function(){Ye(),ft.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ut(Ke||"educoder.txt",Ae.getValue())}}),Ae.getDomNode().addEventListener("input",function(){At.current.autoFormat&&Ae.getAction("editor.action.formatDocument").run()})},500),ft.current.subscription=Ae.onDidChangeModelContent(function(Jt){debugger;$.current?clearTimeout(ne.current):(Ye(),We(Ae.getValue(),Jt)),ne.current=setTimeout(function(){$.current=!1},500)}),window.Monaco||w(se,b(J)),T&&(Le.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",pt),window.removeEventListener("paste",pt),window.addEventListener("keydown",pt),window.addEventListener("paste",pt)),window.Monaco=se,Pe&&Ae.onDidBlurEditorWidget(function(){Pe(Ae.getValue())}),G&&Ae.onDidFocusEditorText(function(){G(Ae.getValue())}),T)try{window.addEventListener("paste",Oe)}catch(Jt){}var Nt=V();return X(!0),function(){var Jt=ft.current.instance;Jt.dispose();var Ft=Jt.getModel();Ft&&Ft.dispose(),ft.current.subscription&&ft.current.subscription.dispose(),T&&window.removeEventListener("paste",Oe),Nt.unobserve(Le.current)}}catch(Jt){debugger}})},[]),Object(_.useEffect)(function(){var ze=ft.current.instance;if(ze&&D)return document.addEventListener("keydown",lt,!1),function(){document.removeEventListener("keydown",lt)}},[ae,D]),Object(_.useEffect)(function(){var ze=ft.current.instance;if(ze&&D){var Ae=b(J);se.editor.setModelLanguage(ze.getModel(),Ae)}},[J,D]),Object(_.useEffect)(function(){var ze=ft.current.instance;ze&&D&&se.editor.setTheme(Ne)},[Ne,D]),Object(_.useEffect)(function(){var ze=ft.current.instance;At.current=pe,ze&&D&&(ze.updateOptions(Object(q.a)({},pe)),setTimeout(function(){ze.getModel().updateOptions(Object(q.a)({},pe))},200))},[JSON.stringify(pe),D]),Object(_.useEffect)(function(){var ze=ft.current.instance;ze&&D&&ze.layout()},[Q,U,D]);var ut=Object(_.useState)(L(Q)),$t=Object(Y.a)(ut,2),ot=$t[0],Xt=$t[1],Wt=Object(_.useState)(L(U)),St=Object(Y.a)(Wt,2),Yt=St[0],zt=St[1],Je=Object(q.a)(Object(q.a)({},I),{},{width:ot,height:Yt});return C.a.createElement("div",{className:"my-monaco-editor",ref:Le,style:Je})};function re(k){var S=k.width,Q=S===void 0?"100%":S,z=k.height,U=z===void 0?"100%":z,K=k.original,de=k.modified,J=k.language,be=k.options,I=be===void 0?{}:be,y=Object(_.useRef)(),pe=Object(_.useState)(null),Ue=Object(Y.a)(pe,2),De=Ue[0],nt=Ue[1];function Ne(ye){var W;return y.current&&(W=new O.default(function(T){var Ce=Object(fe.a)(T),We;try{for(Ce.s();!(We=Ce.n()).done;){var Ze=We.value;(Ze.target.offsetHeight>0||Ze.target.offsetWidth>0)&&ye.layout()}}catch(Be){Ce.e(Be)}finally{Ce.f()}}),W.observe(y.current)),W}Object(_.useEffect)(function(){return y.current&&l.e(27).then(l.t.bind(null,"M/lh",7)).then(function(ye){se=ye;var W=se.editor.createDiffEditor(y.current,Object(q.a)(Object(q.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},I),{},{wordWrap:!0}));nt(W);var T=Ne(W);return function(){W.dispose();var Ce=W.getModel();Ce&&Ce.dispose(),T.unobserve(y.current)}}),function(){window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}},[]),Object(_.useEffect)(function(){De&&De.setModel({original:se.editor.createModel(K,J),modified:se.editor.createModel(de,J)})},[K,de,J,De]);var Pe=L(Q),ae=L(U),Z={width:Pe,height:ae};return C.a.createElement("div",{className:"my-diff-editor",ref:y,style:Z})}},ZpRC:function(rt,ue,l){"use strict";function q(_){return typeof _=="object"&&_!=null&&_.nodeType===1}function _e(_,C){return(!C||_!=="hidden")&&_!=="visible"&&_!=="clip"}function me(_,C){if(_.clientHeight<_.scrollHeight||_.clientWidth<_.scrollWidth){var O=getComputedStyle(_,null);return _e(O.overflowY,C)||_e(O.overflowX,C)||function(x){var w=function(M){if(!M.ownerDocument||!M.ownerDocument.defaultView)return null;try{return M.ownerDocument.defaultView.frameElement}catch(m){return null}}(x);return!!w&&(w.clientHeight<x.scrollHeight||w.clientWidth<x.scrollWidth)}(_)}return!1}function we(_,C,O,x,w,M,m,v){return M<_&&m>C||M>_&&m<C?0:M<=_&&v<=O||m>=C&&v>=O?M-_-x:m>C&&v<O||M<_&&v>O?m-C+w:0}var Ee=function(_,C){var O=window,x=C.scrollMode,w=C.block,M=C.inline,m=C.boundary,v=C.skipOverflowHiddenElements,f=typeof m=="function"?m:function(ke){return ke!==m};if(!q(_))throw new TypeError("Invalid target");for(var L=document.scrollingElement||document.documentElement,ee=[],oe=_;q(oe)&&f(oe);){if((oe=oe.parentElement)===L){ee.push(oe);break}oe!=null&&oe===document.body&&me(oe)&&!me(document.documentElement)||oe!=null&&me(oe,v)&&ee.push(oe)}for(var F=O.visualViewport?O.visualViewport.width:innerWidth,b=O.visualViewport?O.visualViewport.height:innerHeight,se=window.scrollX||pageXOffset,j=window.scrollY||pageYOffset,re=_.getBoundingClientRect(),k=re.height,S=re.width,Q=re.top,z=re.right,U=re.bottom,K=re.left,de=w==="start"||w==="nearest"?Q:w==="end"?U:Q+k/2,J=M==="center"?K+S/2:M==="end"?z:K,be=[],I=0;I<ee.length;I++){var y=ee[I],pe=y.getBoundingClientRect(),Ue=pe.height,De=pe.width,nt=pe.top,Ne=pe.right,Pe=pe.bottom,ae=pe.left;if(x==="if-needed"&&Q>=0&&K>=0&&U<=b&&z<=F&&Q>=nt&&U<=Pe&&K>=ae&&z<=Ne)return be;var Z=getComputedStyle(y),ye=parseInt(Z.borderLeftWidth,10),W=parseInt(Z.borderTopWidth,10),T=parseInt(Z.borderRightWidth,10),Ce=parseInt(Z.borderBottomWidth,10),We=0,Ze=0,Be="offsetWidth"in y?y.offsetWidth-y.clientWidth-ye-T:0,H="offsetHeight"in y?y.offsetHeight-y.clientHeight-W-Ce:0;if(L===y)We=w==="start"?de:w==="end"?de-b:w==="nearest"?we(j,j+b,b,W,Ce,j+de,j+de+k,k):de-b/2,Ze=M==="start"?J:M==="center"?J-F/2:M==="end"?J-F:we(se,se+F,F,ye,T,se+J,se+J+S,S),We=Math.max(0,We+j),Ze=Math.max(0,Ze+se);else{We=w==="start"?de-nt-W:w==="end"?de-Pe+Ce+H:w==="nearest"?we(nt,Pe,Ue,W,Ce+H,de,de+k,k):de-(nt+Ue/2)+H/2,Ze=M==="start"?J-ae-ye:M==="center"?J-(ae+De/2)+Be/2:M==="end"?J-Ne+T+Be:we(ae,Ne,De,ye,T+Be,J,J+S,S);var G=y.scrollLeft,he=y.scrollTop;de+=he-(We=Math.max(0,Math.min(he+We,y.scrollHeight-Ue+H))),J+=G-(Ze=Math.max(0,Math.min(G+Ze,y.scrollWidth-De+Be)))}be.push({el:y,top:We,left:Ze})}return be};function fe(_){return _===Object(_)&&Object.keys(_).length!==0}function Y(_,C){C===void 0&&(C="auto");var O="scrollBehavior"in document.body.style;_.forEach(function(x){var w=x.el,M=x.top,m=x.left;w.scroll&&O?w.scroll({top:M,left:m,behavior:C}):(w.scrollTop=M,w.scrollLeft=m)})}function B(_){return _===!1?{block:"end",inline:"nearest"}:fe(_)?_:{block:"start",inline:"nearest"}}function N(_,C){var O=!_.ownerDocument.documentElement.contains(_);if(fe(C)&&typeof C.behavior=="function")return C.behavior(O?[]:Ee(_,C));if(O)return;var x=B(C);return Y(Ee(_,x),x.behavior)}var A=ue.a=N},bT9E:function(rt,ue,l){"use strict";l.d(ue,"a",function(){return _e});var q=l("VTBJ");function _e(me,we){var Ee=Object(q.a)({},me);return Array.isArray(we)&&we.forEach(function(fe){delete Ee[fe]}),Ee}},c5Ni:function(rt,ue,l){},dejd:function(rt,ue,l){},dmUQ:function(rt,ue,l){"use strict";var q=l("Ff2n"),_e=l("rePB"),me=l("1OyB"),we=l("vuIU"),Ee=l("Ji7U"),fe=l("md7G"),Y=l("foSv"),B=l("q1tI"),N=l.n(B),A=l("TSYQ"),_=l.n(A),C=l("4IlW");function O(k,S){var Q=Object.keys(k);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(k);S&&(z=z.filter(function(U){return Object.getOwnPropertyDescriptor(k,U).enumerable})),Q.push.apply(Q,z)}return Q}function x(k){for(var S=1;S<arguments.length;S++){var Q=arguments[S]!=null?arguments[S]:{};S%2?O(Object(Q),!0).forEach(function(z){Object(_e.a)(k,z,Q[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(Q)):O(Object(Q)).forEach(function(z){Object.defineProperty(k,z,Object.getOwnPropertyDescriptor(Q,z))})}return k}function w(k){var S=M();return function(){var z=Object(Y.a)(k),U;if(S){var K=Object(Y.a)(this).constructor;U=Reflect.construct(z,arguments,K)}else U=z.apply(this,arguments);return Object(fe.a)(this,U)}}function M(){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(k){return!1}}function m(){}function v(k){k.preventDefault()}var f=function(S){return S.replace(/[^\w.-]+/g,"")},L=200,ee=600,oe=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,F=function(S){return S!=null},b=function(S,Q){return Q===S||typeof Q=="number"&&typeof S=="number"&&isNaN(Q)&&isNaN(S)},se=function(k){Object(Ee.a)(Q,k);var S=w(Q);function Q(z){var U;Object(me.a)(this,Q),U=S.call(this,z),U.onKeyDown=function(J){var be=U.props,I=be.onKeyDown,y=be.onPressEnter;if(J.keyCode===C.a.UP){var pe=U.getRatio(J);U.up(J,pe,null),U.stop()}else if(J.keyCode===C.a.DOWN){var Ue=U.getRatio(J);U.down(J,Ue,null),U.stop()}else J.keyCode===C.a.ENTER&&y&&y(J);if(U.recordCursorPosition(),U.lastKeyCode=J.keyCode,I){for(var De=arguments.length,nt=new Array(De>1?De-1:0),Ne=1;Ne<De;Ne++)nt[Ne-1]=arguments[Ne];I.apply(void 0,[J].concat(nt))}},U.onKeyUp=function(J){var be=U.props.onKeyUp;if(U.stop(),U.recordCursorPosition(),be){for(var I=arguments.length,y=new Array(I>1?I-1:0),pe=1;pe<I;pe++)y[pe-1]=arguments[pe];be.apply(void 0,[J].concat(y))}},U.onChange=function(J){var be=U.props.onChange;U.state.focused&&(U.inputting=!0),U.rawInput=U.props.parser(U.getValueFromEvent(J)),U.setState({inputValue:U.rawInput}),be(U.toNumber(U.rawInput))},U.onMouseUp=function(){var J=U.props.onMouseUp;U.recordCursorPosition(),J&&J.apply(void 0,arguments)},U.onFocus=function(){var J;U.setState({focused:!0}),(J=U.props).onFocus.apply(J,arguments)},U.onBlur=function(){var J=U.props.onBlur;U.inputting=!1,U.setState({focused:!1});var be=U.getCurrentValidValue(U.state.inputValue),I=U.setValue(be,m);if(J){var y=U.input.value,pe=U.getInputDisplayValue({focus:!1,value:I});U.input.value=pe&&Number(pe),J.apply(void 0,arguments),U.input.value=y}},U.getRatio=function(J){var be=1;return J.metaKey||J.ctrlKey?be=.1:J.shiftKey&&(be=10),be},U.getFullNum=function(J){return isNaN(J)?J:/e/i.test(String(J))?Number(J).toFixed(18).replace(/\.?0+$/,""):J},U.getPrecision=function(J){if(F(U.props.precision))return U.props.precision;var be=String(J);if(be.indexOf("e-")>=0)return parseInt(be.slice(be.indexOf("e-")+2),10);var I=0;return be.indexOf(".")>=0&&(I=be.length-be.indexOf(".")-1),I},U.getInputDisplayValue=function(J){var be=J||U.state,I=be.focused,y=be.inputValue,pe=be.value,Ue;I?Ue=y:Ue=U.toPrecisionAsStep(pe),Ue==null&&(Ue="");var De=U.formatWrapper(Ue);return F(U.props.decimalSeparator)&&(De=De.toString().replace(".",U.props.decimalSeparator)),De},U.recordCursorPosition=function(){try{U.cursorStart=U.input.selectionStart,U.cursorEnd=U.input.selectionEnd,U.currentValue=U.input.value,U.cursorBefore=U.input.value.substring(0,U.cursorStart),U.cursorAfter=U.input.value.substring(U.cursorEnd)}catch(J){}},U.restoreByAfter=function(J){if(J===void 0)return!1;var be=U.input.value,I=be.lastIndexOf(J);if(I===-1)return!1;var y=U.cursorBefore.length;return U.lastKeyCode===C.a.DELETE&&U.cursorBefore.charAt(y-1)===J[0]?(U.fixCaret(y,y),!0):I+J.length===be.length?(U.fixCaret(I,I),!0):!1},U.partRestoreByAfter=function(J){return J===void 0?!1:Array.prototype.some.call(J,function(be,I){var y=J.substring(I);return U.restoreByAfter(y)})},U.isNotCompleteNumber=function(J){return isNaN(J)||J===""||J===null||J&&J.toString().indexOf(".")===J.toString().length-1},U.stop=function(){U.autoStepTimer&&clearTimeout(U.autoStepTimer)},U.down=function(J,be,I){U.pressingUpOrDown=!0,U.step("down",J,be,I)},U.up=function(J,be,I){U.pressingUpOrDown=!0,U.step("up",J,be,I)},U.saveInput=function(J){U.input=J};var K=z.value;K===void 0&&(K=z.defaultValue),U.state={focused:z.autoFocus};var de=U.getValidValue(U.toNumber(K));return U.state=x(x({},U.state),{},{inputValue:U.toPrecisionAsStep(de),value:de}),U}return Object(we.a)(Q,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(U){var K=this.props,de=K.value,J=K.onChange,be=K.max,I=K.min,y=this.state.focused;if(U){if(!b(U.value,de)||!b(U.max,be)||!b(U.min,I)){var pe=y?de:this.getValidValue(de),Ue;this.pressingUpOrDown?Ue=pe:this.inputting?Ue=this.rawInput:Ue=this.toPrecisionAsStep(pe),this.setState({value:pe,inputValue:Ue})}var De="value"in this.props?de:this.state.value;"max"in this.props&&U.max!==be&&typeof De=="number"&&De>be&&J&&J(be),"min"in this.props&&U.min!==I&&typeof De=="number"&&De<I&&J&&J(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var nt=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===C.a.BACKSPACE?nt=this.cursorStart-1:this.lastKeyCode===C.a.DELETE&&(nt=this.cursorStart):nt=this.input.value.length,this.fixCaret(nt,nt)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case C.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case C.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Ne){}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(U){var K=U;return K===""?K="":this.isNotCompleteNumber(parseFloat(K))?K=this.state.value:K=this.getValidValue(K),this.toNumber(K)}},{key:"getValueFromEvent",value:function(U){var K=U.target.value.trim().replace(/。/g,".");return F(this.props.decimalSeparator)&&(K=K.replace(this.props.decimalSeparator,".")),K}},{key:"getValidValue",value:function(U){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,J=parseFloat(U);return isNaN(J)?U:(J<K&&(J=K),J>de&&(J=de),J)}},{key:"setValue",value:function(U,K){var de=this.props.precision,J=this.isNotCompleteNumber(parseFloat(U))?null:parseFloat(U),be=this.state.value,I=be===void 0?null:be,y=this.state.inputValue,pe=y===void 0?null:y,Ue=typeof J=="number"?J.toFixed(de):"".concat(J),De=J!==I||Ue!=="".concat(pe);return"value"in this.props?(pe=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:pe},K)):this.setState({value:J,inputValue:this.toPrecisionAsStep(U)},K),De&&this.props.onChange(J),J}},{key:"getMaxPrecision",value:function(U){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,de=this.props,J=de.precision,be=de.step;if(F(J))return J;var I=this.getPrecision(K),y=this.getPrecision(be),pe=this.getPrecision(U);return U?Math.max(pe,I+y):I+y}},{key:"getPrecisionFactor",value:function(U){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,de=this.getMaxPrecision(U,K);return Math.pow(10,de)}},{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(U){return this.props.formatter?this.props.formatter(U):U}},{key:"toPrecisionAsStep",value:function(U){if(this.isNotCompleteNumber(U)||U==="")return U;var K=Math.abs(this.getMaxPrecision(U));return isNaN(K)?U.toString():Number(U).toFixed(K)}},{key:"toNumber",value:function(U){var K=this.props.precision,de=this.state.focused,J=U&&U.length>16&&de;return this.isNotCompleteNumber(U)||J?U:F(K)?Math.round(U*Math.pow(10,K))/Math.pow(10,K):Number(U)}},{key:"upStep",value:function(U,K){var de=this.props.step,J=this.getPrecisionFactor(U,K),be=Math.abs(this.getMaxPrecision(U,K)),I=((J*U+J*de*K)/J).toFixed(be);return this.toNumber(I)}},{key:"downStep",value:function(U,K){var de=this.props.step,J=this.getPrecisionFactor(U,K),be=Math.abs(this.getMaxPrecision(U,K)),I=((J*U-J*de*K)/J).toFixed(be);return this.toNumber(I)}},{key:"step",value:function(U,K){var de=this,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,be=arguments.length>3?arguments[3]:void 0;this.stop(),K&&(K.persist(),K.preventDefault());var I=this.props;if(I.disabled)return;var y=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(y))return;var pe=this["".concat(U,"Step")](y,J),Ue=pe>I.max||pe<I.min;if(pe>I.max?pe=I.max:pe<I.min&&(pe=I.min),this.setValue(pe,null),this.setState({focused:!0},function(){de.pressingUpOrDown=!1}),Ue)return;this.autoStepTimer=setTimeout(function(){de[U](K,J,!0)},be?L:ee)}},{key:"fixCaret",value:function(U,K){if(U===void 0||K===void 0||!this.input||!this.input.value)return;try{var de=this.input.selectionStart,J=this.input.selectionEnd;(U!==de||K!==J)&&this.input.setSelectionRange(U,K)}catch(be){}}},{key:"render",value:function(){var U,K=this.props,de=K.prefixCls,J=K.disabled,be=K.readOnly,I=K.useTouch,y=K.autoComplete,pe=K.upHandler,Ue=K.downHandler,De=K.className,nt=K.max,Ne=K.min,Pe=K.style,ae=K.title,Z=K.onMouseEnter,ye=K.onMouseLeave,W=K.onMouseOver,T=K.onMouseOut,Ce=K.required,We=K.onClick,Ze=K.tabIndex,Be=K.type,H=K.placeholder,G=K.id,he=K.inputMode,ke=K.pattern,Me=K.step,Ge=K.maxLength,et=K.autoFocus,Ke=K.name,yt=K.onPaste,ct=K.onInput,gt=Object(q.a)(K,["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"]),st=this.state,Ot=st.value,xt=st.focused,wt=_()(de,(U={},Object(_e.a)(U,De,!!De),Object(_e.a)(U,"".concat(de,"-disabled"),J),Object(_e.a)(U,"".concat(de,"-focused"),xt),U)),Le={};Object.keys(gt).forEach(function(V){(V.substr(0,5)==="data-"||V.substr(0,5)==="aria-"||V==="role")&&(Le[V]=gt[V])});var ft=!be&&!J,At=this.getInputDisplayValue(null),He=(Ot||Ot===0)&&(isNaN(Ot)||Number(Ot)>=nt),Xe=(Ot||Ot===0)&&(isNaN(Ot)||Number(Ot)<=Ne),$=He||J||be,ne=Xe||J||be,ie=_()("".concat(de,"-handler"),"".concat(de,"-handler-up"),Object(_e.a)({},"".concat(de,"-handler-up-disabled"),$)),P=_()("".concat(de,"-handler"),"".concat(de,"-handler-down"),Object(_e.a)({},"".concat(de,"-handler-down-disabled"),ne)),D=I?{onTouchStart:$?m:this.up,onTouchEnd:this.stop}:{onMouseDown:$?m:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},X=I?{onTouchStart:ne?m:this.down,onTouchEnd:this.stop}:{onMouseDown:ne?m:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return N.a.createElement("div",{className:wt,style:Pe,title:ae,onMouseEnter:Z,onMouseLeave:ye,onMouseOver:W,onMouseOut:T,onFocus:function(){return null},onBlur:function(){return null}},N.a.createElement("div",{className:"".concat(de,"-handler-wrap")},N.a.createElement("span",Object.assign({unselectable:"on"},D,{role:"button","aria-label":"Increase Value","aria-disabled":$,className:ie}),pe||N.a.createElement("span",{unselectable:"on",className:"".concat(de,"-handler-up-inner"),onClick:v})),N.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Decrease Value","aria-disabled":ne,className:P}),Ue||N.a.createElement("span",{unselectable:"on",className:"".concat(de,"-handler-down-inner"),onClick:v}))),N.a.createElement("div",{className:"".concat(de,"-input-wrap")},N.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Ne,"aria-valuemax":nt,"aria-valuenow":Ot,required:Ce,type:Be,placeholder:H,onPaste:yt,onClick:We,onMouseUp:this.onMouseUp,className:"".concat(de,"-input"),tabIndex:Ze,autoComplete:y,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ft?this.onKeyDown:m,onKeyUp:ft?this.onKeyUp:m,autoFocus:et,maxLength:Ge,readOnly:be,disabled:J,max:nt,min:Ne,step:Me,name:Ke,title:ae,id:G,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(At),pattern:ke,inputMode:he,onInput:ct},Le))))}}]),Q}(N.a.Component);se.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:oe,min:-oe,step:1,style:{},onChange:m,onKeyDown:m,onPressEnter:m,onFocus:m,onBlur:m,parser:f,required:!1,autoComplete:"off"};var j=se,re=ue.a=j},"e+RI":function(rt,ue,l){rt.exports={btn:"btn___35XHi",s1:"s1___yzdGB",s2:"s2___3kxXm",btnDisabled:"btnDisabled___lI9pA",btn2:"btn2___2KLJQ"}},"eS0+":function(rt,ue,l){"use strict";var q=l("giR+"),_e=l("fyUT"),me=l("tJVT"),we=l("PpiC"),Ee=l("OaEy"),fe=l("2fM7"),Y=l("q1tI"),B=l.n(Y),N=l("2sxD"),A=l.n(N),_=l("51dB"),C=l.n(_),O=l("5MlY"),x=l.n(O),w=l("lnNo"),M=l.n(w),m=l("YBdh"),v=l.n(m),f=l("LvDl"),L=l.n(f),ee=l("TSYQ"),oe=l.n(ee),F=fe.a.Option,b=function(k){var S=parseInt(k);return Object(f.isNaN)(S)?0:S},se=function(k){var S,Q,z=k.index,U=k.value,K=U===void 0?[]:U,de=k.onChange,J=k.type,be=k.disabled,I=be===void 0?!1:be,y=k.expansion,pe=y===void 0?!0:y,Ue=Object(we.a)(k,["index","value","onChange","type","disabled","expansion"]),De=Object(Y.useState)(!0),nt=Object(me.a)(De,2),Ne=nt[0],Pe=nt[1],ae=function(ye,W){var T=Object(f.cloneDeep)(K);T.difficulties[W].num=ye,console.log(T,444),de(T)};return B.a.createElement("div",{className:A.a.ListGroup,style:{borderWidth:z?1:0}},B.a.createElement("div",{className:A.a.a},z+1),B.a.createElement("div",{"data-type":"width",className:A.a.b},K==null?void 0:K.name),B.a.createElement("div",{className:A.a.c},K==null||((S=K.difficulties)===null||S===void 0)?void 0:S.map(function(Z,ye){return B.a.createElement("div",{key:ye,style:{display:Ne?"flex":ye?"none":"flex"},className:A.a.c1},B.a.createElement("span",{style:{color:"#777777",marginRight:5}},"\u96BE\u5EA6"),Z.difficulty===1&&B.a.createElement("span",{className:A.a.radio},"\u7B80\u5355"),Z.difficulty===2&&B.a.createElement("span",{className:A.a.radio},"\u9002\u4E2D"),Z.difficulty===3&&B.a.createElement("span",{className:A.a.radio},"\u56F0\u96BE"),B.a.createElement("span",{style:{color:"#777777",marginRight:5,marginLeft:50}},"\u62BD\u9898\u6570\u91CF"),z===0&&ye===0?B.a.createElement("div",{id:"".concat(J,"_sum")},B.a.createElement(_e.a,{disabled:I,parser:b,onChange:function(T){return ae(T,ye)},min:0,max:Z==null?void 0:Z.count,value:(Z==null?void 0:Z.num)||0,style:{width:66}}),B.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6570\u91CF")):B.a.createElement(_e.a,{disabled:I,parser:b,onChange:function(T){return ae(T,ye)},min:0,max:Z==null?void 0:Z.count,value:(Z==null?void 0:Z.num)||0,style:{width:66}}),B.a.createElement("span",{style:{marginLeft:5}},"/",Z==null?void 0:Z.count))})),B.a.createElement("div",{style:{display:(K==null||((Q=K.difficulties)===null||Q===void 0)?void 0:Q.length)===1||!pe?"none":"block"},onClick:function(){return Pe(!Ne)},className:A.a.d},Ne?"\u6536\u8D77":"\u5C55\u5F00",B.a.createElement("img",{style:{marginTop:-2,transform:Ne?"rotate(0deg)":"rotate(180deg)"},src:M.a,className:"ml5"})))},j=function(k){var S,Q,z=k.value,U=z===void 0?[]:z,K=k.onChange,de=k.listClassName,J=k.disabled,be=J===void 0?!1:J,I=k.expansion,y=I===void 0?!0:I,pe=Object(we.a)(k,["value","onChange","listClassName","disabled","expansion"]),Ue=Object(Y.useState)(!0),De=Object(me.a)(Ue,2),nt=De[0],Ne=De[1],Pe=function(T){var Ce,We=T.score||0,Ze=[];T==null||((Ce=T.item_banks)===null||Ce===void 0)||Ce.forEach(function(H){var G;H==null||((G=H.tag_disciplines)===null||G===void 0)||G.forEach(function(he){var ke;he==null||((ke=he.difficulties)===null||ke===void 0)||ke.forEach(function(Me){Me.num&&Ze.push(Me.num)})})});var Be=Ze.reduce(function(H,G){return H+G},0);return Be*We},ae=[{type:"SINGLE",name:"\u5355\u9009\u9898"},{type:"MULTIPLE",name:"\u591A\u9009\u9898"},{type:"COMPLETION",name:"\u586B\u7A7A\u9898"},{type:"JUDGMENT",name:"\u5224\u65AD\u9898"},{type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},{type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},{type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},{type:"COMBINATION",name:"\u7EC4\u5408\u9898"}],Z=function(T,Ce,We){var Ze=Object(f.cloneDeep)(U);Ze.item_banks[Ce].tag_disciplines[We]=T;var Be=Pe(Ze);Ze.scoreTotal=Be,console.log(Ze,"newValue"),K(Ze)},ye=function(T){var Ce=Object(f.cloneDeep)(U);Ce.score=T;var We=Pe(Ce);Ce.scoreTotal=We,K(Ce)};return B.a.createElement("div",{className:oe()(A.a.list,de)},B.a.createElement("div",{className:A.a.head},B.a.createElement("div",{className:A.a.name},B.a.createElement("b",null),B.a.createElement("span",null,(S=ae.find(function(W){return W.type===(U==null?void 0:U.item_type)}))===null||S===void 0?void 0:S.name)),B.a.createElement("div",{className:A.a.right},y&&B.a.createElement("div",{onClick:function(){return Ne(!nt)},className:"current c-light-primary mb10"},nt?"\u6536\u8D77":"\u5C55\u5F00",B.a.createElement("img",{style:{marginTop:-2,transform:nt?"rotate(0deg)":"rotate(180deg)"},src:M.a,className:"ml5"})),B.a.createElement("div",null,B.a.createElement("img",{src:C.a}),B.a.createElement("span",{className:"ml10 mr20"},"\u603B\u5206",U.scoreTotal,"\u5206"),B.a.createElement("img",{className:"mr10",src:x.a}),B.a.createElement("span",null,(U==null?void 0:U.item_type)==="COMBINATION"?"\u6BCF\u5C0F\u9898":"\u6BCF\u9898"),B.a.createElement("div",{id:"".concat(U==null?void 0:U.item_type,"_score")},B.a.createElement(_e.a,{disabled:be,parser:b,min:0,onChange:ye,value:U.score,style:{margin:"0 5px"}}),B.a.createElement("span",{style:{display:"none"}},"\u8BF7\u8F93\u5165\u6BCF\u9898\u5206\u6570")),B.a.createElement("span",null,"\u5206")))),B.a.createElement("div",{className:A.a.body,style:{display:nt?"block":"none"}},U==null||((Q=U.item_banks)===null||Q===void 0)?void 0:Q.map(function(W,T){var Ce;return B.a.createElement(B.a.Fragment,{key:T},B.a.createElement("div",{className:A.a.top},B.a.createElement("img",{src:v.a}),B.a.createElement("span",null,"\u65B9\u5411/\u8BFE\u7A0B"),B.a.createElement("b",null),B.a.createElement("aside",null,W==null?void 0:W.disciplines,"/",W==null?void 0:W.sub_discipline)),B.a.createElement("div",{className:A.a.bottom},B.a.createElement("div",{className:A.a.l},"\u77E5\u8BC6\u70B9"),B.a.createElement("div",{className:A.a.r},W==null||((Ce=W.tag_disciplines)===null||Ce===void 0)?void 0:Ce.map(function(We,Ze){return B.a.createElement(se,{expansion:y,disabled:be,type:U==null?void 0:U.item_type,key:"".concat(T,"-").concat(Ze),value:We,index:Ze,onChange:function(H){return Z(H,T,Ze)}})}))))})))};ue.a=j},exQ7:function(rt,ue,l){rt.exports=l.p+"static/te.6f9c0684.svg"},fAei:function(rt,ue,l){"use strict";l.d(ue,"a",function(){return L.a});var q=l("rePB"),_e=l("VTBJ"),me=l("KQm4"),we=l("1OyB"),Ee=l("vuIU"),fe=l("Ji7U"),Y=l("LK+K"),B=l("q1tI"),N=l("4IlW"),A=l("Kwbf"),_=l("TSYQ"),C=l.n(_),O=l("sboe"),x=l("OZM5"),w=l("815F"),M=l("ODXe"),m=l("Ff2n"),v=l("+nKL"),f=l("8XRh"),L=l("WaYH"),ee=function(Ne,Pe){var ae=Ne.className,Z=Ne.style,ye=Ne.motion,W=Ne.motionNodes,T=Ne.motionType,Ce=Ne.onMotionStart,We=Ne.onMotionEnd,Ze=Ne.active,Be=Ne.treeNodeRequiredProps,H=Object(m.a)(Ne,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),G=B.useState(!0),he=Object(M.a)(G,2),ke=he[0],Me=he[1],Ge=B.useContext(O.a),et=Ge.prefixCls,Ke=B.useRef(!1),yt=function(){Ke.current||We(),Ke.current=!0};return Object(B.useEffect)(function(){W&&T==="hide"&&ke&&Me(!1)},[W]),Object(B.useEffect)(function(){return W&&Ce(),function(){W&&yt()}},[]),W?B.createElement(f.default,Object.assign({ref:Pe,visible:ke},ye,{motionAppear:T==="show",onAppearEnd:yt,onLeaveEnd:yt}),function(ct,gt){var st=ct.className,Ot=ct.style;return B.createElement("div",{ref:gt,className:C()("".concat(et,"-treenode-motion"),st),style:Ot},W.map(function(xt){var wt=xt.data,Le=wt.key,ft=Object(m.a)(wt,["key"]),At=xt.isStart,He=xt.isEnd;delete ft.children;var Xe=Object(w.f)(Le,Be);return B.createElement(L.a,Object.assign({},ft,Xe,{active:Ze,data:xt.data,key:Le,isStart:At,isEnd:He}))}))}):B.createElement(L.a,Object.assign({domRef:Pe,className:ae,style:Z},H,{active:Ze}))};ee.displayName="MotionTreeNode";var oe=B.forwardRef(ee),F=oe;function b(){var nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Pe=nt.length,ae=Ne.length;if(Math.abs(Pe-ae)!==1)return{add:!1,key:null};function Z(ye,W){var T=new Map;ye.forEach(function(We){T.set(We,!0)});var Ce=W.filter(function(We){return!T.has(We)});return Ce.length===1?Ce[0]:null}return Pe<ae?{add:!0,key:Z(nt,Ne)}:{add:!1,key:Z(Ne,nt)}}function se(nt,Ne,Pe){var ae=nt.findIndex(function(T){var Ce=T.data;return Ce.key===Pe}),Z=nt[ae+1],ye=Ne.findIndex(function(T){var Ce=T.data;return Ce.key===Pe});if(Z){var W=Ne.findIndex(function(T){var Ce=T.data;return Ce.key===Z.data.key});return Ne.slice(ye+1,W)}return Ne.slice(ye+1)}var j={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},re=function(){},k="RC_TREE_MOTION_".concat(Math.random()),S={key:k},Q={key:k,level:0,index:0,pos:"0",node:S},z={parent:null,children:[],pos:Q.pos,data:S,isStart:[],isEnd:[]};function U(nt,Ne,Pe,ae){return Ne===!1||!Pe?nt:nt.slice(0,Math.ceil(Pe/ae)+1)}function K(nt){var Ne=nt.data.key,Pe=nt.pos;return Object(w.e)(Ne,Pe)}function de(nt){for(var Ne=String(nt.data.key),Pe=nt;Pe.parent;)Pe=Pe.parent,Ne="".concat(Pe.data.key," > ").concat(Ne);return Ne}var J=function(Ne,Pe){var ae=Ne.prefixCls,Z=Ne.data,ye=Ne.selectable,W=Ne.checkable,T=Ne.expandedKeys,Ce=Ne.selectedKeys,We=Ne.checkedKeys,Ze=Ne.loadedKeys,Be=Ne.loadingKeys,H=Ne.halfCheckedKeys,G=Ne.keyEntities,he=Ne.disabled,ke=Ne.dragging,Me=Ne.dragOverNodeKey,Ge=Ne.dropPosition,et=Ne.motion,Ke=Ne.height,yt=Ne.itemHeight,ct=Ne.virtual,gt=Ne.focusable,st=Ne.activeItem,Ot=Ne.focused,xt=Ne.tabIndex,wt=Ne.onKeyDown,Le=Ne.onFocus,ft=Ne.onBlur,At=Ne.onActiveChange,He=Ne.onListChangeStart,Xe=Ne.onListChangeEnd,$=Object(m.a)(Ne,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),ne=B.useRef(null);B.useImperativeHandle(Pe,function(){return{scrollTo:function($e){ne.current.scrollTo($e)}}});var ie=B.useState(T),P=Object(M.a)(ie,2),D=P[0],X=P[1],V=B.useState(Z),xe=Object(M.a)(V,2),ve=xe[0],Oe=xe[1],lt=B.useState(Z),Ye=Object(M.a)(lt,2),je=Ye[0],pt=Ye[1],Ut=B.useState([]),ut=Object(M.a)(Ut,2),$t=ut[0],ot=ut[1],Xt=B.useState(null),Wt=Object(M.a)(Xt,2),St=Wt[0],Yt=Wt[1];function zt(){Oe(Z),pt(Z),ot([]),Yt(null),Xe()}B.useEffect(function(){X(T);var Ae=b(D,T);if(Ae.key!==null)if(Ae.add){var $e=ve.findIndex(function(an){var jt=an.data.key;return jt===Ae.key}),Dt=U(se(ve,Z,Ae.key),ct,Ke,yt),Nt=ve.slice();Nt.splice($e+1,0,z),pt(Nt),ot(Dt),Yt("show")}else{var Jt=Z.findIndex(function(an){var jt=an.data.key;return jt===Ae.key}),Ft=U(se(Z,ve,Ae.key),ct,Ke,yt),_t=Z.slice();_t.splice(Jt+1,0,z),pt(_t),ot(Ft),Yt("hide")}else ve!==Z&&(Oe(Z),pt(Z))},[T,Z]),B.useEffect(function(){ke||zt()},[ke]);var Je=et?je:Z,ze={expandedKeys:T,selectedKeys:Ce,loadedKeys:Ze,loadingKeys:Be,checkedKeys:We,halfCheckedKeys:H,dragOverNodeKey:Me,dropPosition:Ge,keyEntities:G};return B.createElement(B.Fragment,null,Ot&&st&&B.createElement("span",{style:j,"aria-live":"assertive"},de(st)),B.createElement("div",{role:"tree"},B.createElement("input",{style:j,disabled:gt===!1||he,tabIndex:gt!==!1?xt:null,onKeyDown:wt,onFocus:Le,onBlur:ft,value:"",onChange:re})),B.createElement(v.a,Object.assign({},$,{data:Je,itemKey:K,height:Ke,fullHeight:!1,virtual:ct,itemHeight:yt,prefixCls:"".concat(ae,"-list"),ref:ne}),function(Ae){var $e=Ae.pos,Dt=Ae.data,Nt=Dt.key,Jt=Object(m.a)(Dt,["key"]),Ft=Ae.isStart,_t=Ae.isEnd,an=Object(w.e)(Nt,$e);delete Jt.children;var jt=Object(w.f)(an,ze);return B.createElement(F,Object.assign({},Jt,jt,{active:st&&Nt===st.data.key,pos:$e,data:Ae.data,isStart:Ft,isEnd:_t,motion:et,motionNodes:Nt===k?$t:null,motionType:St,onMotionStart:He,onMotionEnd:zt,treeNodeRequiredProps:ze,onMouseMove:function(){At(null)}}))}))},be=B.forwardRef(J);be.displayName="NodeList";var I=be,y=l("NvD2"),pe=function(nt){Object(fe.a)(Pe,nt);var Ne=Object(Y.a)(Pe);function Pe(){var ae;return Object(we.a)(this,Pe),ae=Ne.apply(this,arguments),ae.destroyed=!1,ae.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ae.listRef=B.createRef(),ae.onNodeDragStart=function(Z,ye){var W=ae.state,T=W.expandedKeys,Ce=W.keyEntities,We=ae.props.onDragStart,Ze=ye.props.eventKey;ae.dragNode=ye;var Be=Object(x.b)(T,Ze);ae.setState({dragging:!0,dragNodesKeys:Object(x.g)(Ze,Ce)}),ae.setExpandedKeys(Be),We&&We({event:Z,node:Object(w.b)(ye.props)})},ae.onNodeDragEnter=function(Z,ye){var W=ae.state,T=W.expandedKeys,Ce=W.keyEntities,We=W.dragNodesKeys,Ze=ae.props.onDragEnter,Be=ye.props,H=Be.pos,G=Be.eventKey;if(!ae.dragNode||We.indexOf(G)!==-1)return;var he=Object(x.c)(Z,ye);if(ae.dragNode.props.eventKey===G&&he===0){ae.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ae.setState({dragOverNodeKey:G,dropPosition:he}),ae.delayedDragEnterLogic||(ae.delayedDragEnterLogic={}),Object.keys(ae.delayedDragEnterLogic).forEach(function(ke){clearTimeout(ae.delayedDragEnterLogic[ke])}),ae.delayedDragEnterLogic[H]=window.setTimeout(function(){if(!ae.state.dragging)return;var ke=Object(me.a)(T),Me=Ce[G];Me&&(Me.children||[]).length&&(ke=Object(x.a)(T,G)),"expandedKeys"in ae.props||ae.setExpandedKeys(ke),Ze&&Ze({event:Z,node:Object(w.b)(ye.props),expandedKeys:ke})},400)},0)},ae.onNodeDragOver=function(Z,ye){var W=ae.state.dragNodesKeys,T=ae.props.onDragOver,Ce=ye.props.eventKey;if(W.indexOf(Ce)!==-1)return;if(ae.dragNode&&Ce===ae.state.dragOverNodeKey){var We=Object(x.c)(Z,ye);if(We===ae.state.dropPosition)return;ae.setState({dropPosition:We})}T&&T({event:Z,node:Object(w.b)(ye.props)})},ae.onNodeDragLeave=function(Z,ye){var W=ae.props.onDragLeave;ae.setState({dragOverNodeKey:""}),W&&W({event:Z,node:Object(w.b)(ye.props)})},ae.onNodeDragEnd=function(Z,ye){var W=ae.props.onDragEnd;ae.setState({dragOverNodeKey:""}),ae.cleanDragState(),W&&W({event:Z,node:Object(w.b)(ye.props)}),ae.dragNode=null},ae.onNodeDrop=function(Z,ye){var W=ae.state,T=W.dragNodesKeys,Ce=T===void 0?[]:T,We=W.dropPosition,Ze=ae.props.onDrop,Be=ye.props,H=Be.eventKey,G=Be.pos;if(ae.setState({dragOverNodeKey:""}),ae.cleanDragState(),Ce.indexOf(H)!==-1){Object(A.a)(!1,"Can not drop to dragNode(include it's children node)");return}var he=Object(x.k)(G),ke={event:Z,node:Object(w.b)(ye.props),dragNode:ae.dragNode?Object(w.b)(ae.dragNode.props):null,dragNodesKeys:Ce.slice(),dropPosition:We+Number(he[he.length-1]),dropToGap:!1};We!==0&&(ke.dropToGap=!0),Ze&&Ze(ke),ae.dragNode=null},ae.cleanDragState=function(){var Z=ae.state.dragging;Z&&ae.setState({dragging:!1})},ae.onNodeClick=function(Z,ye){var W=ae.props.onClick;W&&W(Z,ye)},ae.onNodeDoubleClick=function(Z,ye){var W=ae.props.onDoubleClick;W&&W(Z,ye)},ae.onNodeSelect=function(Z,ye){var W=ae.state.selectedKeys,T=ae.state.keyEntities,Ce=ae.props,We=Ce.onSelect,Ze=Ce.multiple,Be=ye.selected,H=ye.key,G=!Be;G?Ze?W=Object(x.a)(W,H):W=[H]:W=Object(x.b)(W,H);var he=W.map(function(ke){var Me=T[ke];return Me?Me.node:null}).filter(function(ke){return ke});ae.setUncontrolledState({selectedKeys:W}),We&&We(W,{event:"select",selected:G,node:ye,selectedNodes:he,nativeEvent:Z.nativeEvent})},ae.onNodeCheck=function(Z,ye,W){var T=ae.state,Ce=T.keyEntities,We=T.checkedKeys,Ze=T.halfCheckedKeys,Be=ae.props,H=Be.checkStrictly,G=Be.onCheck,he=ye.key,ke,Me={event:"check",node:ye,checked:W,nativeEvent:Z.nativeEvent};if(H){var Ge=W?Object(x.a)(We,he):Object(x.b)(We,he),et=Object(x.b)(Ze,he);ke={checked:Ge,halfChecked:et},Me.checkedNodes=Ge.map(function(Ot){return Ce[Ot]}).filter(function(Ot){return Ot}).map(function(Ot){return Ot.node}),ae.setUncontrolledState({checkedKeys:Ge})}else{var Ke=Object(y.a)([].concat(Object(me.a)(We),[he]),!0,Ce),yt=Ke.checkedKeys,ct=Ke.halfCheckedKeys;if(!W){var gt=new Set(yt);gt.delete(he);var st=Object(y.a)(Array.from(gt),{checked:!1,halfCheckedKeys:ct},Ce);yt=st.checkedKeys,ct=st.halfCheckedKeys}ke=yt,Me.checkedNodes=[],Me.checkedNodesPositions=[],Me.halfCheckedKeys=ct,yt.forEach(function(Ot){var xt=Ce[Ot];if(!xt)return;var wt=xt.node,Le=xt.pos;Me.checkedNodes.push(wt),Me.checkedNodesPositions.push({node:wt,pos:Le})}),ae.setUncontrolledState({checkedKeys:yt},!1,{halfCheckedKeys:ct})}G&&G(ke,Me)},ae.onNodeLoad=function(Z){return new Promise(function(ye){ae.setState(function(W){var T=W.loadedKeys,Ce=T===void 0?[]:T,We=W.loadingKeys,Ze=We===void 0?[]:We,Be=ae.props,H=Be.loadData,G=Be.onLoad,he=Z.key;if(!H||Ce.indexOf(he)!==-1||Ze.indexOf(he)!==-1)return{};var ke=H(Z);return ke.then(function(){var Me=ae.state,Ge=Me.loadedKeys,et=Me.loadingKeys,Ke=Object(x.a)(Ge,he),yt=Object(x.b)(et,he);G&&G(Ke,{event:"load",node:Z}),ae.setUncontrolledState({loadedKeys:Ke}),ae.setState({loadingKeys:yt}),ye()}),{loadingKeys:Object(x.a)(Ze,he)}})})},ae.onNodeMouseEnter=function(Z,ye){var W=ae.props.onMouseEnter;W&&W({event:Z,node:ye})},ae.onNodeMouseLeave=function(Z,ye){var W=ae.props.onMouseLeave;W&&W({event:Z,node:ye})},ae.onNodeContextMenu=function(Z,ye){var W=ae.props.onRightClick;W&&(Z.preventDefault(),W({event:Z,node:ye}))},ae.onFocus=function(){var Z=ae.props.onFocus;ae.setState({focused:!0}),Z&&Z.apply(void 0,arguments)},ae.onBlur=function(){var Z=ae.props.onBlur;ae.setState({focused:!1}),ae.onActiveChange(null),Z&&Z.apply(void 0,arguments)},ae.getTreeNodeRequiredProps=function(){var Z=ae.state,ye=Z.expandedKeys,W=Z.selectedKeys,T=Z.loadedKeys,Ce=Z.loadingKeys,We=Z.checkedKeys,Ze=Z.halfCheckedKeys,Be=Z.dragOverNodeKey,H=Z.dropPosition,G=Z.keyEntities;return{expandedKeys:ye||[],selectedKeys:W||[],loadedKeys:T||[],loadingKeys:Ce||[],checkedKeys:We||[],halfCheckedKeys:Ze||[],dragOverNodeKey:Be,dropPosition:H,keyEntities:G}},ae.setExpandedKeys=function(Z){var ye=ae.state.treeData,W=Object(w.d)(ye,Z);ae.setUncontrolledState({expandedKeys:Z,flattenNodes:W},!0)},ae.onNodeExpand=function(Z,ye){var W=ae.state.expandedKeys,T=ae.state.listChanging,Ce=ae.props,We=Ce.onExpand,Ze=Ce.loadData,Be=ye.key,H=ye.expanded;if(T)return;var G=W.indexOf(Be),he=!H;if(Object(A.a)(H&&G!==-1||!H&&G===-1,"Expand state not sync with index check"),he?W=Object(x.a)(W,Be):W=Object(x.b)(W,Be),ae.setExpandedKeys(W),We&&We(W,{node:ye,expanded:he,nativeEvent:Z.nativeEvent}),he&&Ze){var ke=ae.onNodeLoad(ye);ke&&ke.then(function(){var Me=Object(w.d)(ae.state.treeData,W);ae.setUncontrolledState({flattenNodes:Me})})}},ae.onListChangeStart=function(){ae.setUncontrolledState({listChanging:!0})},ae.onListChangeEnd=function(){setTimeout(function(){ae.setUncontrolledState({listChanging:!1})})},ae.onActiveChange=function(Z){var ye=ae.state.activeKey,W=ae.props.onActiveChange;if(ye===Z)return;ae.setState({activeKey:Z}),Z!==null&&ae.scrollTo({key:Z}),W&&W(Z)},ae.getActiveItem=function(){var Z=ae.state,ye=Z.activeKey,W=Z.flattenNodes;return ye===null?null:W.find(function(T){var Ce=T.data.key;return Ce===ye})||null},ae.offsetActiveKey=function(Z){var ye=ae.state,W=ye.flattenNodes,T=ye.activeKey,Ce=W.findIndex(function(Be){var H=Be.data.key;return H===T});Ce===-1&&Z<0&&(Ce=W.length),Ce=(Ce+Z+W.length)%W.length;var We=W[Ce];if(We){var Ze=We.data.key;ae.onActiveChange(Ze)}else ae.onActiveChange(null)},ae.onKeyDown=function(Z){var ye=ae.state,W=ye.activeKey,T=ye.expandedKeys,Ce=ye.checkedKeys,We=ae.props,Ze=We.onKeyDown,Be=We.checkable,H=We.selectable;switch(Z.which){case N.a.UP:{ae.offsetActiveKey(-1),Z.preventDefault();break}case N.a.DOWN:{ae.offsetActiveKey(1),Z.preventDefault();break}}var G=ae.getActiveItem();if(G&&G.data){var he=ae.getTreeNodeRequiredProps(),ke=G.data.isLeaf===!1||!!(G.data.children||[]).length,Me=Object(w.b)(Object(_e.a)(Object(_e.a)({},Object(w.f)(W,he)),{},{data:G.data,active:!0}));switch(Z.which){case N.a.LEFT:{ke&&T.includes(W)?ae.onNodeExpand({},Me):G.parent&&ae.onActiveChange(G.parent.data.key),Z.preventDefault();break}case N.a.RIGHT:{ke&&!T.includes(W)?ae.onNodeExpand({},Me):G.children&&G.children.length&&ae.onActiveChange(G.children[0].data.key),Z.preventDefault();break}case N.a.ENTER:case N.a.SPACE:{Be&&!Me.disabled&&Me.checkable!==!1&&!Me.disableCheckbox?ae.onNodeCheck({},Me,!Ce.includes(W)):!Be&&H&&!Me.disabled&&Me.selectable!==!1&&ae.onNodeSelect({},Me);break}}}Ze&&Ze(Z)},ae.setUncontrolledState=function(Z){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ae.destroyed)return;var T=!1,Ce=!0,We={};Object.keys(Z).forEach(function(Ze){if(Ze in ae.props){Ce=!1;return}T=!0,We[Ze]=Z[Ze]}),T&&(!ye||Ce)&&ae.setState(Object(_e.a)(Object(_e.a)({},We),W))},ae.scrollTo=function(Z){ae.listRef.current.scrollTo(Z)},ae}return Object(Ee.a)(Pe,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var Z,ye=this.state,W=ye.focused,T=ye.flattenNodes,Ce=ye.keyEntities,We=ye.dragging,Ze=ye.activeKey,Be=this.props,H=Be.prefixCls,G=Be.className,he=Be.style,ke=Be.showLine,Me=Be.focusable,Ge=Be.tabIndex,et=Ge===void 0?0:Ge,Ke=Be.selectable,yt=Be.showIcon,ct=Be.icon,gt=Be.switcherIcon,st=Be.draggable,Ot=Be.checkable,xt=Be.checkStrictly,wt=Be.disabled,Le=Be.motion,ft=Be.loadData,At=Be.filterTreeNode,He=Be.height,Xe=Be.itemHeight,$=Be.virtual,ne=Be.titleRender,ie=Be.onContextMenu,P=Object(x.f)(this.props);return B.createElement(O.a.Provider,{value:{prefixCls:H,selectable:Ke,showIcon:yt,icon:ct,switcherIcon:gt,draggable:st,checkable:Ot,checkStrictly:xt,disabled:wt,keyEntities:Ce,loadData:ft,filterTreeNode:At,titleRender:ne,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},B.createElement("div",{className:C()(H,G,(Z={},Object(q.a)(Z,"".concat(H,"-show-line"),ke),Object(q.a)(Z,"".concat(H,"-focused"),W),Object(q.a)(Z,"".concat(H,"-active-focused"),Ze!==null),Z))},B.createElement(I,Object.assign({ref:this.listRef,prefixCls:H,style:he,data:T,disabled:wt,selectable:Ke,checkable:!!Ot,motion:Le,dragging:We,height:He,itemHeight:Xe,virtual:$,focusable:Me,focused:W,tabIndex:et,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ie},this.getTreeNodeRequiredProps(),P))))}}],[{key:"getDerivedStateFromProps",value:function(Z,ye){var W=ye.prevProps,T={prevProps:Z};function Ce(ct){return!W&&ct in Z||W&&W[ct]!==Z[ct]}var We;if(Ce("treeData")?We=Z.treeData:Ce("children")&&(Object(A.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),We=Object(w.c)(Z.children)),We){T.treeData=We;var Ze=Object(w.a)(We);T.keyEntities=Object(_e.a)(Object(q.a)({},k,Q),Ze.keyEntities)}var Be=T.keyEntities||ye.keyEntities;if(Ce("expandedKeys")||W&&Ce("autoExpandParent"))T.expandedKeys=Z.autoExpandParent||!W&&Z.defaultExpandParent?Object(x.e)(Z.expandedKeys,Be):Z.expandedKeys;else if(!W&&Z.defaultExpandAll){var H=Object(_e.a)({},Be);delete H[k],T.expandedKeys=Object.keys(H).map(function(ct){return H[ct].key})}else!W&&Z.defaultExpandedKeys&&(T.expandedKeys=Z.autoExpandParent||Z.defaultExpandParent?Object(x.e)(Z.defaultExpandedKeys,Be):Z.defaultExpandedKeys);if(T.expandedKeys||delete T.expandedKeys,We||T.expandedKeys){var G=Object(w.d)(We||ye.treeData,T.expandedKeys||ye.expandedKeys);T.flattenNodes=G}if(Z.selectable&&(Ce("selectedKeys")?T.selectedKeys=Object(x.d)(Z.selectedKeys,Z):!W&&Z.defaultSelectedKeys&&(T.selectedKeys=Object(x.d)(Z.defaultSelectedKeys,Z))),Z.checkable){var he;if(Ce("checkedKeys")?he=Object(x.j)(Z.checkedKeys)||{}:!W&&Z.defaultCheckedKeys?he=Object(x.j)(Z.defaultCheckedKeys)||{}:We&&(he=Object(x.j)(Z.checkedKeys)||{checkedKeys:ye.checkedKeys,halfCheckedKeys:ye.halfCheckedKeys}),he){var ke=he,Me=ke.checkedKeys,Ge=Me===void 0?[]:Me,et=ke.halfCheckedKeys,Ke=et===void 0?[]:et;if(!Z.checkStrictly){var yt=Object(y.a)(Ge,!0,Be);Ge=yt.checkedKeys,Ke=yt.halfCheckedKeys}T.checkedKeys=Ge,T.halfCheckedKeys=Ke}}return Ce("loadedKeys")&&(T.loadedKeys=Z.loadedKeys),T}}]),Pe}(B.Component);pe.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},pe.TreeNode=L.a;var Ue=pe,De=ue.b=Ue},fjLI:function(rt,ue,l){"use strict";l.d(ue,"e",function(){return A}),l.d(ue,"a",function(){return _}),l.d(ue,"c",function(){return C}),l.d(ue,"d",function(){return x}),l.d(ue,"b",function(){return w});var q=l("8HAY"),_e=l("Cg/j"),me=l("T8No"),we=l("nnTU"),Ee=l("MI8n"),fe=function(){var M=function(m,v){return M=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,L){f.__proto__=L}||function(f,L){for(var ee in L)L.hasOwnProperty(ee)&&(f[ee]=L[ee])},M(m,v)};return function(m,v){M(m,v);function f(){this.constructor=m}m.prototype=v===null?Object.create(v):(f.prototype=v.prototype,new f)}}(),Y=function(M,m,v,f){var L=arguments.length,ee=L<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,v):f,oe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(M,m,v,f);else for(var F=M.length-1;F>=0;F--)(oe=M[F])&&(ee=(L<3?oe(ee):L>3?oe(m,v,ee):oe(m,v))||ee);return L>3&&ee&&Object.defineProperty(m,v,ee),ee},B=function(M,m){return function(v,f){m(v,f,M)}},N=function(){for(var M=0,m=0,v=arguments.length;m<v;m++)M+=arguments[m].length;for(var f=Array(M),L=0,m=0;m<v;m++)for(var ee=arguments[m],oe=0,F=ee.length;oe<F;oe++,L++)f[L]=ee[oe];return f};function A(M){return M.command!==void 0}var _=Object(_e.c)("menuService"),C=new(function(){function M(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new Ee.a,this.onDidChangeMenu=this._onDidChangeMenu.event}return M.prototype.addCommand=function(m){var v=this;return this._commands.set(m.id,m),this._onDidChangeMenu.fire(0),{dispose:function(){v._commands.delete(m.id)&&v._onDidChangeMenu.fire(0)}}},M.prototype.getCommand=function(m){return this._commands.get(m)},M.prototype.getCommands=function(){var m=new Map;return this._commands.forEach(function(v,f){return m.set(f,v)}),m},M.prototype.appendMenuItem=function(m,v){var f=this,L=this._menuItems.get(m);return L?L.push(v):(L=[v],this._menuItems.set(m,L)),this._onDidChangeMenu.fire(m),{dispose:function(){var ee=L.indexOf(v);ee>=0&&(L.splice(ee,1),f._onDidChangeMenu.fire(m))}}},M.prototype.getMenuItems=function(m){var v=(this._menuItems.get(m)||[]).slice(0);return m===0&&this._appendImplicitItems(v),v},M.prototype._appendImplicitItems=function(m){for(var v=new Set,f=m.filter(function(se){return A(se)}),L=0,ee=f;L<ee.length;L++){var oe=ee[L],F=oe.command,b=oe.alt;v.add(F.id),b&&v.add(b.id)}this._commands.forEach(function(se,j){v.has(j)||m.push({command:se})})},M}()),O=function(M){fe(m,M);function m(v,f,L){var ee=M.call(this,v,f)||this;return ee._commandService=L,ee}return m.prototype.run=function(){for(var v,f=[],L=0;L<arguments.length;L++)f[L]=arguments[L];return(v=this._commandService).executeCommand.apply(v,N([this.id],f))},m=Y([B(2,we.b)],m),m}(q.a),x=function(M){fe(m,M);function m(v){var f=this;return typeof v.title=="string"?f=M.call(this,"",v.title,"submenu")||this:f=M.call(this,"",v.title.value,"submenu")||this,f.item=v,f}return m}(q.a),w=function(M){fe(m,M);function m(v,f,L,ee,oe){var F=this;return typeof v.title=="string"?F=M.call(this,v.id,v.title,oe)||this:F=M.call(this,v.id,v.title.value,oe)||this,F._cssClass=void 0,F._enabled=!v.precondition||ee.contextMatchesRules(v.precondition),F._checked=Boolean(v.toggled&&ee.contextMatchesRules(v.toggled)),F._options=L||{},F.item=v,F.alt=f?new m(f,void 0,F._options,ee,oe):void 0,F}return m.prototype.dispose=function(){this.alt&&this.alt.dispose(),M.prototype.dispose.call(this)},m.prototype.run=function(){for(var v=[],f=0;f<arguments.length;f++)v[f]=arguments[f];var L=[];return this._options.arg&&(L=N(L,[this._options.arg])),this._options.shouldForwardArgs&&(L=N(L,v)),M.prototype.run.apply(this,L)},m=Y([B(3,me.c),B(4,we.b)],m),m}(O)},k4n4:function(rt,ue,l){"use strict";var q=l("tJVT"),_e=l("q1tI"),me=l.n(_e),we=l("e+RI"),Ee=l.n(we),fe=l("FTkQ"),Y=l.n(fe),B=l("E/GV"),N=l.n(B),A=function(C){var O=C.type,x=O===void 0?1:O,w=C.value,M=w===void 0?[]:w,m=C.onChange,v=C.disabled,f=v===void 0?!1:v,L=C.icon,ee=Object(_e.useState)(),oe=Object(q.a)(ee,2),F=oe[0],b=oe[1],se=function(re){m(re)};return x===1?me.a.createElement("div",null,M==null?void 0:M.map(function(j,re){return me.a.createElement("div",{key:re,className:f?"".concat(Ee.a.btn," ").concat(Ee.a.btnDisabled):Ee.a.btn},me.a.createElement("span",{className:Ee.a.s1},j.name),me.a.createElement("img",{src:Y.a,className:Ee.a.s2,onClick:function(){return se(j.id)}}))})):me.a.createElement("div",null,M==null?void 0:M.map(function(j,re){return me.a.createElement("div",{key:re,className:Ee.a.btn2},me.a.createElement("span",{className:Ee.a.s1},me.a.createElement("img",{src:L||N.a}),j.name),me.a.createElement("img",{src:Y.a,className:Ee.a.s2,onClick:function(){return se(j.id)}}))}))};ue.a=A},kSUc:function(rt,ue,l){},kqOp:function(rt,ue,l){"use strict";l.d(ue,"a",function(){return A});var q=l("0Owb"),_e=l("fWQN"),me=l("mtLc"),we=l("yKVA"),Ee=l("879j"),fe=l("q1tI"),Y=l.n(fe),B=l("Ot1p"),N="\u2581",A=function(_){Object(we.a)(O,_);var C=Object(Ee.a)(O);function O(){var x;Object(_e.a)(this,O);for(var w=arguments.length,M=new Array(w),m=0;m<w;m++)M[m]=arguments[m];return x=C.call.apply(C,[this].concat(M)),x.getChCountBeforeCursor=function(v,f){for(var L=f.line,ee=0,oe=0;oe<L;oe++)ee+=v.getLine(oe).split(N).length-1;var F=v.getLine(L).substring(0,f.ch);return ee+=F.split(N).length-1,ee},x.onCMBeforeChange=function(v,f){var L=v.getRange(f.from,f.to),ee=0;if(f.text.forEach(function(se){ee+=se.split(N).length-1}),L&&L.indexOf(N)!=-1){var oe=L.split(N).length-1,F=x.getChCountBeforeCursor(v,f.from);console.log("\u5220\u9664".concat(oe,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(F,"\u4E2A\uFF0C\u65B0\u589E").concat(ee,"\u4E2A")),x.props.deleteEmptyDisabled?f.cancel():x.props.onPlaceholderChange&&x.props.onPlaceholderChange(F,oe,ee)}else if(ee){var b=x.getChCountBeforeCursor(v,f.from);console.log("\u65B0\u589E".concat(ee,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(b,"\u4E2A")),x.props.onPlaceholderChange&&x.props.onPlaceholderChange(b,0,ee)}},x}return Object(me.a)(O,[{key:"render",value:function(){return Y.a.createElement(B.a,Object(q.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),O}(fe.Component)},lZu9:function(rt,ue,l){(function(q){q(l("VrN/"),l("1eCo"),l("8EBN"))})(function(q){"use strict";q.defineMode("markdown",function(_e,me){var we=q.getMode(_e,"text/html"),Ee=we.name=="null";function fe(I){if(q.findModeByName){var y=q.findModeByName(I);y&&(I=y.mime||y.mimes[0])}var pe=q.getMode(_e,I);return pe.name=="null"?null:pe}me.highlightFormatting===void 0&&(me.highlightFormatting=!1),me.maxBlockquoteDepth===void 0&&(me.maxBlockquoteDepth=0),me.taskLists===void 0&&(me.taskLists=!1),me.strikethrough===void 0&&(me.strikethrough=!1),me.emoji===void 0&&(me.emoji=!1),me.fencedCodeBlockHighlighting===void 0&&(me.fencedCodeBlockHighlighting=!0),me.fencedCodeBlockDefaultMode===void 0&&(me.fencedCodeBlockDefaultMode="text/plain"),me.xml===void 0&&(me.xml=!0),me.tokenTypeOverrides===void 0&&(me.tokenTypeOverrides={});var Y={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 B in Y)Y.hasOwnProperty(B)&&me.tokenTypeOverrides[B]&&(Y[B]=me.tokenTypeOverrides[B]);var N=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,_=/^\[(x| )\](?=\s)/i,C=me.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,O=/^ {0,3}(?:\={1,}|-{2,})\s*$/,x=/^[^#!\[\]*_\\<>` "'(~:]+/,w=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,M=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,v=" ";function f(I,y,pe){return y.f=y.inline=pe,pe(I,y)}function L(I,y,pe){return y.f=y.block=pe,pe(I,y)}function ee(I){return!I||!/\S/.test(I.string)}function oe(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==b){var y=Ee;if(!y){var pe=q.innerMode(we,I.htmlState);y=pe.mode.name=="xml"&&pe.state.tagStart===null&&!pe.state.context&&pe.state.tokenize.isInText}y&&(I.f=k,I.block=F,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function F(I,y){var pe=I.column()===y.indentation,Ue=ee(y.prevLine.stream),De=y.indentedCode,nt=y.prevLine.hr,Ne=y.list!==!1,Pe=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var ae=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,Ne)){for(y.list=null;ae<y.listStack[y.listStack.length-1];)y.listStack.pop(),y.listStack.length?y.indentation=y.listStack[y.listStack.length-1]:y.list=!1;y.list!==!1&&(y.indentationDiff=ae-y.listStack[y.listStack.length-1])}var Z=!Ue&&!nt&&!y.prevLine.header&&(!Ne||!De)&&!y.prevLine.fencedCodeEnd,ye=(y.list===!1||nt||Ue)&&y.indentation<=Pe&&I.match(N),W=null;if(y.indentationDiff>=4&&(De||y.prevLine.fencedCodeEnd||y.prevLine.header||Ue))return I.skipToEnd(),y.indentedCode=!0,Y.code;if(I.eatSpace())return null;if(pe&&y.indentation<=Pe&&(W=I.match(C))&&W[1].length<=6)return y.quote=0,y.header=W[1].length,y.thisLine.header=!0,me.highlightFormatting&&(y.formatting="header"),y.f=y.inline,j(y);if(y.indentation<=Pe&&I.eat(">"))return y.quote=pe?1:y.quote+1,me.highlightFormatting&&(y.formatting="quote"),I.eatSpace(),j(y);if(!ye&&!y.setext&&pe&&y.indentation<=Pe&&(W=I.match(A))){var T=W[1]?"ol":"ul";return y.indentation=ae+I.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,me.taskLists&&I.match(_,!1)&&(y.taskList=!0),y.f=y.inline,me.highlightFormatting&&(y.formatting=["list","list-"+T]),j(y)}else{if(pe&&y.indentation<=Pe&&(W=I.match(w,!0)))return y.quote=0,y.fencedEndRE=new RegExp(W[1]+"+ *$"),y.localMode=me.fencedCodeBlockHighlighting&&fe(W[2]||me.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=q.startState(y.localMode)),y.f=y.block=se,me.highlightFormatting&&(y.formatting="code-block"),y.code=-1,j(y);if(y.setext||(!Z||!Ne)&&!y.quote&&y.list===!1&&!y.code&&!ye&&!M.test(I.string)&&(W=I.lookAhead(1))&&(W=W.match(O)))return y.setext?(y.header=y.setext,y.setext=0,I.skipToEnd(),me.highlightFormatting&&(y.formatting="header")):(y.header=W[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,j(y);if(ye)return I.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,Y.hr;if(I.peek()==="[")return f(I,y,K)}return f(I,y,y.inline)}function b(I,y){var pe=we.token(I,y.htmlState);if(!Ee){var Ue=q.innerMode(we,y.htmlState);(Ue.mode.name=="xml"&&Ue.state.tagStart===null&&!Ue.state.context&&Ue.state.tokenize.isInText||y.md_inside&&I.current().indexOf(">")>-1)&&(y.f=k,y.block=F,y.htmlState=null)}return pe}function se(I,y){var pe=y.listStack[y.listStack.length-1]||0,Ue=y.indentation<pe,De=pe+3;if(y.fencedEndRE&&y.indentation<=De&&(Ue||I.match(y.fencedEndRE))){me.highlightFormatting&&(y.formatting="code-block");var nt;return Ue||(nt=j(y)),y.localMode=y.localState=null,y.block=F,y.f=k,y.fencedEndRE=null,y.code=0,y.thisLine.fencedCodeEnd=!0,Ue?L(I,y,y.block):nt}else return y.localMode?y.localMode.token(I,y.localState):(I.skipToEnd(),Y.code)}function j(I){var y=[];if(I.formatting){y.push(Y.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var pe=0;pe<I.formatting.length;pe++)y.push(Y.formatting+"-"+I.formatting[pe]),I.formatting[pe]==="header"&&y.push(Y.formatting+"-"+I.formatting[pe]+"-"+I.header),I.formatting[pe]==="quote"&&(!me.maxBlockquoteDepth||me.maxBlockquoteDepth>=I.quote?y.push(Y.formatting+"-"+I.formatting[pe]+"-"+I.quote):y.push("error"))}if(I.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(I.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(I.linkHref?y.push(Y.linkHref,"url"):(I.strong&&y.push(Y.strong),I.em&&y.push(Y.em),I.strikethrough&&y.push(Y.strikethrough),I.emoji&&y.push(Y.emoji),I.linkText&&y.push(Y.linkText),I.code&&y.push(Y.code),I.image&&y.push(Y.image),I.imageAltText&&y.push(Y.imageAltText,"link"),I.imageMarker&&y.push(Y.imageMarker)),I.header&&y.push(Y.header,Y.header+"-"+I.header),I.quote&&(y.push(Y.quote),!me.maxBlockquoteDepth||me.maxBlockquoteDepth>=I.quote?y.push(Y.quote+"-"+I.quote):y.push(Y.quote+"-"+me.maxBlockquoteDepth)),I.list!==!1){var Ue=(I.listStack.length-1)%3;Ue?Ue===1?y.push(Y.list2):y.push(Y.list3):y.push(Y.list1)}return I.trailingSpaceNewLine?y.push("trailing-space-new-line"):I.trailingSpace&&y.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function re(I,y){return I.match(x,!0)?j(y):void 0}function k(I,y){var pe=y.text(I,y);if(typeof pe!="undefined")return pe;if(y.list)return y.list=null,j(y);if(y.taskList){var Ue=I.match(_,!0)[1]===" ";return Ue?y.taskOpen=!0:y.taskClosed=!0,me.highlightFormatting&&(y.formatting="task"),y.taskList=!1,j(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&I.match(/^#+$/,!0))return me.highlightFormatting&&(y.formatting="header"),j(y);var De=I.next();if(y.linkTitle){y.linkTitle=!1;var nt=De;De==="("&&(nt=")"),nt=(nt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ne="^\\s*(?:[^"+nt+"\\\\]+|\\\\\\\\|\\\\.)"+nt;if(I.match(new RegExp(Ne),!0))return Y.linkHref}if(De==="`"){var Pe=y.formatting;me.highlightFormatting&&(y.formatting="code"),I.eatWhile("`");var ae=I.current().length;if(y.code==0&&(!y.quote||ae==1))return y.code=ae,j(y);if(ae==y.code){var Z=j(y);return y.code=0,Z}else return y.formatting=Pe,j(y)}else if(y.code)return j(y);if(De==="\\"&&(I.next(),me.highlightFormatting)){var ye=j(y),W=Y.formatting+"-escape";return ye?ye+" "+W:W}if(De==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,me.highlightFormatting&&(y.formatting="image"),j(y);if(De==="["&&y.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,me.highlightFormatting&&(y.formatting="image"),j(y);if(De==="]"&&y.imageAltText){me.highlightFormatting&&(y.formatting="image");var ye=j(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=Q,ye}if(De==="["&&!y.image)return y.linkText&&I.match(/^.*?\]/)||(y.linkText=!0,me.highlightFormatting&&(y.formatting="link")),j(y);if(De==="]"&&y.linkText){me.highlightFormatting&&(y.formatting="link");var ye=j(y);return y.linkText=!1,y.inline=y.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?Q:k,ye}if(De==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=S,me.highlightFormatting&&(y.formatting="link");var ye=j(y);return ye?ye+=" ":ye="",ye+Y.linkInline}if(De==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=S,me.highlightFormatting&&(y.formatting="link");var ye=j(y);return ye?ye+=" ":ye="",ye+Y.linkEmail}if(me.xml&&De==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var T=I.string.indexOf(">",I.pos);if(T!=-1){var Ce=I.string.substring(I.start,T);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ce)&&(y.md_inside=!0)}return I.backUp(1),y.htmlState=q.startState(we),L(I,y,b)}if(me.xml&&De==="<"&&I.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(De==="*"||De==="_"){for(var We=1,Ze=I.pos==1?" ":I.string.charAt(I.pos-2);We<3&&I.eat(De);)We++;var Be=I.peek()||" ",H=!/\s/.test(Be)&&(!m.test(Be)||/\s/.test(Ze)||m.test(Ze)),G=!/\s/.test(Ze)&&(!m.test(Ze)||/\s/.test(Be)||m.test(Be)),he=null,ke=null;if(We%2&&(!y.em&&H&&(De==="*"||!G||m.test(Ze))?he=!0:y.em==De&&G&&(De==="*"||!H||m.test(Be))&&(he=!1)),We>1&&(!y.strong&&H&&(De==="*"||!G||m.test(Ze))?ke=!0:y.strong==De&&G&&(De==="*"||!H||m.test(Be))&&(ke=!1)),ke!=null||he!=null){me.highlightFormatting&&(y.formatting=he==null?"strong":ke==null?"em":"strong em"),he===!0&&(y.em=De),ke===!0&&(y.strong=De);var Z=j(y);return he===!1&&(y.em=!1),ke===!1&&(y.strong=!1),Z}}else if(De===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return j(y);I.backUp(1)}if(me.strikethrough){if(De==="~"&&I.eatWhile(De)){if(y.strikethrough){me.highlightFormatting&&(y.formatting="strikethrough");var Z=j(y);return y.strikethrough=!1,Z}else if(I.match(/^[^\s]/,!1))return y.strikethrough=!0,me.highlightFormatting&&(y.formatting="strikethrough"),j(y)}else if(De===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return j(y);I.backUp(2)}}if(me.emoji&&De===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,me.highlightFormatting&&(y.formatting="emoji");var Me=j(y);return y.emoji=!1,Me}return De===" "&&(I.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),j(y)}function S(I,y){var pe=I.next();if(pe===">"){y.f=y.inline=k,me.highlightFormatting&&(y.formatting="link");var Ue=j(y);return Ue?Ue+=" ":Ue="",Ue+Y.linkInline}return I.match(/^[^>]+/,!0),Y.linkInline}function Q(I,y){if(I.eatSpace())return null;var pe=I.next();return pe==="("||pe==="["?(y.f=y.inline=U(pe==="("?")":"]"),me.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,j(y)):"error"}var z={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function U(I){return function(y,pe){var Ue=y.next();if(Ue===I){pe.f=pe.inline=k,me.highlightFormatting&&(pe.formatting="link-string");var De=j(pe);return pe.linkHref=!1,De}return y.match(z[I]),pe.linkHref=!0,j(pe)}}function K(I,y){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=de,I.next(),me.highlightFormatting&&(y.formatting="link"),y.linkText=!0,j(y)):f(I,y,k)}function de(I,y){if(I.match(/^\]:/,!0)){y.f=y.inline=J,me.highlightFormatting&&(y.formatting="link");var pe=j(y);return y.linkText=!1,pe}return I.match(/^([^\]\\]|\\.)+/,!0),Y.linkText}function J(I,y){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?y.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),y.f=y.inline=k,Y.linkHref+" url")}var be={startState:function(){return{f:F,prevLine:{stream:null},thisLine:{stream:null},block:F,htmlState:null,indentation:0,inline:k,text:re,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(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&q.copyState(we,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?q.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,y){if(y.formatting=!1,I!=y.thisLine.stream){if(y.header=0,y.hr=!1,I.match(/^\s*$/,!0))return oe(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:I},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=b)){var pe=I.match(/^\s*/,!0)[0].replace(/\t/g,v).length;if(y.indentation=pe,y.indentationDiff=null,pe>0)return null}}return y.f(I,y)},innerMode:function(I){return I.block==b?{state:I.htmlState,mode:we}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:be}},indent:function(I,y,pe){return I.block==b&&we.indent?we.indent(I.htmlState,y,pe):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,y,pe):q.Pass},blankLine:oe,getType:j,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return be},"xml"),q.defineMIME("text/markdown","markdown"),q.defineMIME("text/x-markdown","markdown")})},lnNo:function(rt,ue,l){rt.exports=l.p+"static/up.69f3b3fd.svg"},m3fD:function(rt,ue,l){rt.exports={flex_box_center:"flex_box_center___1w3aZ",flex_space_between:"flex_space_between___26eB1",flex_box_vertical_center:"flex_box_vertical_center___LffUi",flex_box_center_end:"flex_box_center_end___2AiD3",flex_box_column:"flex_box_column___hZDm1",wrap:"wrap___3Du1e",btns:"btns___35pkF",crumbs:"crumbs___3CPsi",oneWrap:"oneWrap___3F99r",title:"title___2n1na",formWrap:"formWrap___3CHwR",rb:"rb___19sZ1"}},nnTU:function(rt,ue,l){"use strict";l.d(ue,"b",function(){return B}),l.d(ue,"a",function(){return N});var q=l("pmY6"),_e=l("746U"),me=l("Cg/j"),we=l("MI8n"),Ee=l("24hK"),fe=l("QDVR"),Y=function(){for(var A=0,_=0,C=arguments.length;_<C;_++)A+=arguments[_].length;for(var O=Array(A),x=0,_=0;_<C;_++)for(var w=arguments[_],M=0,m=w.length;M<m;M++,x++)O[x]=w[M];return O},B=Object(me.c)("commandService"),N=new(function(){function A(){this._commands=new Map,this._onDidRegisterCommand=new we.a,this.onDidRegisterCommand=this._onDidRegisterCommand.event}return A.prototype.registerCommand=function(_,C){var O=this;if(!_)throw new Error("invalid command");if(typeof _=="string"){if(!C)throw new Error("invalid command");return this.registerCommand({id:_,handler:C})}if(_.description){for(var x=[],w=0,M=_.description.args;w<M.length;w++){var m=M[w];x.push(m.constraint)}var v=_.handler;_.handler=function(F){for(var b=[],se=1;se<arguments.length;se++)b[se-1]=arguments[se];return Object(_e.m)(b,x),v.apply(void 0,Y([F],b))}}var f=_.id,L=this._commands.get(f);L||(L=new Ee.a,this._commands.set(f,L));var ee=L.unshift(_),oe=Object(q.h)(function(){ee();var F=O._commands.get(f);(F==null?void 0:F.isEmpty())&&O._commands.delete(f)});return this._onDidRegisterCommand.fire(f),oe},A.prototype.registerCommandAlias=function(_,C){return N.registerCommand(_,function(O){for(var x,w=[],M=1;M<arguments.length;M++)w[M-1]=arguments[M];return(x=O.get(B)).executeCommand.apply(x,Y([C],w))})},A.prototype.getCommand=function(_){var C=this._commands.get(_);return!C||C.isEmpty()?void 0:C.iterator().next().value},A.prototype.getCommands=function(){for(var _=new Map,C=0,O=Object(fe.d)(this._commands);C<O.length;C++){var x=O[C],w=this.getCommand(x);w&&_.set(x,w)}return _},A}())},osHv:function(rt,ue,l){(function(q){q(l("VrN/"))})(function(q){"use strict";var _e=q.Pos;function me(m,v){return m.line-v.line||m.ch-v.ch}var we="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",Ee=we+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",fe=new RegExp("<(/?)(["+we+"]["+Ee+"]*)","g");function Y(m,v,f,L){this.line=v,this.ch=f,this.cm=m,this.text=m.getLine(v),this.min=L?Math.max(L.from,m.firstLine()):m.firstLine(),this.max=L?Math.min(L.to-1,m.lastLine()):m.lastLine()}function B(m,v){var f=m.cm.getTokenTypeAt(_e(m.line,v));return f&&/\btag\b/.test(f)}function N(m){return m.line>=m.max?void 0:(m.ch=0,m.text=m.cm.getLine(++m.line),!0)}function A(m){return m.line<=m.min?void 0:(m.text=m.cm.getLine(--m.line),m.ch=m.text.length,!0)}function _(m){for(;;){var v=m.text.indexOf(">",m.ch);if(v==-1){if(N(m))continue;return}if(!B(m,v+1)){m.ch=v+1;continue}var f=m.text.lastIndexOf("/",v),L=f>-1&&!/\S/.test(m.text.slice(f+1,v));return m.ch=v+1,L?"selfClose":"regular"}}function C(m){for(;;){var v=m.ch?m.text.lastIndexOf("<",m.ch-1):-1;if(v==-1){if(A(m))continue;return}if(!B(m,v+1)){m.ch=v;continue}fe.lastIndex=v,m.ch=v;var f=fe.exec(m.text);if(f&&f.index==v)return f}}function O(m){for(;;){fe.lastIndex=m.ch;var v=fe.exec(m.text);if(!v){if(N(m))continue;return}if(!B(m,v.index+1)){m.ch=v.index+1;continue}return m.ch=v.index+v[0].length,v}}function x(m){for(;;){var v=m.ch?m.text.lastIndexOf(">",m.ch-1):-1;if(v==-1){if(A(m))continue;return}if(!B(m,v+1)){m.ch=v;continue}var f=m.text.lastIndexOf("/",v),L=f>-1&&!/\S/.test(m.text.slice(f+1,v));return m.ch=v+1,L?"selfClose":"regular"}}function w(m,v){for(var f=[];;){var L=O(m),ee,oe=m.line,F=m.ch-(L?L[0].length:0);if(!L||!(ee=_(m)))return;if(ee=="selfClose")continue;if(L[1]){for(var b=f.length-1;b>=0;--b)if(f[b]==L[2]){f.length=b;break}if(b<0&&(!v||v==L[2]))return{tag:L[2],from:_e(oe,F),to:_e(m.line,m.ch)}}else f.push(L[2])}}function M(m,v){for(var f=[];;){var L=x(m);if(!L)return;if(L=="selfClose"){C(m);continue}var ee=m.line,oe=m.ch,F=C(m);if(!F)return;if(F[1])f.push(F[2]);else{for(var b=f.length-1;b>=0;--b)if(f[b]==F[2]){f.length=b;break}if(b<0&&(!v||v==F[2]))return{tag:F[2],from:_e(m.line,m.ch),to:_e(ee,oe)}}}}q.registerHelper("fold","xml",function(m,v){for(var f=new Y(m,v.line,0);;){var L=O(f);if(!L||f.line!=v.line)return;var ee=_(f);if(!ee)return;if(!L[1]&&ee!="selfClose"){var oe=_e(f.line,f.ch),F=w(f,L[2]);return F&&me(F.from,oe)>0?{from:oe,to:F.from}:null}}}),q.findMatchingTag=function(m,v,f){var L=new Y(m,v.line,v.ch,f);if(L.text.indexOf(">")==-1&&L.text.indexOf("<")==-1)return;var ee=_(L),oe=ee&&_e(L.line,L.ch),F=ee&&C(L);if(!ee||!F||me(L,v)>0)return;var b={from:_e(L.line,L.ch),to:oe,tag:F[2]};return ee=="selfClose"?{open:b,close:null,at:"open"}:F[1]?{open:M(L,F[2]),close:b,at:"close"}:(L=new Y(m,oe.line,oe.ch,f),{open:b,close:w(L,F[2]),at:"open"})},q.findEnclosingTag=function(m,v,f,L){for(var ee=new Y(m,v.line,v.ch,f);;){var oe=M(ee,L);if(!oe)break;var F=new Y(m,v.line,v.ch,f),b=w(F,oe.tag);if(b)return{open:oe,close:b}}},q.scanForClosingTag=function(m,v,f,L){var ee=new Y(m,v.line,v.ch,L?{from:0,to:L}:null);return w(ee,f)}})},p5ED:function(rt,ue,l){"use strict";var q=l("+L6B"),_e=l("2/Rp"),me=l("5Dmo"),we=l("3S7+"),Ee=l("k1fw"),fe=l("9og8"),Y=l("tJVT"),B=l("WmNS"),N=l.n(B),A=l("q1tI"),_=l.n(A),C=l("vHTk"),O=l.n(C),x=l("yEEn"),w=l("ZW9T"),M=l("1vsH"),m=l("V0Rq"),v=l("m3rI");ue.a=function(f){var L,ee,oe,F,b,se,j=f.editOffice,re=j===void 0?"view":j,k=f.name,S=f.data,Q=f.theme,z=f.type,U=f.filename,K=f.monacoEditor,de=f.className,J=f.style,be=f.close,I=f.onClose,y=f.hasMask,pe=f.disabledDownload,Ue=f.onImgDimensions,De=f.otherData,nt=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),Ne=Object(Y.a)(nt,2),Pe=Ne[0],ae=Ne[1],Z=Object(A.useState)(""),ye=Object(Y.a)(Z,2),W=ye[0],T=ye[1],Ce=Object(A.useState)(),We=Object(Y.a)(Ce,2),Ze=We[0],Be=We[1],H=window.ENV==="build"?"/react/build":"",G=location.host.startsWith("localhost")?v.a.PROXY_SERVER:v.a.API_SERVER,he,ke=1024*1024,Me=10*ke,Ge=Object(A.useRef)();(L=S)!==null&&L!==void 0&&L.startsWith("/api")&&z!=="txt"&&(S=v.a.API_SERVER+S),z==="office"&&(he=Object(M.P)(S).filesize,he>Me&&(z="other")),U&&(K.filename=U),Object(A.useEffect)(function(){var ct,gt,st=(ct=document.cookie)===null||ct===void 0||((gt=ct.replace(/\s/g,""))===null||gt===void 0)?void 0:gt.split(";");st==null||st.map(function(Ot){var xt=Ot.split("=");xt[0]==="_educoder_session"&&T(xt[1])})},[]),Object(A.useEffect)(function(){z==="office"&&et()},[z,S]);var et=function(){var ct=Object(fe.a)(N.a.mark(function gt(){var st,Ot,xt;return N.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return console.log("data:",S),st=S,S.startsWith("http")||(st=location.origin+st),Ot=new URL(st).pathname.split("/").pop(),Le.next=6,Object(m.U)({attachment_id:Ot});case 6:xt=Le.sent,Be(xt);case 8:case"end":return Le.stop()}},gt)}));return function(){return ct.apply(this,arguments)}}(),Ke=function(){if(S.startsWith("http")||S.startsWith("blob:")){yt();return}Object(M.x)(U||"educoder",S,U)},yt=function(){Object(M.v)(U||"educoder",decodeURIComponent(S))};return _.a.createElement("div",{style:Object(Ee.a)({},J||{}),className:"".concat(y&&O.a.bgBlack," ").concat(z?O.a.wrp:"hide")},be&&_.a.createElement("div",{className:O.a.close,ref:Ge},!!Ue&&_.a.createElement(we.a,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:function(){return Ge.current}},_.a.createElement("span",{onClick:function(){I(),Ue()}},_.a.createElement("i",{className:"icon-yulanpizhu"}))),!pe&&_.a.createElement(we.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ge.current}},_.a.createElement("span",{onClick:yt},_.a.createElement("i",{className:"icon-quxiaozhiding"}))),_.a.createElement(we.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ge.current}},_.a.createElement("span",{className:"",onClick:I},_.a.createElement("i",{className:"icon-guanbi1"})))),_.a.createElement("div",{className:"".concat(O.a[de]," ").concat(de," ").concat(O.a.monaco," ").concat(z==="txt"?"show":"hide")},z==="txt"&&_.a.createElement(w.b,K)),z==="audio"&&_.a.createElement("audio",{src:"".concat(((ee=S)===null||ee===void 0?void 0:ee.indexOf("http://"))>-1||((oe=S)===null||oe===void 0?void 0:oe.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(S),autoPlay:!0}),z==="video"&&_.a.createElement(_.a.Fragment,null,((F=S)===null||F===void 0?void 0:F.indexOf("http"))>-1?_.a.createElement("video",{controls:!0,src:"".concat(S),autoPlay:!0}):_.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(S),autoPlay:!0})),z==="office"&&Ze&&_.a.createElement("iframe",{src:"".concat(H,"/office.html?key=").concat(Ze.key,"&url=").concat(G+Ze.url,"&callbackUrl=").concat(G+Ze.callbackUrl,"&fileType=").concat(Ze.fileType,"&title=").concat(Ze.title,"&model=").concat(re,"&officeServer=").concat(v.a.OFFICE_SERVER,"&disabledDownload=").concat(!!pe)}),(z==="xlsx"||z==="doc"||z==="pptx"||z==="docx")&&_.a.createElement("iframe",{src:"/react/build/office.html?key=".concat(De.key,"&url=").concat(v.a.API_SERVER+De.url,"&callbackUrl=").concat(v.a.API_SERVER+De.callbackUrl,"&fileType=").concat(De.fileType,"&title=").concat(De.title,"&model=").concat(De.model)}),z==="html"&&_.a.createElement("iframe",{src:S+"&disposition=inline"}),z==="pdf"&&_.a.createElement("embed",{className:O.a.embed,src:S}),z==="image"&&_.a.createElement("img",{src:"".concat(((b=S)===null||b===void 0?void 0:b.indexOf("http://"))>-1||((se=S)===null||se===void 0?void 0:se.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(S)}),z==="other"&&_.a.createElement("div",null,_.a.createElement(_e.a,{type:"primary",size:"large",onClick:Ke},_.a.createElement(x.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),z==="download"&&_.a.createElement(_e.a,{type:"primary",size:"large",onClick:Ke},_.a.createElement(x.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(rt,ue,l){},pmY6:function(rt,ue,l){"use strict";l.d(ue,"g",function(){return Ee}),l.d(ue,"f",function(){return fe}),l.d(ue,"e",function(){return Y}),l.d(ue,"h",function(){return B}),l.d(ue,"b",function(){return N}),l.d(ue,"a",function(){return A}),l.d(ue,"d",function(){return _}),l.d(ue,"c",function(){return C});var q=!1,_e="__is_disposable_tracked__";function me(O){if(!q)return;if(O&&O!==A.None)try{O[_e]=!0}catch(x){}}function we(O){if(!q)return O;var x=new Error("Potentially leaked disposable").stack;return setTimeout(function(){O[_e]||console.log(x)},3e3),O}function Ee(O){return typeof O.dispose=="function"&&O.dispose.length===0}function fe(O){return Array.isArray(O)?(O.forEach(function(x){x&&(me(x),x.dispose())}),[]):O?(me(O),O.dispose(),O):void 0}function Y(){for(var O=[],x=0;x<arguments.length;x++)O[x]=arguments[x];return O.forEach(me),we({dispose:function(){return fe(O)}})}function B(O){var x=we({dispose:function(){me(x),O()}});return x}var N=function(){function O(){this._toDispose=new Set,this._isDisposed=!1}return O.prototype.dispose=function(){if(this._isDisposed)return;me(this),this._isDisposed=!0,this.clear()},O.prototype.clear=function(){this._toDispose.forEach(function(x){return x.dispose()}),this._toDispose.clear()},O.prototype.add=function(x){if(!x)return x;if(x===this)throw new Error("Cannot register a disposable on itself!");return me(x),this._isDisposed?console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(x),x},O}(),A=function(){function O(){this._store=new N,we(this)}return O.prototype.dispose=function(){me(this),this._store.dispose()},O.prototype._register=function(x){if(x===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(x)},O.None=Object.freeze({dispose:function(){}}),O}(),_=function(){function O(){this._isDisposed=!1,we(this)}return Object.defineProperty(O.prototype,"value",{get:function(){return this._isDisposed?void 0:this._value},set:function(x){if(this._isDisposed||x===this._value)return;this._value&&this._value.dispose(),x&&me(x),this._value=x},enumerable:!0,configurable:!0}),O.prototype.clear=function(){this.value=void 0},O.prototype.dispose=function(){this._isDisposed=!0,me(this),this._value&&this._value.dispose(),this._value=void 0},O}(),C=function(){function O(x){this.object=x}return O.prototype.dispose=function(){},O}()},"rAM+":function(rt,ue,l){"use strict";l.d(ue,"a",function(){return _e});var q=l("Qw5x");function _e(me,we){var Ee;if(typeof Symbol=="undefined"||me[Symbol.iterator]==null){if(Array.isArray(me)||(Ee=Object(q.a)(me))||we&&me&&typeof me.length=="number"){Ee&&(me=Ee);var fe=0,Y=function(){};return{s:Y,n:function(){return fe>=me.length?{done:!0}:{done:!1,value:me[fe++]}},e:function(C){throw C},f:Y}}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 B=!0,N=!1,A;return{s:function(){Ee=me[Symbol.iterator]()},n:function(){var C=Ee.next();return B=C.done,C},e:function(C){N=!0,A=C},f:function(){try{!B&&Ee.return!=null&&Ee.return()}finally{if(N)throw A}}}}},rUJ1:function(rt,ue){const l=/[&<>"']/,q=/[&<>"']/g,_e=/[<>"']|&(?!#?\w+;)/,me=/[<>"']|&(?!#?\w+;)/g,we={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ee=se=>we[se];function fe(se,j){if(j){if(l.test(se))return se.replace(q,Ee)}else if(_e.test(se))return se.replace(me,Ee);return se}const Y=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function B(se){return se.replace(Y,(j,re)=>(re=re.toLowerCase(),re==="colon"?":":re.charAt(0)==="#"?re.charAt(1)==="x"?String.fromCharCode(parseInt(re.substring(2),16)):String.fromCharCode(+re.substring(1)):""))}const N=/(^|[^\[])\^/g;function A(se,j){se=se.source||se,j=j||"";const re={replace:(k,S)=>(S=S.source||S,S=S.replace(N,"$1"),se=se.replace(k,S),re),getRegex:()=>new RegExp(se,j)};return re}const _=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(se,j,re){if(se){let k;try{k=decodeURIComponent(B(re)).replace(_,"").toLowerCase()}catch(S){return null}if(k.indexOf("javascript:")===0||k.indexOf("vbscript:")===0||k.indexOf("data:")===0)return null}j&&!C.test(re)&&(re=v(j,re));try{re=encodeURI(re).replace(/%25/g,"%")}catch(k){return null}return re}const x={},w=/^[^:]+:\/*[^/]*$/,M=/^([^:]+:)[\s\S]*$/,m=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(se,j){x[" "+se]||(w.test(se)?x[" "+se]=se+"/":x[" "+se]=oe(se,"/",!0)),se=x[" "+se];const re=se.indexOf(":")===-1;return j.substring(0,2)==="//"?re?j:se.replace(M,"$1")+j:j.charAt(0)==="/"?re?j:se.replace(m,"$1")+j:se+j}const f={exec:function(){}};function L(se){let j=1,re,k;for(;j<arguments.length;j++){re=arguments[j];for(k in re)Object.prototype.hasOwnProperty.call(re,k)&&(se[k]=re[k])}return se}function ee(se,j){const re=se.replace(/\|/g,(Q,z,U)=>{let K=!1,de=z;for(;--de>=0&&U[de]==="\\";)K=!K;return K?"|":" |"}),k=re.split(/ \|/);let S=0;if(k.length>j)k.splice(j);else for(;k.length<j;)k.push("");for(;S<k.length;S++)k[S]=k[S].trim().replace(/\\\|/g,"|");return k}function oe(se,j,re){const k=se.length;if(k===0)return"";let S=0;for(;S<k;){const Q=se.charAt(k-S-1);if(Q===j&&!re)S++;else if(Q!==j&&re)S++;else break}return se.substr(0,k-S)}function F(se,j){if(se.indexOf(j[1])===-1)return-1;const re=se.length;let k=0,S=0;for(;S<re;S++)if(se[S]==="\\")S++;else if(se[S]===j[0])k++;else if(se[S]===j[1]&&(k--,k<0))return S;return-1}function b(se){se&&se.sanitize&&!se.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")}rt.exports={escape:fe,unescape:B,edit:A,cleanUrl:O,resolveUrl:v,noopTest:f,merge:L,splitCells:ee,rtrim:oe,findClosingBracket:F,checkSanitizeDeprecation:b}},sbIO:function(rt,ue,l){"use strict";var q=l("DjyN"),_e=l("NUBc"),me=l("5Dmo"),we=l("3S7+"),Ee=l("/zsF"),fe=l("PArb"),Y=l("Q9mQ"),B=l("diRs"),N=l("+L6B"),A=l("2/Rp"),_=l("5NDa"),C=l("5rEg"),O=l("miYZ"),x=l("tsqr"),w=l("9og8"),M=l("giR+"),m=l("fyUT"),v=l("2qtc"),f=l("kLXV"),L=l("tJVT"),ee=l("WmNS"),oe=l.n(ee),F=l("q1tI"),b=l.n(F),se=l("PsQE"),j=l.n(se),re=l("0eGx"),k=l.n(re),S=l("9Bee"),Q=l("Ty5D"),z=l("9kvl"),U=l("ErOA"),K=l("+yhJ"),de=l.n(K),J=l("RZ/O"),be=l.n(J),I=l("LvDl"),y=l("6K3P"),pe=l.n(y),Ue=l("sRBo"),De=l("kaz8"),nt=l("oBTY"),Ne=l("PpiC"),Pe=l("Ot1p"),ae=l("kqOp"),Z=l("7qnI"),ye=l("1vsH"),W=l("PGNT"),T=l.n(W),Ce=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],We=function($,ne){var ie=$.globalSetting,P=$.loading,D=$.dispatch,X=$.isEdit,V=$.editData,xe=Object(Ne.a)($,["globalSetting","loading","dispatch","isEdit","editData"]),ve=Object(F.useState)(""),Oe=Object(L.a)(ve,2),lt=Oe[0],Ye=Oe[1],je=Object(F.useState)(""),pt=Object(L.a)(je,2),Ut=pt[0],ut=pt[1],$t=Object(F.useState)([]),ot=Object(L.a)($t,2),Xt=ot[0],Wt=ot[1],St=Object(F.useState)(""),Yt=Object(L.a)(St,2),zt=Yt[0],Je=Yt[1],ze=Object(F.useState)(),Ae=Object(L.a)(ze,2),$e=Ae[0],Dt=Ae[1],Nt=Object(F.useState)(!1),Jt=Object(L.a)(Nt,2),Ft=Jt[0],_t=Jt[1];Object(F.useEffect)(function(){if(!V||!X)return;Ye(V==null?void 0:V.name),ut(V==null?void 0:V.analysis),Dt(V==null?void 0:V.is_ordered),_t(!0)},[V]),Object(F.useEffect)(function(){if(!Ft)return;var Fe=V==null?void 0:V.standard_answer.map(function(it){return it.answer_text});Wt(Fe),_t(!1)},[Ft]),Object(F.useImperativeHandle)(ne,function(){return{onSave:an,Clear:jt}});var an=function(){var it=[],Gt=!1;return lt?(Xt.forEach(function(qt,nn){it.push({position:nn+1,answer_text:[]}),qt.forEach(function(ln,u){it[nn].answer_text.push(ln),(!ln||!Object(ye.Z)(ln,1e4))&&(Je("".concat(nn,"-").concat(u)),x.b.info(ln?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Gt=!0)})}),Gt?!1:(it==null?void 0:it.length)>20?(x.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:lt,analysis:Ut,standard_answers:it,is_ordered:$e}):(x.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},jt=function(){Ye(""),ut(""),Wt([]),Dt(!1)},cn=function(it,Gt,qt){var nn=Xt.slice();if(Gt&&nn.splice(it,Gt),qt)for(var ln=0;ln<qt;ln++)nn.splice(it+ln,0,[""]);Wt(nn)},Kt=function(it,Gt,qt){Je("");var nn=Xt.slice();nn[it][Gt]=qt,Wt(nn)},dn=function(it){var Gt=Xt.slice();Gt[it]=[].concat(Object(nt.a)(Gt[it]),[""]),Wt(Gt)},Nn=function(it,Gt){var qt=Xt.slice();if(!qt[it][Gt]){qt[it]=qt[it].filter(function(nn,ln){return ln!==Gt}),Wt(qt);return}f.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:T.a.modal,onOk:function(){qt[it]=qt[it].filter(function(ln,u){return u!==Gt}),Wt(qt)}})},sn=function(it){f.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:T.a.modal,onOk:function(){var qt=Xt.slice();qt=Xt.filter(function(nn,ln){return it!==ln}),Wt(qt)}})};return b.a.createElement("section",{className:T.a.wrap},b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u9898\u5E72\uFF1A")),b.a.createElement("div",null,b.a.createElement(ae.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:lt,onChange:function(it){return Ye(it)},showNullButton:!0,onPlaceholderChange:cn})),b.a.createElement("div",{className:"mt20"},Xt.map(function(Fe,it){return b.a.createElement(Z.a,{key:it,answers:Fe,index:it,flex:1,is_md:!0,activeOptionErrorIndex:zt,onAnswerChange:Kt,addChildAnswer:dn,deleteChildAnswer:Nn,deleteChildAnswermain:sn})})),b.a.createElement("div",{className:"mt20"},Xt.length>1&&b.a.createElement("span",null,b.a.createElement(De.a,{checked:$e,onChange:function(it){return Dt(it.target.checked)},className:"".concat(T.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),b.a.createElement("span",{className:"".concat(T.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ut,onChange:function(it){return ut(it)}}))},Ze=Object(z.a)(function(Xe){var $=Xe.loading,ne=Xe.globalSetting;return{globalSetting:ne,loading:$.effects}},null,null,{forwardRef:!0})(Object(F.forwardRef)(We)),Be=l("7Kak"),H=l("9yH6"),G=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],he=function($,ne){var ie=$.globalSetting,P=$.loading,D=$.editData,X=$.dispatch,V=$.onRef,xe=V===void 0?function(){}:V,ve=$.isEdit,Oe=Object(Ne.a)($,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),lt=Object(F.useState)(),Ye=Object(L.a)(lt,2),je=Ye[0],pt=Ye[1],Ut=Object(F.useState)(""),ut=Object(L.a)(Ut,2),$t=ut[0],ot=ut[1],Xt=Object(F.useState)(""),Wt=Object(L.a)(Xt,2),St=Wt[0],Yt=Wt[1];Object(F.useEffect)(function(){if(!D||!ve)return;ot(D==null?void 0:D.name),Yt(D==null?void 0:D.analysis);var ze=D==null?void 0:D.choices.find(function(Ae){return Ae.is_answer});pt(ze.choice_text==="\u6B63\u786E"?"0":"1")},[D]),Object(F.useImperativeHandle)(ne,function(){return{onSave:zt,Clear:Je}});var zt=function(){if(!$t)return x.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!je)return x.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var Ae=[{choice_text:"\u6B63\u786E",is_answer:je==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:je==="1"?1:0}];return{name:$t,choices:Ae,analysis:St}},Je=function(){ot(""),Yt(""),pt("")};return b.a.createElement("section",{className:T.a.wrap},b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u9898\u5E72\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:$t,onChange:function(Ae){return ot(Ae)}}),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",b.a.createElement("span",{className:T.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),b.a.createElement(H.a.Group,{buttonStyle:"solid",value:je,onChange:function(Ae){return pt(Ae.target.value)}},b.a.createElement(H.a.Button,{value:"0",className:"".concat(T.a.radio," mr40")},"\u6B63\u786E"),b.a.createElement(H.a.Button,{value:"1",className:T.a.radio},"\u9519\u8BEF")),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:St,onChange:function(Ae){return Yt(Ae)}}))},ke=Object(z.a)(function(Xe){var $=Xe.loading,ne=Xe.globalSetting;return{globalSetting:ne,loading:$.effects}},null,null,{forwardRef:!0})(Object(F.forwardRef)(he)),Me=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ge=function($,ne){var ie=$.editData,P=$.globalSetting,D=$.loading,X=$.dispatch,V=$.onRef,xe=V===void 0?function(){}:V,ve=$.isEdit,Oe=Object(Ne.a)($,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),lt=Object(F.useState)([]),Ye=Object(L.a)(lt,2),je=Ye[0],pt=Ye[1],Ut=Object(F.useState)(),ut=Object(L.a)(Ut,2),$t=ut[0],ot=ut[1],Xt=Object(F.useState)([]),Wt=Object(L.a)(Xt,2),St=Wt[0],Yt=Wt[1],zt=Object(F.useState)(""),Je=Object(L.a)(zt,2),ze=Je[0],Ae=Je[1],$e=Object(F.useState)(""),Dt=Object(L.a)($e,2),Nt=Dt[0],Jt=Dt[1];Object(F.useEffect)(function(){pt(["","","",""])},[]),Object(F.useEffect)(function(){if(!ie||!ve)return;Ae(ie==null?void 0:ie.name),Jt(ie==null?void 0:ie.analysis),pt(ie==null?void 0:ie.choices.map(function(jt){return jt.choice_text}));var an=[];ie==null||ie.choices.map(function(jt,cn){jt.is_answer&&an.push(cn)}),Yt(an)},[ie]),Object(F.useImperativeHandle)(ne,function(){return{onSave:Ft,Clear:_t}});var Ft=function(){if(!ze)return x.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var jt=je.findIndex(function(Kt){return!Kt});if(jt>-1)return x.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Me[jt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!St.length)return x.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(St.length<2)return x.b.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;var cn=je.map(function(Kt,dn){return{choice_text:Kt,is_answer:St.includes(dn)?1:0}});return{name:ze,choices:cn,analysis:Nt}},_t=function(){pt(["","","",""]),Ae(""),Jt(""),Yt("")};return b.a.createElement("section",{className:T.a.wrap},b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u9898\u5E72\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ze,onChange:function(jt){return Ae(jt)}}),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",b.a.createElement("span",{className:T.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),je.map(function(an,jt){return b.a.createElement("div",{className:T.a.choiceWrap,key:jt},b.a.createElement(we.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},b.a.createElement("div",{className:"".concat(T.a.answer," ").concat(St.includes(jt)?T.a.activeAnswer:""),onClick:function(){St.includes(jt)?Yt(St.filter(function(Kt){return Kt!==jt})):Yt([].concat(Object(nt.a)(St),[jt]))}},Me[jt])),b.a.createElement("div",{className:T.a.editorWrap},$t===jt?b.a.createElement(Pe.a,{id:"single-question-option-".concat(jt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:an,onChange:function(Kt){je[jt]=Kt,pt(je)}}):b.a.createElement("div",{className:T.a.htmlWrap,onClick:function(){return ot(jt)}},b.a.createElement(S.a,{value:an}))),jt>1&&b.a.createElement(we.a,{title:"\u5220\u9664"},b.a.createElement("i",{className:"".concat(T.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){pt(je.filter(function(Kt,dn){return dn!==jt})),St.includes(jt)?Yt(St.filter(function(Kt){return Kt!==jt})):Yt([].concat(Object(nt.a)(St),[jt]))}})),jt<7&&jt===je.length-1&&b.a.createElement(we.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},b.a.createElement("i",{className:"".concat(T.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return pt([].concat(Object(nt.a)(je),[""]))}})))}),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Nt,onChange:function(jt){return Jt(jt)}}))},et=Object(z.a)(function(Xe){var $=Xe.loading,ne=Xe.globalSetting;return{globalSetting:ne,loading:$.effects}},null,null,{forwardRef:!0})(Object(F.forwardRef)(Ge)),Ke=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],yt=function($,ne){var ie=$.editData,P=$.globalSetting,D=$.loading,X=$.dispatch,V=$.onRef,xe=V===void 0?function(){}:V,ve=$.isEdit,Oe=Object(Ne.a)($,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),lt=Object(F.useState)([]),Ye=Object(L.a)(lt,2),je=Ye[0],pt=Ye[1],Ut=Object(F.useState)(),ut=Object(L.a)(Ut,2),$t=ut[0],ot=ut[1],Xt=Object(F.useState)(),Wt=Object(L.a)(Xt,2),St=Wt[0],Yt=Wt[1],zt=Object(F.useState)(""),Je=Object(L.a)(zt,2),ze=Je[0],Ae=Je[1],$e=Object(F.useState)(""),Dt=Object(L.a)($e,2),Nt=Dt[0],Jt=Dt[1];Object(F.useEffect)(function(){pt(["","","",""])},[]),Object(F.useEffect)(function(){if(!ie||!ve)return;Ae(ie==null?void 0:ie.name),Jt(ie==null?void 0:ie.analysis),pt(ie==null?void 0:ie.choices.map(function(an){return an.choice_text})),Yt(ie==null?void 0:ie.choices.findIndex(function(an){return an.is_answer}))},[ie]),Object(F.useImperativeHandle)(ne,function(){return{onSave:Ft,Clear:_t}});var Ft=function(){if(!ze)return x.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var jt=je.findIndex(function(Kt){return!Kt});if(jt>-1)return x.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ke[jt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",St),!(typeof St=="number"))return x.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;var cn=je.map(function(Kt,dn){return{choice_text:Kt,is_answer:St===dn?1:0}});return{name:ze,choices:cn,analysis:Nt}},_t=function(){pt(["","","",""]),Ae(""),Jt(""),Yt("")};return b.a.createElement("section",{className:T.a.wrap},b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u9898\u5E72\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ze,onChange:function(jt){return Ae(jt)}}),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",b.a.createElement("span",{className:T.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),je.map(function(an,jt){return b.a.createElement("div",{className:T.a.choiceWrap,key:jt},b.a.createElement(we.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},b.a.createElement("div",{className:"".concat(T.a.answer," ").concat(St===jt?T.a.activeAnswer:""),onClick:function(){return Yt(jt)}},Ke[jt])),b.a.createElement("div",{className:T.a.editorWrap},$t===jt?b.a.createElement(Pe.a,{id:"single-question-option-".concat(jt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:an,onChange:function(Kt){je[jt]=Kt,pt(je)}}):b.a.createElement("div",{className:T.a.htmlWrap,onClick:function(){return ot(jt)}},b.a.createElement(S.a,{value:an}))),jt>1&&b.a.createElement(we.a,{title:"\u5220\u9664"},b.a.createElement("i",{className:"".concat(T.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){pt(je.filter(function(Kt,dn){return dn!==jt})),jt===St&&Yt(null)}})),jt<7&&jt===je.length-1&&b.a.createElement(we.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},b.a.createElement("i",{className:"".concat(T.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return pt([].concat(Object(nt.a)(je),[""]))}})))}),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Nt,onChange:function(jt){return Jt(jt)}}))},ct=Object(z.a)(function(Xe){var $=Xe.loading,ne=Xe.globalSetting;return{globalSetting:ne,loading:$.effects}},null,null,{forwardRef:!0})(Object(F.forwardRef)(yt)),gt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],st=function($,ne){var ie=$.editData,P=$.globalSetting,D=$.loading,X=$.dispatch,V=$.onRef,xe=V===void 0?function(){}:V,ve=$.isEdit,Oe=Object(Ne.a)($,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),lt=Object(F.useState)(""),Ye=Object(L.a)(lt,2),je=Ye[0],pt=Ye[1],Ut=Object(F.useState)(""),ut=Object(L.a)(Ut,2),$t=ut[0],ot=ut[1],Xt=Object(F.useState)(""),Wt=Object(L.a)(Xt,2),St=Wt[0],Yt=Wt[1];Object(F.useEffect)(function(){var ze;if(!ie||!ve)return;pt(ie==null?void 0:ie.name),ot(ie==null?void 0:ie.analysis),Yt(ie==null||((ze=ie.answer_texts)===null||ze===void 0)?void 0:ze[0])},[ie]),Object(F.useImperativeHandle)(ne,function(){return{onSave:zt,Clear:Je}});var zt=function(){return je?St?{name:je,answer_texts:[St],analysis:$t}:(x.b.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"),!1):(x.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Je=function(){pt(""),ot(""),Yt("")};return b.a.createElement("section",{className:T.a.wrap},b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u9898\u5E72\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:je,onChange:function(Ae){return pt(Ae)}}),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:St,onChange:function(Ae){return Yt(Ae)}}),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:$t,onChange:function(Ae){return ot(Ae)}}))},Ot=Object(z.a)(function(Xe){var $=Xe.loading,ne=Xe.globalSetting;return{globalSetting:ne,loading:$.effects}},null,null,{forwardRef:!0})(Object(F.forwardRef)(st)),xt=l("k1fw"),wt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Le=function($,ne){var ie=$.globalSetting,P=$.loading,D=$.dispatch,X=$.editData,V=$.onRef,xe=V===void 0?function(){}:V,ve=$.isEdit,Oe=Object(Ne.a)($,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),lt=Object(F.useState)(""),Ye=Object(L.a)(lt,2),je=Ye[0],pt=Ye[1],Ut=Object(F.useState)([]),ut=Object(L.a)(Ut,2),$t=ut[0],ot=ut[1];console.log($t),Object(F.useEffect)(function(){var zt;if(!X||!ve)return;pt(X==null?void 0:X.name);var Je=X==null||((zt=X.sub_item_banks)===null||zt===void 0)?void 0:zt.map(function(ze){var Ae,$e,Dt;return Object(xt.a)(Object(xt.a)({},ze),{},{id:ze.id,open:!1,qusList:ze==null||((Ae=ze.choices)===null||Ae===void 0)?void 0:Ae.map(function(Nt){return Nt.choice_text}),activeQusEditor:null,qusAnswer:($e=[ze==null||((Dt=ze.choices)===null||Dt===void 0)?void 0:Dt.findIndex(function(Nt){return Nt.is_answer})])===null||$e===void 0?void 0:$e.filter(function(Nt){return Nt!==-1})})});ot(Je)},[X]),Object(F.useImperativeHandle)(ne,function(){return{onSave:Xt,Clear:Wt}});var Xt=function(){if(!je)return x.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if($t.length===0)return x.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var Je=0;Je<$t.length;Je++){var ze,Ae=$t[Je];if(!(Ae!=null&&Ae.name))return x.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Je+1,"\u5C0F\u9898\u9898\u5E72")),!1;var $e=Ae==null||((ze=Ae.qusList)===null||ze===void 0)?void 0:ze.findIndex(function(Nt){return!Nt});if($e>-1)return x.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Je+1,"\u5C0F\u9898").concat(wt[$e],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(Ae!=null&&Ae.qusAnswer.length))return x.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Je+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var Dt=$t.map(function(Nt){return{id:Nt.id>1?Nt.id:null,name:Nt.name,item_type:Nt.item_type,analysis:Nt.analysis,choices:Nt.qusList.map(function(Jt,Ft){return{choice_text:Jt,is_answer:Nt.qusAnswer[0]===Ft?1:0}})}});return{name:je,sub_item_banks:Dt}},Wt=function(){pt(""),ot([])},St=function(){var Je={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};ot($t.concat(Je))},Yt=function(Je,ze,Ae){var $e=Object(I.cloneDeep)($t);if(Je==="open"&&($e[ze].open=!$e[ze].open),Je==="delete"&&$e.splice(ze,1),Je==="value"&&($e[ze].name=Ae),Je==="answer"&&($e[ze].qusAnswer=[Ae]),Je==="edit"&&($e[ze].activeQusEditor=Ae),Je==="details"&&($e[ze].qusList[$e[ze].activeQusEditor]=Ae),Je==="addQus"&&($e[ze].qusList=$e[ze].qusList.concat("")),Je==="deleteQus"){var Dt;$e[ze].qusList=$e[ze].qusList.filter(function(Nt,Jt){return Jt!==Ae}),$e[ze].qusAnswer=(Dt=$e[ze].qusAnswer)===null||Dt===void 0?void 0:Dt.filter(function(Nt){return Nt!==Ae})}Je==="analysis"&&($e[ze].analysis=Ae),ot($e)};return b.a.createElement("section",{className:T.a.wrap},b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u9898\u5E72\uFF1A")),b.a.createElement(Pe.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:je,onChange:function(Je){return pt(Je)}}),$t==null?void 0:$t.map(function(zt,Je){var ze;return b.a.createElement("div",{className:T.a.fold,key:zt.id},b.a.createElement("div",{onClick:function(){return Yt("open",Je)},className:T.a.head},b.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:zt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),b.a.createElement("span",null,"\u7B2C",Je+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),b.a.createElement("b",{style:{visibility:"hidden"},onClick:function($e){$e.stopPropagation(),Yt("delete",Je)},className:"iconfont icon-shanchu8"})),b.a.createElement("div",{className:"mb10",style:{display:zt.open?"block":"none"}},b.a.createElement(Pe.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:zt==null?void 0:zt.name,onChange:function($e){return Yt("value",Je,$e)}}),b.a.createElement("p",{className:T.a.titleWrap},b.a.createElement("span",{className:T.a.required},"*"),b.a.createElement("span",{className:T.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",b.a.createElement("span",{className:T.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),zt==null||((ze=zt.qusList)===null||ze===void 0)?void 0:ze.map(function(Ae,$e){var Dt,Nt;return b.a.createElement("div",{className:T.a.choiceWrap,key:$e},b.a.createElement(we.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},b.a.createElement("div",{className:"".concat(T.a.answer," ").concat(zt!=null&&(Dt=zt.qusAnswer)!==null&&Dt!==void 0&&Dt.includes($e)?T.a.activeAnswer:""),onClick:function(){return Yt("answer",Je,$e)}},wt[$e])),b.a.createElement("div",{className:T.a.editorWrap},(zt==null?void 0:zt.activeQusEditor)===$e?b.a.createElement(Pe.a,{id:"single-question-option-".concat($e),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Ae,onChange:function(Ft){return Yt("details",Je,Ft)}}):b.a.createElement("div",{className:T.a.htmlWrap,onClick:function(){return Yt("edit",Je,$e)}},b.a.createElement(S.a,{value:Ae}))),$e>1&&b.a.createElement(we.a,{title:"\u5220\u9664"},b.a.createElement("i",{className:"".concat(T.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Yt("deleteQus",Je,$e)}})),$e<7&&$e===(zt==null||((Nt=zt.qusList)===null||Nt===void 0)?void 0:Nt.length)-1&&b.a.createElement(we.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},b.a.createElement("i",{className:"".concat(T.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Yt("addQus",Je)}})))}),b.a.createElement("p",{className:"mb10 mt10"},b.a.createElement("span",{className:T.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),b.a.createElement(Pe.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:zt.analysis,onChange:function($e){return Yt("analysis",Je,$e)}})))}))},ft=Object(z.a)(function(Xe){var $=Xe.loading,ne=Xe.globalSetting;return{globalSetting:ne,loading:$.effects}},null,null,{forwardRef:!0})(Object(F.forwardRef)(Le)),At=function($){var ne,ie,P,D,X,V,xe,ve,Oe=$.data,lt=$.submit,Ye=$.goBack,je=$.loading,pt=$.onTypeScore,Ut=$.editPreview,ut=Ut===void 0?!1:Ut,$t=$.onSkipExamination,ot=$.selectValue,Xt=$.onExchange,Wt=Object(F.useRef)(),St=Object(F.useRef)(Object(I.debounce)(function(){return cn()},100,{leading:!0,trailing:!0})),Yt=Object(F.useState)(null),zt=Object(L.a)(Yt,2),Je=zt[0],ze=zt[1],Ae=Object(F.useState)(!1),$e=Object(L.a)(Ae,2),Dt=$e[0],Nt=$e[1],Jt=Object(Q.i)();Object(F.useEffect)(function(){return window.addEventListener("scroll",St==null?void 0:St.current),function(){window.removeEventListener("scroll",St==null?void 0:St.current)}},[]),Object(F.useEffect)(function(){Nt(!0)},[]),Object(F.useEffect)(function(){var Re,ge,qe,Lt,Pt=(Re=document.getElementById("examName"))===null||Re===void 0||((ge=Re.getElementsByClassName("ant-pagination-options-quick-jumper"))===null||ge===void 0||((qe=ge[0])===null||qe===void 0||((Lt=qe.childNodes)===null||Lt===void 0)))?void 0:Lt[2];Pt&&(Pt.nodeValue="\u4EFD")},[Oe]);var Ft=function(ge){var qe=parseInt(ge);return isNaN(qe)?"":qe};function _t(){var Re=0,ge=0,qe=0;return document.body&&(ge=document.body.scrollTop),document.documentElement&&(qe=document.documentElement.scrollTop),Re=ge-qe>0?ge:qe,Re}function an(){var Re=0,ge=0,qe=0;return document.body&&(ge=document.body.scrollHeight),document.documentElement&&(qe=document.documentElement.scrollHeight),Re=ge-qe>0?ge:qe,Re}function jt(){var Re=0;return document.compatMode=="CSS1Compat"?Re=document.documentElement.clientHeight:Re=document.body.clientHeight,Re}var cn=function(){var ge=document.getElementById("preview_btns"),qe=document.getElementById("preview_btns_else");_t()+jt()>=an()-68?(ge.style.visibility="hidden",qe.style.visibility="visible"):(ge.style.visibility="visible",qe.style.visibility="hidden")},Kt=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],dn=function(ge){var qe,Lt=[];return b.a.createElement(b.a.Fragment,null,b.a.createElement("aside",{className:j.a.single},ge==null||((qe=ge.choices)===null||qe===void 0)?void 0:qe.map(function(Pt,Tt){return Pt.is_answer&&Lt.push(Gt[Tt]),b.a.createElement("ul",{key:Tt},b.a.createElement("li",null,Gt[Tt],"\u3001"),b.a.createElement("li",null,b.a.createElement(S.a,{value:Pt.choice_text})))})),b.a.createElement("div",{className:j.a.analysis},b.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Lt.join(""),b.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Kt[ge.difficulty])),b.a.createElement("aside",null,b.a.createElement("span",{className:j.a.text},"\u89E3\u6790:"),b.a.createElement(S.a,{value:ge.analysis?ge.analysis:"\u6682\u65E0\u89E3\u6790"})),b.a.createElement("ul",null,b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ge==null?void 0:ge.discipline_name,"/").concat(ge==null?void 0:ge.sub_discipline_name)),b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ge==null?void 0:ge.tag_discipline_name))))},Nn=function(ge){var qe,Lt=ge==null||((qe=ge.standard_answer)===null||qe===void 0)?void 0:qe.map(function(Pt){var Tt;return"\u7B54\u6848\uFF08\u586B\u7A7A".concat(Pt.position,"\uFF09\uFF1A").concat(Pt==null||((Tt=Pt.answer_text)===null||Tt===void 0)?void 0:Tt.join("\u3001"))});return b.a.createElement(b.a.Fragment,null,b.a.createElement("div",{className:j.a.analysis},b.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Lt),b.a.createElement("aside",null,b.a.createElement("span",{className:j.a.text},"\u89E3\u6790:"),b.a.createElement(S.a,{value:ge.analysis?ge.analysis:"\u6682\u65E0\u89E3\u6790"})),b.a.createElement("ul",null,b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ge==null?void 0:ge.discipline_name,"/").concat(ge==null?void 0:ge.sub_discipline_name)),b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ge==null?void 0:ge.tag_discipline_name))))},sn=function(ge){var qe;return b.a.createElement("div",{className:j.a.analysis},b.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ge==null||((qe=ge.answer_texts)===null||qe===void 0)?void 0:qe[0]),b.a.createElement("aside",null,b.a.createElement("span",{className:j.a.text},"\u89E3\u6790:"),b.a.createElement(S.a,{value:ge.analysis?ge.analysis:"\u6682\u65E0\u89E3\u6790"})),b.a.createElement("ul",null,b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ge==null?void 0:ge.discipline_name,"/").concat(ge==null?void 0:ge.sub_discipline_name)),b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ge==null?void 0:ge.tag_discipline_name)))},Fe=function(ge){var qe;return b.a.createElement("div",{className:j.a.analysis},b.a.createElement("aside",null,b.a.createElement("span",{className:j.a.text},"\u9884\u671F\u8F93\u51FA:"),b.a.createElement(S.a,{value:ge==null||((qe=ge.program_attr)===null||qe===void 0)?void 0:qe.description})),b.a.createElement("ul",null,b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ge==null?void 0:ge.discipline_name,"/").concat(ge==null?void 0:ge.sub_discipline_name)),b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ge==null?void 0:ge.tag_discipline_name)))},it=function(ge,qe){var Lt;return b.a.createElement("div",null,ge==null||((Lt=ge.sub_item_banks)===null||Lt===void 0)?void 0:Lt.map(function(Pt,Tt){var Mt,mn=[];return b.a.createElement(b.a.Fragment,null,b.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},qe+1+"."+(Tt+1),"\uFF08\u5355\u9009\u9898\uFF09",Pt.name),b.a.createElement("aside",{className:j.a.single},Pt==null||((Mt=Pt.choices)===null||Mt===void 0)?void 0:Mt.map(function(jn,kn){return jn.is_answer&&mn.push(Gt[kn]),b.a.createElement("ul",{key:kn},b.a.createElement("li",null,Gt[kn],"\u3001"),b.a.createElement("li",null,b.a.createElement(S.a,{value:jn.choice_text})))})),b.a.createElement("div",{className:j.a.analysis},b.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",mn.join(""),b.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Kt[Pt.difficulty])),b.a.createElement("aside",null,b.a.createElement("span",{className:j.a.text},"\u89E3\u6790:"),b.a.createElement(S.a,{value:Pt.analysis?Pt.analysis:"\u6682\u65E0\u89E3\u6790"})),b.a.createElement("ul",null,b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(ge==null?void 0:ge.discipline_name,"/").concat(ge==null?void 0:ge.sub_discipline_name)),b.a.createElement("li",null,b.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),ge==null?void 0:ge.tag_discipline_name))))}))},Gt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],qt=function(ge){console.log("---",ge);var qe=[];ge.questions.map(function(Pt){return Pt==null?void 0:Pt.sub_item_banks.map(function(Tt){qe.push(Tt)})});var Lt=0;ge.type==="COMBINATION"?Lt=ge.questions_score/qe.length:Lt=ge.questions_score/ge.questions_count,f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:b.a.createElement("div",{className:j.a.modalColumn},b.a.createElement("div",{className:j.a.modalRow,style:{justifyContent:"flex-start"}},b.a.createElement("sup",{className:j.a.sup},"*"),b.a.createElement("span",null,ge==null?void 0:ge.name,(ge==null?void 0:ge.type)==="COMBINATION"&&"\u4E2D\u7684\u6BCF\u5C0F\u9898","\uFF1A"),b.a.createElement(m.a,{min:1,parser:Ft,defaultValue:Lt,onChange:function(Tt){Lt=Tt}}),b.a.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Pt=Object(w.a)(oe.a.mark(function Mt(){var mn,jn;return oe.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(Lt){_n.next=3;break}return x.b.warn("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),_n.abrupt("return",Promise.reject());case 3:ge.type==="COMBINATION"?(mn={type:ge==null?void 0:ge.type,score:Lt,scoreTotal:Lt*(qe==null?void 0:qe.length)},pt(mn)):(jn={type:ge==null?void 0:ge.type,score:Lt,scoreTotal:Lt*ge.questions_count},pt(jn));case 4:case"end":return _n.stop()}},Mt)}));function Tt(){return Pt.apply(this,arguments)}return Tt}()})},nn=function(){var ge="";f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:b.a.createElement("div",{className:j.a.modalColumn},b.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},b.a.createElement("img",{style:{marginRight:5},src:pe.a}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),b.a.createElement("div",{className:j.a.modalRow,style:{marginTop:20}},b.a.createElement("sup",{className:j.a.sup},"*"),b.a.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),b.a.createElement(C.a,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:ge,onChange:function(Lt){ge=Lt.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qe=Object(w.a)(oe.a.mark(function Pt(){var Tt,Mt,mn,jn,kn;return oe.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(ge){Ln.next=3;break}return x.b.warn("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Ln.abrupt("return",Promise.reject());case 3:return Mt=[],mn=[],jn=[],Oe==null||((Tt=Oe.questionList)===null||Tt===void 0)||Tt.forEach(function(Un){var ti;(ti=Un.questions)===null||ti===void 0||ti.forEach(function(wi){Mt.push(wi.id),mn.push(Un.questions_score/Un.questions_count),Un.type==="COMBINATION"&&jn.push({id:wi.id,sub_item_bank_ids:wi.sub_item_banks.map(function(Xn){return Xn.id})})})}),console.log("-----",jn),kn={item_bank_ids:Mt,item_bank_scores:mn,name:ge,combination_item_banks:jn},Ln.next=11,lt(kn);case 11:case"end":return Ln.stop()}},Pt)}));function Lt(){return qe.apply(this,arguments)}return Lt}()})},ln=function(ge,qe,Lt,Pt){var Tt,Mt=(Tt=Pt.questions)===null||Tt===void 0?void 0:Tt.map(function(jn){return jn.id}),mn=f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var jn=Object(w.a)(oe.a.mark(function _n(){return oe.a.wrap(function(Un){for(;;)switch(Un.prev=Un.next){case 0:return mn.update({cancelButtonProps:{disabled:!0}}),Un.next=3,Xt({single_question_id:ge,seleted_item_bank_ids:Mt},{type:qe,index:Lt});case 3:mn.update({cancelButtonProps:{disabled:!1}}),x.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898");case 5:case"end":return Un.stop()}},_n)}));function kn(){return jn.apply(this,arguments)}return kn}()})},u=function(ge){var qe,Lt=(qe=ge.questions)===null||qe===void 0?void 0:qe.map(function(Mt){return Mt.id}),Pt=ge.name,Tt=f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362".concat(Pt,"\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Mt=Object(w.a)(oe.a.mark(function jn(){return oe.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:return Tt.update({cancelButtonProps:{disabled:!0}}),_n.next=3,Xt({seleted_item_bank_ids:Lt},{type:ge.type});case 3:Tt.update({cancelButtonProps:{disabled:!1}}),x.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210".concat(Pt,"\u8BD5\u9898"));case 5:case"end":return _n.stop()}},jn)}));function mn(){return Mt.apply(this,arguments)}return mn}()})},o=function(){var ge=f.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qe=Object(w.a)(oe.a.mark(function Pt(){return oe.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return ge.update({cancelButtonProps:{disabled:!0}}),Mt.next=3,Xt();case 3:ge.update({cancelButtonProps:{disabled:!1}}),x.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898");case 5:case"end":return Mt.stop()}},Pt)}));function Lt(){return qe.apply(this,arguments)}return Lt}()})},a=function(ge){console.log(ge,"key"),$t(ge-1)},c=function(){return b.a.createElement(b.a.Fragment,null,b.a.createElement(B.a,{color:"#55575D",overlayClassName:j.a.popover,visible:Dt,getPopupContainer:function(qe){return qe==null?void 0:qe.parentNode},content:"\u5982\u60A8\u5BF9\u6B64\u4EFD\u8BD5\u9898\u6EE1\u610F\uFF0C\u53EF\u5C06\u6B64\u4EFD\u8BD5\u9898\u4FDD\u5B58\u4E3A\u56FA\u5B9A\u8BD5\u5377"},b.a.createElement(A.a,{onMouseEnter:function(){return Nt(!0)},onMouseLeave:function(){return Nt(!1)},onClick:function(){nn()}},"\u4FDD\u5B58")),b.a.createElement(A.a,{onClick:function(){document.body.scrollIntoView(),Ye()}},"\u8FD4\u56DE"),b.a.createElement(A.a,{loading:je,onClick:function(){return lt()},type:"primary"},"\u63D0\u4EA4"))},p=function(){var ge;return b.a.createElement(b.a.Fragment,null,b.a.createElement(A.a,{onClick:Ye},"\u8FD4\u56DE"),ot>0&&b.a.createElement(A.a,{onClick:function(){return a(ot)},type:"primary"},"\u4E0A\u4E00\u4EFD"),ot<(Oe==null||((ge=Oe.exam)===null||ge===void 0)?void 0:ge.total_num)-1&&b.a.createElement(A.a,{onClick:function(){return a(ot+2)}},"\u4E0B\u4E00\u4EFD"))},h=function(ge,qe){if(console.log(ge,222),qe==="SINGLE")return b.a.createElement(b.a.Fragment,null,b.a.createElement(ct,{ref:Wt,editData:ge,isEdit:!0}),b.a.createElement(fe.a,null));if(qe==="MULTIPLE")return b.a.createElement(b.a.Fragment,null,b.a.createElement(et,{ref:Wt,editData:ge,isEdit:!0}),b.a.createElement(fe.a,null));if(qe==="JUDGMENT")return b.a.createElement(b.a.Fragment,null,b.a.createElement(ke,{ref:Wt,editData:ge,isEdit:!0}),b.a.createElement(fe.a,null));if(qe==="COMPLETION")return b.a.createElement(b.a.Fragment,null,b.a.createElement(Ze,{ref:Wt,editData:ge,isEdit:!0}),b.a.createElement(fe.a,null));if(qe==="SUBJECTIVE")return b.a.createElement(b.a.Fragment,null,b.a.createElement(Ot,{ref:Wt,editData:ge,isEdit:!0}),b.a.createElement(fe.a,null));if(qe==="COMBINATION")return b.a.createElement(b.a.Fragment,null,b.a.createElement(ft,{ref:Wt,editData:ge,isEdit:!0}),b.a.createElement(fe.a,null));if(qe==="PROGRAM"){var Lt;z.d.push("/problems/".concat(ge==null||((Lt=ge.program_attr)===null||Lt===void 0)?void 0:Lt.identifier,"/edit?type=exercises&express_id=").concat(Jt.categoryId,"&question_id=").concat(ge==null?void 0:ge.id,"&score=").concat(ge==null?void 0:ge.score,"&callback_url=").concat(location.pathname,"&select=").concat(ot,"&exercise=true"))}},ce=function(){var Re=Object(w.a)(oe.a.mark(function ge(qe,Lt){var Pt,Tt,Mt,mn,jn,kn,_n,Ln,Un,ti;return oe.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:return Xn.next=2,(Pt=Wt.current)===null||Pt===void 0?void 0:Pt.onSave();case 2:if(Tt=Xn.sent,Tt){Xn.next=5;break}return Xn.abrupt("return");case 5:return Mt={question_score:Lt.score,analysis:Tt.analysis},console.log(Tt,"editorData"),(qe==="SINGLE"||qe==="MULTIPLE"||qe==="JUDGMENT")&&(jn=[],kn=[],Mt.question_type=qe==="JUDGMENT"?2:1,Mt.question_title=Tt==null?void 0:Tt.name,Tt==null||((mn=Tt.choices)===null||mn===void 0)||mn.forEach(function($n,$i){jn.push($n.choice_text),$n!=null&&$n.is_answer&&kn.push($i+1)}),Mt.question_choices=jn,Mt.standard_answers=kn),qe==="COMPLETION"&&(Mt.is_ordered=Tt.is_ordered,Mt.question_title=Tt==null?void 0:Tt.name,Mt.question_type=3,Ln=[],Tt==null||((_n=Tt.standard_answers)===null||_n===void 0)||_n.forEach(function($n,$i){Ln.push({choice_id:$n.position,answer_text:$n.answer_text})}),Mt.standard_answers=Ln),qe==="SUBJECTIVE"&&(Mt.question_title=Tt==null?void 0:Tt.name,Mt.question_type=3,Mt.standard_answers=Tt==null?void 0:Tt.answer_texts),qe==="COMBINATION"&&(Mt.question_title=Tt==null?void 0:Tt.name,Mt.question_type=7,Mt.sub_questions=Tt==null||((Un=Tt.sub_item_banks)===null||Un===void 0)?void 0:Un.map(function($n,$i){return{id:$n.id,question_title:$n.name,question_type:1,question_choices:$n.choices.map(function(_i){return _i.choice_text}),standard_answers:[$n.choices.findIndex(function(_i){return _i.is_answer})+1],analysis:$n.analysis}}),delete Mt.analysis),Xn.next=13,Object(U.a)("/api/exercise_questions/".concat(Lt.id,".json"),{method:"put",body:Mt});case 13:ti=Xn.sent,(ti==null?void 0:ti.status)===0&&(x.b.success("\u7F16\u8F91\u6210\u529F"),a(ot+1)),ze(null);case 16:case"end":return Xn.stop()}},ge)}));return function(qe,Lt){return Re.apply(this,arguments)}}(),tt=function(){for(var ge=[],qe=0;qe<(Oe==null||((Lt=Oe.exam)===null||Lt===void 0)?void 0:Lt.total_num);qe++){var Lt;ge.push({})}return ge};console.log(tt(),"data");var ht=Oe==null||((ne=Oe.questionList)===null||ne===void 0)?void 0:ne.reduce(function(Re,ge){return Re+ge.questions_score},0),It=ut&&(Oe==null||((ie=Oe.exam)===null||ie===void 0)?void 0:ie.exercise_status)!==1;return b.a.createElement("section",{className:j.a.wrap},b.a.createElement("div",{id:"id_left_preview",className:j.a.left,onMouseEnter:function(ge){var qe=document.getElementById("id_left_preview");qe.style.overflowY="auto"},onMouseLeave:function(ge){var qe=document.getElementById("id_left_preview");qe.style.overflowY="hidden"}},b.a.createElement("div",{className:j.a.title},b.a.createElement("div",null,b.a.createElement("b",null),b.a.createElement("span",null,"\u7B54\u9898\u5361"))),b.a.createElement("div",{className:j.a.total},b.a.createElement("div",null,b.a.createElement("img",{src:de.a}),b.a.createElement("span",null,"\u9898\u6570(\u9053)"),b.a.createElement("aside",null,Oe==null?void 0:Oe.all_questions_count)),b.a.createElement("div",{className:"mr30 ml30"},b.a.createElement("img",{src:be.a}),b.a.createElement("span",null,"\u603B\u5206(\u5206)"),b.a.createElement("aside",null,ht)),b.a.createElement("div",null,b.a.createElement("img",{src:k.a}),b.a.createElement("span",null,"\u65F6\u957F(\u5206)"),b.a.createElement("aside",null,Oe==null||((P=Oe.exam)===null||P===void 0)?void 0:P.time))),Oe==null||((D=Oe.questionList)===null||D===void 0)?void 0:D.map(function(Re,ge){var qe;return b.a.createElement("div",{className:j.a.list,key:ge},b.a.createElement("div",{className:j.a.name},b.a.createElement("b",null),b.a.createElement("span",null,Re.name)),b.a.createElement("aside",null,b.a.createElement("div",null,"\u5171",b.a.createElement("span",{className:j.a.b},Re.questions_count),"\u9898 ",b.a.createElement("span",{className:j.a.l},"|"),"\u5171",b.a.createElement("span",{className:j.a.r},Re.questions_score),"\u5206"),b.a.createElement("div",{className:j.a.answerSheet},Re==null||((qe=Re.questions)===null||qe===void 0)?void 0:qe.map(function(Lt,Pt){return b.a.createElement("div",{onClick:function(){var Mt="Anchor_".concat(Lt.id),mn=document.getElementById(Mt);mn&&setTimeout(function(){return mn.scrollIntoView({block:"center",behavior:"smooth"})})},key:Lt.id,className:j.a.tag},Pt+1)}))))})),b.a.createElement("div",{className:j.a.right},b.a.createElement("div",{className:j.a.examName,id:"examName"},b.a.createElement("div",{className:j.a.name},b.a.createElement(we.a,{title:Oe==null||((X=Oe.exam)===null||X===void 0)?void 0:X.name,getPopupContainer:function(ge){return ge.parentNode}},b.a.createElement("span",{className:j.a.t},Oe==null||((V=Oe.exam)===null||V===void 0)?void 0:V.name))),ut?b.a.createElement(_e.a,{showTotal:function(ge){return b.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"\u5171\u8BA1",b.a.createElement("span",{className:"c-light-primary"},ge),"\u4EFD\u8BD5\u5377")},total:Oe==null||((xe=Oe.exam)===null||xe===void 0)?void 0:xe.total_num,pageSize:1,current:ot+1,showSizeChanger:!1,onChange:a,showQuickJumper:!0,hideOnSinglePage:!1}):b.a.createElement(A.a,{onClick:o,type:"primary"},"\u968F\u673A\u66F4\u6362")),b.a.createElement("div",{className:j.a.topWarp},Oe==null||((ve=Oe.questionList)===null||ve===void 0)?void 0:ve.map(function(Re,ge){var qe,Lt;return b.a.createElement(b.a.Fragment,{key:ge},b.a.createElement("div",{className:j.a.head,style:ge===0?{border:0,marginTop:-16}:{}},b.a.createElement("div",{className:j.a.name},b.a.createElement("b",null),b.a.createElement("span",null,Re.name)),b.a.createElement("div",{className:j.a.so},"\u5171",b.a.createElement("span",{className:j.a.b},Re.questions_count," "),"\u9898 ",Re.type==="COMBINATION"&&"\uFF08\u5305\u542B".concat(Re==null||((qe=Re.questions)===null||qe===void 0)?void 0:qe.map(function(Pt){var Tt;return Pt==null||((Tt=Pt.sub_item_banks)===null||Tt===void 0)?void 0:Tt.length}).reduce(function(Pt,Tt){return Pt+Tt}),"\u5C0F\u9898\uFF09"),b.a.createElement("span",{className:j.a.l},"|"),"\u5171",b.a.createElement("span",{className:j.a.r},Re.questions_score),"\u5206"),!ut&&b.a.createElement("div",{className:j.a.btn},b.a.createElement(A.a,{onClick:function(){qt(Re)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),b.a.createElement(A.a,{onClick:function(){return u(Re)},type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),Re==null||((Lt=Re.questions)===null||Lt===void 0)?void 0:Lt.map(function(Pt,Tt){return Je===Pt.id?b.a.createElement("div",{id:"Anchor_".concat(Pt.id),className:j.a.content,style:{padding:0,marginTop:10},key:Pt.id},b.a.createElement("div",{style:{float:"right",marginTop:-6}},b.a.createElement(A.a,{onClick:function(){return ze(null)},className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),b.a.createElement(A.a,{onClick:function(){return ce(Re==null?void 0:Re.type,Pt)},type:"primary"},"\u4FDD\u5B58")),h(Pt,Re.type)):b.a.createElement("div",{id:"Anchor_".concat(Pt.id),className:j.a.content,key:Pt.id},b.a.createElement("div",{className:j.a.titleWrap},b.a.createElement(S.a,{style:{paddingRight:10},className:j.a.titleHtml,value:Tt+1+"\u3001"+"".concat((Pt==null?void 0:Pt.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+Pt.name}),ut&&b.a.createElement(A.a,{disabled:It,onClick:function(){if(Je){x.b.warn("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}ze(Pt.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),b.a.createElement(A.a,{disabled:It,onClick:function(){return ln(Pt.id,Re.type,Tt,Re)},type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(Re.type==="SINGLE"||Re.type==="JUDGMENT"||Re.type==="MULTIPLE")&&dn(Pt),Re.type==="COMPLETION"&&Nn(Pt),Re.type==="SUBJECTIVE"&&sn(Pt),Re.type==="PROGRAM"&&Fe(Pt),Re.type==="COMBINATION"&&it(Pt,Tt),b.a.createElement("div",null))}))})),b.a.createElement("div",{className:j.a.btnsElse,id:"preview_btns_else"},ut?p():c()),b.a.createElement("div",{className:j.a.btnsWrap,id:"preview_btns"},b.a.createElement("div",{className:j.a.btns},ut?p():c()))))},He=ue.a=At},sboe:function(rt,ue,l){"use strict";l.d(ue,"a",function(){return me});var q=l("q1tI"),_e=l.n(q),me=q.createContext(null)},tmPe:function(rt,ue,l){rt.exports={flex_box_center:"flex_box_center___ivyUy",flex_space_between:"flex_space_between___1h8Qq",flex_box_vertical_center:"flex_box_vertical_center___3eC95",flex_box_center_end:"flex_box_center_end___nrhvX",flex_box_column:"flex_box_column___2po4_",customTree:"customTree___1LpRW",name:"name___17ZTs"}},vHTk:function(rt,ue,l){rt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);