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__Pr...

345 lines
643 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[178,7,8,17],{"+NIl":function(nt,Ye,y){(function(z){z(y("VrN/"))})(function(z){"use strict";z.defineMode("stex",function(ve,Z){"use strict";function me(U,W){U.cmdState.push(W)}function ue(U){return U.cmdState.length>0?U.cmdState[U.cmdState.length-1]:null}function q(U){var W=U.cmdState.pop();W&&W.closeBracket()}function P(U){for(var W=U.cmdState,V=W.length-1;V>=0;V--){var $=W[V];if($.name=="DEFAULT")continue;return $}return{styleIdentifier:function(){return null}}}function L(U,W,V){return function(){this.name=U,this.bracketNo=0,this.style=W,this.styles=V,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var R={};R.importmodule=L("importmodule","tag",["string","builtin"]),R.documentclass=L("documentclass","tag",["","atom"]),R.usepackage=L("usepackage","tag",["atom"]),R.begin=L("begin","tag",["atom"]),R.end=L("end","tag",["atom"]),R.label=L("label","tag",["atom"]),R.ref=L("ref","tag",["atom"]),R.eqref=L("eqref","tag",["atom"]),R.cite=L("cite","tag",["atom"]),R.bibitem=L("bibitem","tag",["atom"]),R.Bibitem=L("Bibitem","tag",["atom"]),R.RBibitem=L("RBibitem","tag",["atom"]),R.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function F(U,W){U.f=W}function O(U,W){var V;if(U.match(/^\\[a-zA-Z@]+/)){var $=U.current().slice(1);return V=R.hasOwnProperty($)?R[$]:R.DEFAULT,V=new V,me(W,V),F(W,ee),V.style}if(U.match(/^\\[$&%#{}_]/))return"tag";if(U.match(/^\\[,;!\/\\]/))return"tag";if(U.match("\\["))return F(W,function(re,be){return T(re,be,"\\]")}),"keyword";if(U.match("\\("))return F(W,function(re,be){return T(re,be,"\\)")}),"keyword";if(U.match("$$"))return F(W,function(re,be){return T(re,be,"$$")}),"keyword";if(U.match("$"))return F(W,function(re,be){return T(re,be,"$")}),"keyword";var ie=U.next();if(ie=="%")return U.skipToEnd(),"comment";if(ie=="}"||ie=="]"){if(V=ue(W),V)V.closeBracket(ie),F(W,ee);else return"error";return"bracket"}else return ie=="{"||ie=="["?(V=R.DEFAULT,V=new V,me(W,V),"bracket"):/\d/.test(ie)?(U.eatWhile(/[\w.%]/),"atom"):(U.eatWhile(/[\w\-_]/),V=P(W),V.name=="begin"&&(V.argument=U.current()),V.styleIdentifier())}function T(U,W,V){if(U.eatSpace())return null;if(V&&U.match(V))return F(W,O),"keyword";if(U.match(/^\\[a-zA-Z@]+/))return"tag";if(U.match(/^[a-zA-Z]+/))return"variable-2";if(U.match(/^\\[$&%#{}_]/))return"tag";if(U.match(/^\\[,;!\/]/))return"tag";if(U.match(/^[\^_&]/))return"tag";if(U.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(U.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var $=U.next();return $=="{"||$=="}"||$=="["||$=="]"||$=="("||$==")"?"bracket":$=="%"?(U.skipToEnd(),"comment"):"error"}function ee(U,W){var V=U.peek(),$;return V=="{"||V=="["?($=ue(W),$.openBracket(V),U.eat(V),F(W,O),"bracket"):/[ \t\r]/.test(V)?(U.eat(V),null):(F(W,O),q(W),O(U,W))}return{startState:function(){var U=Z.inMathMode?function(W,V){return T(W,V)}:O;return{cmdState:[],f:U}},copyState:function(U){return{cmdState:U.cmdState.slice(),f:U.f}},token:function(U,W){return W.f(U,W)},blankLine:function(U){U.f=O,U.cmdState.length=0},lineComment:"%"}}),z.defineMIME("text/x-stex","stex"),z.defineMIME("text/x-latex","stex")})},"+yhJ":function(nt,Ye,y){nt.exports=y.p+"static/xixi.d492fb65.svg"},"0eGx":function(nt,Ye,y){nt.exports=y.p+"static/zhong.c1924b73.svg"},"19Vz":function(nt,Ye,y){(function(z){z(y("VrN/"))})(function(z){z.defineOption("placeholder","",function(L,R,F){var O=F&&F!=z.Init;if(R&&!O)L.on("blur",ue),L.on("change",q),L.on("swapDoc",q),z.on(L.getInputField(),"compositionupdate",L.state.placeholderCompose=function(){me(L)}),q(L);else if(!R&&O){L.off("blur",ue),L.off("change",q),L.off("swapDoc",q),z.off(L.getInputField(),"compositionupdate",L.state.placeholderCompose),ve(L);var T=L.getWrapperElement();T.className=T.className.replace(" CodeMirror-empty","")}R&&!L.hasFocus()&&ue(L)});function ve(L){L.state.placeholder&&(L.state.placeholder.parentNode.removeChild(L.state.placeholder),L.state.placeholder=null)}function Z(L){ve(L);var R=L.state.placeholder=document.createElement("pre");R.style.cssText="height: 0; overflow: visible",R.style.direction=L.getOption("direction"),R.className="CodeMirror-placeholder CodeMirror-line-like";var F=L.getOption("placeholder");typeof F=="string"&&(F=document.createTextNode(F)),R.appendChild(F),L.display.lineSpace.insertBefore(R,L.display.lineSpace.firstChild)}function me(L){setTimeout(function(){var R=!1,F=L.getInputField();F.nodeName=="TEXTAREA"?R=!F.value:L.lineCount()==1&&(R=!/[^\u200b]/.test(F.querySelector(".CodeMirror-line").textContent)),R?Z(L):ve(L)},20)}function ue(L){P(L)&&Z(L)}function q(L){var R=L.getWrapperElement(),F=P(L);R.className=R.className.replace(" CodeMirror-empty","")+(F?" CodeMirror-empty":""),F?Z(L):ve(L)}function P(L){return L.lineCount()===1&&L.getLine(0)===""}})},"1eCo":function(nt,Ye,y){(function(z){z(y("VrN/"))})(function(z){"use strict";var ve={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},Z={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};z.defineMode("xml",function(me,ue){var q=me.indentUnit,P={},L=ue.htmlMode?ve:Z;for(var R in L)P[R]=L[R];for(var R in ue)P[R]=ue[R];var F,O;function T(E,K){function X(Y){return K.tokenize=Y,Y(E,K)}var C=E.next();if(C=="<")return E.eat("!")?E.eat("[")?E.match("CDATA[")?X(W("atom","]]>")):null:E.match("--")?X(W("comment","-->")):E.match("DOCTYPE",!0,!0)?(E.eatWhile(/[\w\._\-]/),X(V(1))):null:E.eat("?")?(E.eatWhile(/[\w\._\-]/),K.tokenize=W("meta","?>"),"meta"):(F=E.eat("/")?"closeTag":"openTag",K.tokenize=ee,"tag bracket");if(C=="&"){var k;return E.eat("#")?E.eat("x")?k=E.eatWhile(/[a-fA-F\d]/)&&E.eat(";"):k=E.eatWhile(/[\d]/)&&E.eat(";"):k=E.eatWhile(/[\w\.\-:]/)&&E.eat(";"),k?"atom":"error"}else return E.eatWhile(/[^&<]/),null}T.isInText=!0;function ee(E,K){var X=E.next();if(X==">"||X=="/"&&E.eat(">"))return K.tokenize=T,F=X==">"?"endTag":"selfcloseTag","tag bracket";if(X=="=")return F="equals",null;if(X=="<"){K.tokenize=T,K.state=be,K.tagName=K.tagStart=null;var C=K.tokenize(E,K);return C?C+" tag error":"tag error"}else return/[\'\"]/.test(X)?(K.tokenize=U(X),K.stringStartCol=E.column(),K.tokenize(E,K)):(E.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function U(E){var K=function(X,C){for(;!X.eol();)if(X.next()==E){C.tokenize=ee;break}return"string"};return K.isInAttribute=!0,K}function W(E,K){return function(X,C){for(;!X.eol();){if(X.match(K)){C.tokenize=T;break}X.next()}return E}}function V(E){return function(K,X){for(var C;(C=K.next())!=null;){if(C=="<")return X.tokenize=V(E+1),X.tokenize(K,X);if(C==">")if(E==1){X.tokenize=T;break}else return X.tokenize=V(E-1),X.tokenize(K,X)}return"meta"}}function $(E,K,X){this.prev=E.context,this.tagName=K,this.indent=E.indented,this.startOfLine=X,(P.doNotIndent.hasOwnProperty(K)||E.context&&E.context.noIndent)&&(this.noIndent=!0)}function ie(E){E.context&&(E.context=E.context.prev)}function re(E,K){for(var X;;){if(!E.context)return;if(X=E.context.tagName,!P.contextGrabbers.hasOwnProperty(X)||!P.contextGrabbers[X].hasOwnProperty(K))return;ie(E)}}function be(E,K,X){return E=="openTag"?(X.tagStart=K.column(),je):E=="closeTag"?fe:be}function je(E,K,X){return E=="word"?(X.tagName=K.current(),O="tag",pe):P.allowMissingTagName&&E=="endTag"?(O="tag bracket",pe(E,K,X)):(O="error",je)}function fe(E,K,X){if(E=="word"){var C=K.current();return X.context&&X.context.tagName!=C&&P.implicitlyClosed.hasOwnProperty(X.context.tagName)&&ie(X),X.context&&X.context.tagName==C||P.matchClosing===!1?(O="tag",le):(O="tag error",v)}else return P.allowMissingTagName&&E=="endTag"?(O="tag bracket",le(E,K,X)):(O="error",v)}function le(E,K,X){return E!="endTag"?(O="error",le):(ie(X),be)}function v(E,K,X){return O="error",le(E,K,X)}function pe(E,K,X){if(E=="word")return O="attribute",ne;if(E=="endTag"||E=="selfcloseTag"){var C=X.tagName,k=X.tagStart;return X.tagName=X.tagStart=null,E=="selfcloseTag"||P.autoSelfClosers.hasOwnProperty(C)?re(X,C):(re(X,C),X.context=new $(X,C,k==X.indented)),be}return O="error",pe}function ne(E,K,X){return E=="equals"?ye:(P.allowMissing||(O="error"),pe(E,K,X))}function ye(E,K,X){return E=="string"?j:E=="word"&&P.allowUnquoted?(O="string",pe):(O="error",pe(E,K,X))}function j(E,K,X){return E=="string"?j:pe(E,K,X)}return{startState:function(E){var K={tokenize:T,state:be,indented:E||0,tagName:null,tagStart:null,context:null};return E!=null&&(K.baseIndent=E),K},token:function(E,K){if(!K.tagName&&E.sol()&&(K.indented=E.indentation()),E.eatSpace())return null;F=null;var X=K.tokenize(E,K);return(X||F)&&X!="comment"&&(O=null,K.state=K.state(F||X,E,K),O&&(X=O=="error"?X+" error":O)),X},indent:function(E,K,X){var C=E.context;if(E.tokenize.isInAttribute)return E.tagStart==E.indented?E.stringStartCol+1:E.indented+q;if(C&&C.noIndent)return z.Pass;if(E.tokenize!=ee&&E.tokenize!=T)return X?X.match(/^(\s*)/)[0].length:0;if(E.tagName)return P.multilineTagIndentPastTag!==!1?E.tagStart+E.tagName.length+2:E.tagStart+q*(P.multilineTagIndentFactor||1);if(P.alignCDATA&&/<!\[CDATA\[/.test(K))return 0;var k=K&&/^<(\/)?([\w_:\.-]*)/.exec(K);if(k&&k[1])for(;C;)if(C.tagName==k[2]){C=C.prev;break}else if(P.implicitlyClosed.hasOwnProperty(C.tagName))C=C.prev;else break;else if(k)for(;C;){var Y=P.contextGrabbers[C.tagName];if(Y&&Y.hasOwnProperty(k[2]))C=C.prev;else break}for(;C&&C.prev&&!C.startOfLine;)C=C.prev;return C?C.indent+q:E.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:P.htmlMode?"html":"xml",helperType:P.htmlMode?"html":"xml",skipAttribute:function(E){E.state==ye&&(E.state=pe)},xmlCurrentTag:function(E){return E.tagName?{name:E.tagName,close:E.type=="closeTag"}:null},xmlCurrentContext:function(E){for(var K=[],X=E.context;X;X=X.prev)X.tagName&&K.push(X.tagName);return K.reverse()}}}),z.defineMIME("text/xml","xml"),z.defineMIME("application/xml","xml"),z.mimeModes.hasOwnProperty("text/html")||z.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"6+eU":function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return le});var z=y("wx14"),ve=y("rePB"),Z=y("VTBJ"),me=y("1OyB"),ue=y("vuIU"),q=y("Ji7U"),P=y("LK+K"),L=y("q1tI"),R=y.n(L),F=y("TSYQ"),O=y.n(F),T=function(pe){var ne,ye="".concat(pe.rootPrefixCls,"-item"),j=O()(ye,"".concat(ye,"-").concat(pe.page),(ne={},Object(ve.a)(ne,"".concat(ye,"-active"),pe.active),Object(ve.a)(ne,pe.className,!!pe.className),Object(ve.a)(ne,"".concat(ye,"-disabled"),!pe.page),ne)),E=function(){pe.onClick(pe.page)},K=function(C){pe.onKeyPress(C,pe.onClick,pe.page)};return R.a.createElement("li",{title:pe.showTitle?pe.page:null,className:j,onClick:E,onKeyPress:K,tabIndex:"0"},pe.itemRender(pe.page,"page",R.a.createElement("a",{rel:"nofollow"},pe.page)))},ee=T,U={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},W=function(v){Object(q.a)(ne,v);var pe=Object(P.a)(ne);function ne(){var ye;Object(me.a)(this,ne);for(var j=arguments.length,E=new Array(j),K=0;K<j;K++)E[K]=arguments[K];return ye=pe.call.apply(pe,[this].concat(E)),ye.state={goInputText:""},ye.buildOptionText=function(X){return"".concat(X," ").concat(ye.props.locale.items_per_page)},ye.changeSize=function(X){ye.props.changeSize(Number(X))},ye.handleChange=function(X){ye.setState({goInputText:X.target.value})},ye.handleBlur=function(X){var C=ye.props,k=C.goButton,Y=C.quickGo,M=C.rootPrefixCls,de=ye.state.goInputText;if(k||de==="")return;if(X.relatedTarget&&(X.relatedTarget.className.indexOf("".concat(M,"-prev"))>=0||X.relatedTarget.className.indexOf("".concat(M,"-next"))>=0))return;ye.setState({goInputText:""}),Y(ye.getValidValue())},ye.go=function(X){var C=ye.state.goInputText;if(C==="")return;(X.keyCode===U.ENTER||X.type==="click")&&(ye.setState({goInputText:""}),ye.props.quickGo(ye.getValidValue()))},ye}return Object(ue.a)(ne,[{key:"getValidValue",value:function(){var j=this.state,E=j.goInputText,K=j.current;return!E||isNaN(E)?K:Number(E)}},{key:"getPageSizeOptions",value:function(){var j=this.props,E=j.pageSize,K=j.pageSizeOptions;return K.some(function(X){return X.toString()===E.toString()})?K:K.concat([E.toString()]).sort(function(X,C){var k=isNaN(Number(X))?0:Number(X),Y=isNaN(Number(C))?0:Number(C);return k-Y})}},{key:"render",value:function(){var j=this,E=this.props,K=E.pageSize,X=E.locale,C=E.rootPrefixCls,k=E.changeSize,Y=E.quickGo,M=E.goButton,de=E.selectComponentClass,_=E.buildOptionText,m=E.selectPrefixCls,Q=E.disabled,Oe=this.state.goInputText,Ce="".concat(C,"-options"),Ve=de,$e=null,_e=null,Le=null;if(!k&&!Y)return null;var Se=this.getPageSizeOptions();if(k&&Ve){var Te=Se.map(function(te,w){return R.a.createElement(Ve.Option,{key:w,value:te.toString()},(_||j.buildOptionText)(te))});$e=R.a.createElement(Ve,{disabled:Q,prefixCls:m,showSearch:!1,className:"".concat(Ce,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(K||Se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(w){return w.parentNode}},Te)}return Y&&(M&&(Le=typeof M=="boolean"?R.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:Q,className:"".concat(Ce,"-quick-jumper-button")},X.jump_to_confirm):R.a.createElement("span",{onClick:this.go,onKeyUp:this.go},M)),_e=R.a.createElement("div",{className:"".concat(Ce,"-quick-jumper")},X.jump_to,R.a.createElement("input",{disabled:Q,type:"text",value:Oe,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),X.page,Le)),R.a.createElement("li",{className:"".concat(Ce)},$e,_e)}}]),ne}(R.a.Component);W.defaultProps={pageSizeOptions:["10","20","50","100"]};var V=W,$=y("N2Kk");function ie(){}function re(v){return typeof v=="number"&&isFinite(v)&&Math.floor(v)===v}function be(v,pe,ne){return ne}function je(v,pe,ne){var ye=typeof v=="undefined"?pe.pageSize:v;return Math.floor((ne.total-1)/ye)+1}var fe=function(v){Object(q.a)(ne,v);var pe=Object(P.a)(ne);function ne(ye){var j;Object(me.a)(this,ne),j=pe.call(this,ye),j.getJumpPrevPage=function(){return Math.max(1,j.state.current-(j.props.showLessItems?3:5))},j.getJumpNextPage=function(){return Math.min(je(void 0,j.state,j.props),j.state.current+(j.props.showLessItems?3:5))},j.getItemIcon=function(k,Y){var M=j.props.prefixCls,de=k||R.a.createElement("button",{type:"button","aria-label":Y,className:"".concat(M,"-item-link")});return typeof k=="function"&&(de=R.a.createElement(k,Object(Z.a)({},j.props))),de},j.savePaginationNode=function(k){j.paginationNode=k},j.isValid=function(k){return re(k)&&k!==j.state.current},j.shouldDisplayQuickJumper=function(){var k=j.props,Y=k.showQuickJumper,M=k.pageSize,de=k.total;return de<=M?!1:Y},j.handleKeyDown=function(k){(k.keyCode===U.ARROW_UP||k.keyCode===U.ARROW_DOWN)&&k.preventDefault()},j.handleKeyUp=function(k){var Y=j.getValidValue(k),M=j.state.currentInputValue;Y!==M&&j.setState({currentInputValue:Y}),k.keyCode===U.ENTER?j.handleChange(Y):k.keyCode===U.ARROW_UP?j.handleChange(Y-1):k.keyCode===U.ARROW_DOWN&&j.handleChange(Y+1)},j.changePageSize=function(k){var Y=j.state.current,M=je(k,j.state,j.props);Y=Y>M?M:Y,M===0&&(Y=j.state.current),typeof k=="number"&&("pageSize"in j.props||j.setState({pageSize:k}),"current"in j.props||j.setState({current:Y,currentInputValue:Y})),j.props.onShowSizeChange(Y,k),"onChange"in j.props&&j.props.onChange&&j.props.onChange(Y,k)},j.handleChange=function(k){var Y=j.props.disabled,M=k;if(j.isValid(M)&&!Y){var de=je(void 0,j.state,j.props);M>de?M=de:M<1&&(M=1),"current"in j.props||j.setState({current:M,currentInputValue:M});var _=j.state.pageSize;return j.props.onChange(M,_),M}return j.state.current},j.prev=function(){j.hasPrev()&&j.handleChange(j.state.current-1)},j.next=function(){j.hasNext()&&j.handleChange(j.state.current+1)},j.jumpPrev=function(){j.handleChange(j.getJumpPrevPage())},j.jumpNext=function(){j.handleChange(j.getJumpNextPage())},j.hasPrev=function(){return j.state.current>1},j.hasNext=function(){return j.state.current<je(void 0,j.state,j.props)},j.runIfEnter=function(k,Y){if(k.key==="Enter"||k.charCode===13){for(var M=arguments.length,de=new Array(M>2?M-2:0),_=2;_<M;_++)de[_-2]=arguments[_];Y.apply(void 0,de)}},j.runIfEnterPrev=function(k){j.runIfEnter(k,j.prev)},j.runIfEnterNext=function(k){j.runIfEnter(k,j.next)},j.runIfEnterJumpPrev=function(k){j.runIfEnter(k,j.jumpPrev)},j.runIfEnterJumpNext=function(k){j.runIfEnter(k,j.jumpNext)},j.handleGoTO=function(k){(k.keyCode===U.ENTER||k.type==="click")&&j.handleChange(j.state.currentInputValue)};var E=ye.onChange!==ie,K="current"in ye;K&&!E&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var X=ye.defaultCurrent;"current"in ye&&(X=ye.current);var C=ye.defaultPageSize;return"pageSize"in ye&&(C=ye.pageSize),X=Math.min(X,je(C,void 0,ye)),j.state={current:X,currentInputValue:X,pageSize:C},j}return Object(ue.a)(ne,[{key:"componentDidUpdate",value:function(j,E){var K=this.props.prefixCls;if(E.current!==this.state.current&&this.paginationNode){var X=this.paginationNode.querySelector(".".concat(K,"-item-").concat(E.current));X&&document.activeElement===X&&X.blur()}}},{key:"getValidValue",value:function(j){var E=j.target.value,K=je(void 0,this.state,this.props),X=this.state.currentInputValue,C;return E===""?C=E:isNaN(Number(E))?C=X:E>=K?C=K:C=Number(E),C}},{key:"getShowSizeChanger",value:function(){var j=this.props,E=j.showSizeChanger,K=j.total,X=j.totalBoundaryShowSizeChanger;return typeof E!="undefined"?E:K>X}},{key:"renderPrev",value:function(j){var E=this.props,K=E.prevIcon,X=E.itemRender,C=X(j,"prev",this.getItemIcon(K,"prev page")),k=!this.hasPrev();return Object(L.isValidElement)(C)?Object(L.cloneElement)(C,{disabled:k}):C}},{key:"renderNext",value:function(j){var E=this.props,K=E.nextIcon,X=E.itemRender,C=X(j,"next",this.getItemIcon(K,"next page")),k=!this.hasNext();return Object(L.isValidElement)(C)?Object(L.cloneElement)(C,{disabled:k}):C}},{key:"render",value:function(){var j=this,E=this.props,K=E.prefixCls,X=E.className,C=E.style,k=E.disabled,Y=E.hideOnSinglePage,M=E.total,de=E.locale,_=E.showQuickJumper,m=E.showLessItems,Q=E.showTitle,Oe=E.showTotal,Ce=E.simple,Ve=E.itemRender,$e=E.showPrevNextJumpers,_e=E.jumpPrevIcon,Le=E.jumpNextIcon,Se=E.selectComponentClass,Te=E.selectPrefixCls,te=E.pageSizeOptions,w=this.state,Ie=w.current,dt=w.pageSize,kt=w.currentInputValue;if(Y===!0&&M<=dt)return null;var Qe=je(void 0,this.state,this.props),Je=[],Pe=null,ze=null,Xe=null,qe=null,He=null,Be=_&&_.goButton,Fe=m?1:2,Lt=Ie-1>0?Ie-1:0,ht=Ie+1<Qe?Ie+1:Qe,ot=Object.keys(this.props).reduce(function(b,x){return(x.substr(0,5)==="data-"||x.substr(0,5)==="aria-"||x==="role")&&(b[x]=j.props[x]),b},{});if(Ce)return Be&&(typeof Be=="boolean"?He=R.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},de.jump_to_confirm):He=R.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Be),He=R.a.createElement("li",{title:Q?"".concat(de.jump_to).concat(Ie,"/").concat(Qe):null,className:"".concat(K,"-simple-pager")},He)),R.a.createElement("ul",Object(z.a)({className:O()(K,"".concat(K,"-simple"),Object(ve.a)({},"".concat(K,"-disabled"),k),X),style:C,ref:this.savePaginationNode},ot),R.a.createElement("li",{title:Q?de.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:O()("".concat(K,"-prev"),Object(ve.a)({},"".concat(K,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Lt)),R.a.createElement("li",{title:Q?"".concat(Ie,"/").concat(Qe):null,className:"".concat(K,"-simple-pager")},R.a.createElement("input",{type:"text",value:kt,disabled:k,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),R.a.createElement("span",{className:"".concat(K,"-slash")},"/"),Qe),R.a.createElement("li",{title:Q?de.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:O()("".concat(K,"-next"),Object(ve.a)({},"".concat(K,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(ht)),He);if(Qe<=3+Fe*2){var st={locale:de,rootPrefixCls:K,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:Q,itemRender:Ve};Qe||Je.push(R.a.createElement(ee,Object(z.a)({},st,{key:"noPager",page:Qe,className:"".concat(K,"-disabled")})));for(var Et=1;Et<=Qe;Et+=1){var bt=Ie===Et;Je.push(R.a.createElement(ee,Object(z.a)({},st,{key:Et,page:Et,active:bt})))}}else{var ft=m?de.prev_3:de.prev_5,we=m?de.next_3:de.next_5;$e&&(Pe=R.a.createElement("li",{title:Q?ft:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:O()("".concat(K,"-jump-prev"),Object(ve.a)({},"".concat(K,"-jump-prev-custom-icon"),!!_e))},Ve(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(_e,"prev page"))),ze=R.a.createElement("li",{title:Q?we:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:O()("".concat(K,"-jump-next"),Object(ve.a)({},"".concat(K,"-jump-next-custom-icon"),!!Le))},Ve(this.getJumpNextPage(),"jump-next",this.getItemIcon(Le,"next page")))),qe=R.a.createElement(ee,{locale:de,last:!0,rootPrefixCls:K,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Qe,page:Qe,active:!1,showTitle:Q,itemRender:Ve}),Xe=R.a.createElement(ee,{locale:de,rootPrefixCls:K,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:Q,itemRender:Ve});var St=Math.max(1,Ie-Fe),lt=Math.min(Ie+Fe,Qe);Ie-1<=Fe&&(lt=1+Fe*2),Qe-Ie<=Fe&&(St=Qe-Fe*2);for(var ke=St;ke<=lt;ke+=1){var Re=Ie===ke;Je.push(R.a.createElement(ee,{locale:de,rootPrefixCls:K,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ke,page:ke,active:Re,showTitle:Q,itemRender:Ve}))}Ie-1>=Fe*2&&Ie!==1+2&&(Je[0]=Object(L.cloneElement)(Je[0],{className:"".concat(K,"-item-after-jump-prev")}),Je.unshift(Pe)),Qe-Ie>=Fe*2&&Ie!==Qe-2&&(Je[Je.length-1]=Object(L.cloneElement)(Je[Je.length-1],{className:"".concat(K,"-item-before-jump-next")}),Je.push(ze)),St!==1&&Je.unshift(Xe),lt!==Qe&&Je.push(qe)}var D=null;Oe&&(D=R.a.createElement("li",{className:"".concat(K,"-total-text")},Oe(M,[M===0?0:(Ie-1)*dt+1,Ie*dt>M?M:Ie*dt])));var B=!this.hasPrev()||!Qe,I=!this.hasNext()||!Qe;return R.a.createElement("ul",Object(z.a)({className:O()(K,X,Object(ve.a)({},"".concat(K,"-disabled"),k)),style:C,unselectable:"unselectable",ref:this.savePaginationNode},ot),D,R.a.createElement("li",{title:Q?de.prev_page:null,onClick:this.prev,tabIndex:B?null:0,onKeyPress:this.runIfEnterPrev,className:O()("".concat(K,"-prev"),Object(ve.a)({},"".concat(K,"-disabled"),B)),"aria-disabled":B},this.renderPrev(Lt)),Je,R.a.createElement("li",{title:Q?de.next_page:null,onClick:this.next,tabIndex:I?null:0,onKeyPress:this.runIfEnterNext,className:O()("".concat(K,"-next"),Object(ve.a)({},"".concat(K,"-disabled"),I)),"aria-disabled":I},this.renderNext(ht)),R.a.createElement(V,{disabled:k,locale:de,rootPrefixCls:K,selectComponentClass:Se,selectPrefixCls:Te,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ie,pageSize:dt,pageSizeOptions:te,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Be}))}}],[{key:"getDerivedStateFromProps",value:function(j,E){var K={};if("current"in j&&(K.current=j.current,j.current!==E.current&&(K.currentInputValue=K.current)),"pageSize"in j&&j.pageSize!==E.pageSize){var X=E.current,C=je(j.pageSize,E,j);X=X>C?C:X,"current"in j||(K.current=X,K.currentInputValue=X),K.pageSize=j.pageSize}return K}}]),ne}(R.a.Component);fe.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:ie,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:ie,locale:$.a,style:{},itemRender:be,totalBoundaryShowSizeChanger:50};var le=fe},"6K3P":function(nt,Ye,y){nt.exports=y.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(nt,Ye,y){"use strict";var z=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),ve=new Uint8Array(16);function Z(){if(!z)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z(ve)}var me=/^(?:[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 ue(ee){return typeof ee=="string"&&me.test(ee)}for(var q=ue,P=[],L=0;L<256;++L)P.push((L+256).toString(16).substr(1));function R(ee){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,W=(P[ee[U+0]]+P[ee[U+1]]+P[ee[U+2]]+P[ee[U+3]]+"-"+P[ee[U+4]]+P[ee[U+5]]+"-"+P[ee[U+6]]+P[ee[U+7]]+"-"+P[ee[U+8]]+P[ee[U+9]]+"-"+P[ee[U+10]]+P[ee[U+11]]+P[ee[U+12]]+P[ee[U+13]]+P[ee[U+14]]+P[ee[U+15]]).toLowerCase();if(!q(W))throw TypeError("Stringified UUID is invalid");return W}var F=R;function O(ee,U,W){ee=ee||{};var V=ee.random||(ee.rng||Z)();if(V[6]=V[6]&15|64,V[8]=V[8]&63|128,U){W=W||0;for(var $=0;$<16;++$)U[W+$]=V[$];return U}return F(V)}var T=Ye.a=O},"7ahc":function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return je});var z=y("k1fw"),ve=y("0Owb"),Z=y("+L6B"),me=y("2/Rp"),ue=y("y8nQ"),q=y("Vl3Y"),P=y("tJVT"),L=y("OaEy"),R=y("2fM7"),F=y("q1tI"),O=y.n(F),T=y("VrN/"),ee=y.n(T),U=y("p77/"),W=y.n(U),V=y("c5Ni"),$=y.n(V),ie=R.a.Option,re={labelCol:{span:4},wrapperCol:{span:20}},be={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"]};Ye.b=function(fe){var le=fe.callback,v=fe.onCancel,pe=Object(F.useState)("python"),ne=Object(P.a)(pe,2),ye=ne[0],j=ne[1];function E(X){j(be[X][1])}function K(X){le(X)}return O.a.createElement(q.a,Object(ve.a)({},re,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:K}),O.a.createElement(q.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},O.a.createElement(R.a,{onChange:E},Object.keys(be).map(function(X){return O.a.createElement(ie,{key:X,value:X},be[X][0])}))),O.a.createElement(q.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},O.a.createElement(je,{mode:ye})),O.a.createElement("div",{className:"flex-container flex-end"},O.a.createElement(me.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),O.a.createElement(me.a,{type:"ghost",onClick:v},"\u53D6\u6D88")))};function je(fe){var le=fe.value,v=fe.onChange,pe=fe.mode,ne=fe.options,ye=ne===void 0?{}:ne,j=Object(F.useRef)(),E=Object(F.useState)(),K=Object(P.a)(E,2),X=K[0],C=K[1];return Object(F.useEffect)(function(){if(X){function k(Y){var M=Y.getValue();v&&v(M)}return X.on("change",k),function(){X.off("change",k)}}},[X,v]),Object(F.useEffect)(function(){X&&X.setOption("mode",pe)},[X,pe]),Object(F.useEffect)(function(){X&&((le!==X.getValue()||le==="")&&setTimeout(function(){X.setValue(le||" ")},300))},[X,le]),Object(F.useEffect)(function(){if(j.current&&!X){var k=ee.a.fromTextArea(j.current,Object(z.a)({mode:pe,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ye));C(k)}},[j.current,X]),O.a.createElement("div",{className:"my-codemirror-container"},O.a.createElement("textarea",{ref:j}))}},"7ixt":function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return Z});var z={adjustX:1,adjustY:1},ve=[0,0],Z={left:{points:["cr","cl"],overflow:z,offset:[-4,0],targetOffset:ve},right:{points:["cl","cr"],overflow:z,offset:[4,0],targetOffset:ve},top:{points:["bc","tc"],overflow:z,offset:[0,-4],targetOffset:ve},bottom:{points:["tc","bc"],overflow:z,offset:[0,4],targetOffset:ve},topLeft:{points:["bl","tl"],overflow:z,offset:[0,-4],targetOffset:ve},leftTop:{points:["tr","tl"],overflow:z,offset:[-4,0],targetOffset:ve},topRight:{points:["br","tr"],overflow:z,offset:[0,-4],targetOffset:ve},rightTop:{points:["tl","tr"],overflow:z,offset:[4,0],targetOffset:ve},bottomRight:{points:["tr","br"],overflow:z,offset:[0,4],targetOffset:ve},rightBottom:{points:["bl","br"],overflow:z,offset:[4,0],targetOffset:ve},bottomLeft:{points:["tl","bl"],overflow:z,offset:[0,4],targetOffset:ve},leftBottom:{points:["br","bl"],overflow:z,offset:[-4,0],targetOffset:ve}},me=Z},"7qnI":function(nt,Ye,y){"use strict";var z=y("5Dmo"),ve=y("3S7+"),Z=y("fWQN"),me=y("mtLc"),ue=y("yKVA"),q=y("879j"),P=y("5NDa"),L=y("5rEg"),R=y("q1tI"),F=y.n(R),O=y("O2Wb"),T=y.n(O),ee=L.a.TextArea,U=function(W){Object(ue.a)($,W);var V=Object(q.a)($);function $(){return Object(Z.a)(this,$),V.apply(this,arguments)}return Object(me.a)($,[{key:"render",value:function(){var re=this,be=this.props,je=be.index,fe=be.onAnswerChange,le=be.addChildAnswer,v=be.exerciseIsPublish,pe=be.answers,ne=be.activeOptionErrorIndex,ye=be.flex,j=ye===void 0?"0 0 1000px":ye;return F.a.createElement("div",{className:T.a.flex},F.a.createElement("div",{className:"".concat(T.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",je+1,"):"),F.a.createElement("div",{className:"".concat(T.a.flex," ").concat(T.a.flex1),style:{flexDirection:"column"}},pe.map(function(E,K){var X="".concat(je,"-").concat(K);return F.a.createElement("div",{className:"".concat(T.a.flex," ").concat(T.a.flex1),key:K},F.a.createElement("div",{className:T.a.flex1,style:{flex:j}},F.a.createElement("div",null,F.a.createElement(ee,{className:X===ne?T.a.error:"",spellCheck:!1,rows:4,value:E||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(K==0?"":"(\u53EF\u9009)"),onChange:function(k){return fe(je,K,k.target.value)},style:{minHeight:95}}))),!v&&F.a.createElement(F.a.Fragment,null,K!=0&&F.a.createElement(ve.a,{title:"\u5220\u9664"},F.a.createElement("i",{className:"".concat(T.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return re.props.deleteChildAnswer(je,K)},style:{float:"right"}})),K===0&&F.a.createElement(ve.a,{title:"\u5220\u9664"},F.a.createElement("i",{className:"".concat(T.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return re.props.deleteChildAnswermain(je,K)},style:{float:"right"}})),F.a.createElement(ve.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},F.a.createElement("i",{className:"".concat(T.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return le(je)},style:{float:"right",visibility:K==pe.length-1?"":"hidden"}}))))})))}}]),$}(R.Component);Ye.a=U},"8EBN":function(nt,Ye,y){(function(z){z(y("VrN/"))})(function(z){"use strict";z.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 ve=0;ve<z.modeInfo.length;ve++){var Z=z.modeInfo[ve];Z.mimes&&(Z.mime=Z.mimes[0])}z.findModeByMIME=function(me){me=me.toLowerCase();for(var ue=0;ue<z.modeInfo.length;ue++){var q=z.modeInfo[ue];if(q.mime==me)return q;if(q.mimes){for(var P=0;P<q.mimes.length;P++)if(q.mimes[P]==me)return q}}if(/\+xml$/.test(me))return z.findModeByMIME("application/xml");if(/\+json$/.test(me))return z.findModeByMIME("application/json")},z.findModeByExtension=function(me){me=me.toLowerCase();for(var ue=0;ue<z.modeInfo.length;ue++){var q=z.modeInfo[ue];if(q.ext){for(var P=0;P<q.ext.length;P++)if(q.ext[P]==me)return q}}},z.findModeByFileName=function(me){for(var ue=0;ue<z.modeInfo.length;ue++){var q=z.modeInfo[ue];if(q.file&&q.file.test(me))return q}var P=me.lastIndexOf("."),L=P>-1&&me.substring(P+1,me.length);if(L)return z.findModeByExtension(L)},z.findModeByName=function(me){me=me.toLowerCase();for(var ue=0;ue<z.modeInfo.length;ue++){var q=z.modeInfo[ue];if(q.name.toLowerCase()==me)return q;if(q.alias){for(var P=0;P<q.alias.length;P++)if(q.alias[P].toLowerCase()==me)return q}}}})},"8hTe":function(nt,Ye,y){nt.exports={button:"button___1wy9m"}},"9Bee":function(nt,Ye,y){"use strict";var z=y("DYRE"),ve=y("zeV3"),Z=y("+L6B"),me=y("2/Rp"),ue=y("k1fw"),q=y("9og8"),P=y("tJVT"),L=y("WmNS"),R=y.n(L),F=y("q1tI"),O=y.n(F),T=y("vg9a"),ee=y("DlQD"),U=y.n(ee),W=y("rUJ1");function V(h,o){var a=h.match(/^(\s+)(?:```)/);if(a===null)return o;var u=a[1];return o.split(`
`).map(function(p){var c=p.match(/^\s+/);if(c===null)return p;var G=Object(P.a)(c,1),Ne=G[0];return Ne.length>=u.length?p.slice(u.length):p}).join(`
`)}var $=[],ie=["<ul>"],re=new U.a.Renderer,be=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function je(){$.length=0,ie=["<ul>"]}var fe={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function le(h,o,a,u){if(o>=h.length||h[o].level<=a)return o;var p=h[o];u.push("<li><a href='#"+p.anchor+"'>"+p.text+"</a>"),o++;var c=[];return o=le(h,o,p.level,c),c.length>0&&(u.push("<ul>"),c.forEach(function(G){u.push(G)}),u.push("</ul>")),u.push("</li>"),o=le(h,o,a,u),o}function v(){return le($,0,0,ie),ie.push("</ul>"),ie.join("")}var pe={heading:function(o){var a=be.exec(o);if(a)return{type:"heading",raw:a[0],depth:a[1].length,text:a[2]}},fences:function(o){var a=this.rules.block.fences.exec(o);if(a){var u=a[0],p=V(u,a[3]||""),c=a[2]?a[2].trim():a[2];if(["latex","katex","math"].indexOf(c)>=0){var G=j(),Ne=p;p=G,E[G]={type:"block",expression:Ne}}return{type:"code",raw:u,lang:c,text:p}}}},ne=/(?:\${2})([^\n`]+?)(?:\${2})/gi,ye=0,j=function(){return"__special_katext_id_".concat(ye++,"__")},E={};function K(){return E}function X(){ye=0,E={}}function C(h){return h=h.replace(ne,function(o,a){var u=j();return E[u]={type:"inline",expression:a},u}),h}var k=re.listitem;re.listitem=function(h){return k(C(h))};var Y=re.paragraph;re.paragraph=function(h){return Y(C(h))};var M=re.tablecell;re.tablecell=function(h,o){return M(C(h),o)},re.code=function(h,o,a){var u=(o||"").match(/\S*/)[0];return u?["latex","katex","math"].indexOf(u)>=0?"<p class='editormd-tex'>".concat(h,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(o,'">').concat(a?h:Object(W.escape)(h,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(a?h:Object(W.escape)(h,!0))+"</code></pre>"},re.heading=function(h,o,a){var u=this.options.headerPrefix+a.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return $.push({anchor:u,level:o,text:h}),"<h"+o+' id="'+u+'">'+h+"</h"+o+">"},U.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),U.a.use({tokenizer:pe,renderer:re});var de=U.a,_=y("SJMd"),m=y("ulZh"),Q=y.n(m),Oe=y("m3rI"),Ce=y("Oy/b"),Ve=y("p5ED"),$e=y("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var _e=function(h,o){return(_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(h,o)};function Le(h,o){function a(){this.constructor=h}_e(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function Se(h,o,a,u){return new(a||(a=Promise))(function(p,c){function G(wt){try{he(u.next(wt))}catch(se){c(se)}}function Ne(wt){try{he(u.throw(wt))}catch(se){c(se)}}function he(wt){var se;wt.done?p(wt.value):(se=wt.value,se instanceof a?se:new a(function(J){J(se)})).then(G,Ne)}he((u=u.apply(h,o||[])).next())})}function Te(h,o){var a,u,p,c,G={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return c={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ne(he){return function(wt){return function(se){if(a)throw new TypeError("Generator is already executing.");for(;G;)try{if(a=1,u&&(p=2&se[0]?u.return:se[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,se[1])).done)return p;switch(u=0,p&&(se=[2&se[0],p.value]),se[0]){case 0:case 1:p=se;break;case 4:return G.label++,{value:se[1],done:!1};case 5:G.label++,u=se[1],se=[0];continue;case 7:se=G.ops.pop(),G.trys.pop();continue;default:if(!(p=G.trys,(p=p.length>0&&p[p.length-1])||se[0]!==6&&se[0]!==2)){G=0;continue}if(se[0]===3&&(!p||se[1]>p[0]&&se[1]<p[3])){G.label=se[1];break}if(se[0]===6&&G.label<p[1]){G.label=p[1],p=se;break}if(p&&G.label<p[2]){G.label=p[2],G.ops.push(se);break}p[2]&&G.ops.pop(),G.trys.pop();continue}se=o.call(h,G)}catch(J){se=[6,J],u=0}finally{a=p=0}if(5&se[0])throw se[1];return{value:se[0]?se[1]:void 0,done:!0}}([he,wt])}}}function te(){for(var h=0,o=0,a=arguments.length;o<a;o++)h+=arguments[o].length;var u=Array(h),p=0;for(o=0;o<a;o++)for(var c=arguments[o],G=0,Ne=c.length;G<Ne;G++,p++)u[p]=c[G];return u}var w=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var c=p[u],G=c[0],Ne=c[1];o.setAttribute(G,Ne)}},h.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&h.setAttributes(p,u),p},h.createLine=function(o,a,u,p,c){var G=document.createElementNS("http://www.w3.org/2000/svg","line");return G.setAttribute("x1",o.toString()),G.setAttribute("y1",a.toString()),G.setAttribute("x2",u.toString()),G.setAttribute("y2",p.toString()),c&&h.setAttributes(G,c),G},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(p,u),p},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,p,c,G,Ne){var he=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(he,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",c.toString()],["refY",G.toString()]]),he.appendChild(Ne),he},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h}(),Ie=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),dt=function(){function h(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return h.prototype.rasterize=function(o,a,u){var p=this;return new Promise(function(c){var G=u!==void 0?u:document.createElement("canvas");o===null&&(p.markersOnly=!0,p.naturalSize=!1);var Ne=document.createElementNS("http://www.w3.org/2000/svg","svg");Ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ne.setAttribute("width",a.width.baseVal.valueAsString),Ne.setAttribute("height",a.height.baseVal.valueAsString),Ne.setAttribute("viewBox","0 0 "+a.viewBox.baseVal.width.toString()+" "+a.viewBox.baseVal.height.toString()),Ne.innerHTML=a.innerHTML,p.naturalSize===!0?(Ne.width.baseVal.value=o.naturalWidth,Ne.height.baseVal.value=o.naturalHeight):p.width!==void 0&&p.height!==void 0&&(Ne.width.baseVal.value=p.width,Ne.height.baseVal.value=p.height),G.width=Ne.width.baseVal.value,G.height=Ne.height.baseVal.value;var he=Ne.outerHTML,wt=G.getContext("2d");p.markersOnly!==!0&&wt.drawImage(o,0,0,G.width,G.height);var se=window.URL,J=new Image(G.width,G.height);J.setAttribute("crossOrigin","anonymous");var Me=new Blob([he],{type:"image/svg+xml"}),rt=se.createObjectURL(Me);J.onload=function(){wt.drawImage(J,0,0),se.revokeObjectURL(rt);var ct=G.toDataURL(p.imageType,p.imageQuality);c(ct)},J.src=rt})},h}(),kt=function(){},Qe=function(){function h(o){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),h.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},h.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)},h.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 Je("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Je("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Je("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Pe("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Pe("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),Je=function(h,o){this.selector=h,this.style=o},Pe=function(h,o){this.localName=h,this.style=o},ze=function(){function h(o,a,u,p,c){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=o,this.displayMode=a,this.markerItems=u,this.uiStyleSettings=p,this.styles=c,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return h.prototype.show=function(o){var a=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=o,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var u=document.createElement("div");u.className=this.toolbarBlockStyleClass.name,u.style.whiteSpace="nowrap",this.uiContainer.appendChild(u),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(u,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(c){var G=document.createElement("div");G.className=""+a.toolbarButtonStyleClass.name,G.setAttribute("data-type-name",c.typeName),G.innerHTML=c.icon,G.addEventListener("click",function(){a.markerToolbarButtonClicked(G,c)}),a.buttons.push(G),a.markerButtons.push(G)}),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()},h.prototype.addButtonClickListener=function(o){this.buttonClickListeners.push(o)},h.prototype.removeButtonClickListener=function(o){this.buttonClickListeners.indexOf(o)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(o),1)},h.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},h.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]))}},h.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")},h.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)})},h.prototype.addActionButton=function(o,a,u){var p=this,c=document.createElement("div");switch(c.className=""+this.toolbarButtonStyleClass.name,c.innerHTML=a,c.setAttribute("data-action",u),c.addEventListener("click",function(){p.actionToolbarButtonClicked(c,u)}),u){case"select":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":c.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":c.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":c.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":c.style.fill=this.uiStyleSettings.closeButtonColor}o.appendChild(c),this.buttons.push(c)},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Pe("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 Pe("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Pe("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Pe("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 Pe("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var o=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Pe("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 Pe("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Pe("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Je("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Je("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},h.prototype.markerToolbarButtonClicked=function(o,a){this.setActiveButton(o),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("marker",a)}),this.markerButtonOverflowBlock.style.display="none"},h.prototype.actionToolbarButtonClicked=function(o,a){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(u){return u("action",a)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},h.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)},h.prototype.setActiveMarkerButton=function(o){var a=this.markerButtons.find(function(u){return u.getAttribute("data-type-name")===o});a&&this.setActiveButton(a)},h.prototype.setCurrentMarker=function(o){var a=this;this.currentMarker=o,this.buttons.filter(function(u){return/delete|notes/.test(u.getAttribute("data-action"))}).forEach(function(u){a.currentMarker===void 0?(u.style.fillOpacity="0.4",u.style.pointerEvents="none"):(u.style.fillOpacity="1",u.style.pointerEvents="all")})},h}(),Xe=function(){function h(o,a,u,p){this.panels=[],this.panelButtons=[],this.markerjsContainer=o,this.displayMode=a,this.uiStyleSettings=u,this.styles=p,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return h.prototype.addStyles=function(){var o;this.toolboxStyleClass=this.styles.addClass(new Pe("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 Pe("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var a=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Pe("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Pe("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Pe("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 Pe("toolbox-panel-row_colors",`
background-color: `+((o=this.uiStyleSettings.toolboxBackgroundColor)!==null&&o!==void 0?o:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Pe("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 Pe("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Pe("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Je("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Je("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},h.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)},h.prototype.setPanelButtons=function(o){var a,u,p=this;this.panels=o,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((a=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&a!==void 0?a:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(c){var G;c.uiStyleSettings=p.uiStyleSettings;var Ne=document.createElement("div");Ne.className=p.toolboxButtonStyleClass.name+" "+((G=p.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&G!==void 0?G:p.toolboxButtonStyleColorsClass.name),Ne.innerHTML=c.icon,Ne.title=c.title,Ne.addEventListener("click",function(){p.panelButtonClick(c)}),p.panelButtons.push(Ne),p.buttonRow.appendChild(Ne)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},h.prototype.panelButtonClick=function(o){var a=this,u=-1;if(o!==this.activePanel){u=this.panels.indexOf(o),this.panelRow.innerHTML="";var p=o.getUi();p.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(p),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=o}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){a.displayMode==="inline"?a.panelRow.style.display="none":a.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(c,G){var Ne,he;c.className=a.toolboxButtonStyleClass.name+" "+(G===u?""+((Ne=a.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ne!==void 0?Ne:a.toolboxActiveButtonStyleColorsClass.name):""+((he=a.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&he!==void 0?he:a.toolboxButtonStyleColorsClass.name))})},h}(),qe=function(h,o){this.title=h,this.icon=o},He=function(h){function o(a,u,p,c){var G=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return G.colors=[],G.addTransparent=!1,G.colorBoxes=[],G.colors=u,G.currentColor=p,G.setCurrentColor=G.setCurrentColor.bind(G),G.getColorBox=G.getColorBox.bind(G),G}return Le(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.whiteSpace="nowrap",this.colors.forEach(function(p){var c=a.getColorBox(p);u.appendChild(c),a.colorBoxes.push(c)}),u},o.prototype.getColorBox=function(a){var u=this,p=this.uiStyleSettings.toolbarHeight/4,c=this.uiStyleSettings.toolbarHeight-p,G=document.createElement("div");G.style.display="inline-block",G.style.boxSizing="content-box",G.style.width=c-2+"px",G.style.height=c-2+"px",G.style.padding="1px",G.style.marginRight="2px",G.style.marginBottom="2px",G.style.borderWidth="2px",G.style.borderStyle="solid",G.style.borderRadius=(c+2)/2+"px",G.style.borderColor=a===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",G.addEventListener("click",function(){u.setCurrentColor(a,G)});var Ne=document.createElement("div");return Ne.style.display="inline-block",Ne.style.width=c-2+"px",Ne.style.height=c-2+"px",Ne.style.backgroundColor=a,Ne.style.borderRadius=c/2+"px",a==="transparent"&&(Ne.style.fill=this.uiStyleSettings.toolboxAccentColor,Ne.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>`),G.appendChild(Ne),G},o.prototype.setCurrentColor=function(a,u){var p=this;this.currentColor=a,this.colorBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(a)},o}(qe),Be=function(){function h(o,a,u){this._state="new",this._isSelected=!1,this._container=o,this._overlayContainer=a,this.globalSettings=u,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(h.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),h.prototype.ownsTarget=function(o){return!1},Object.defineProperty(h.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),h.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},h.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},h.prototype.pointerDown=function(o,a){},h.prototype.dblClick=function(o,a){},h.prototype.manipulate=function(o){},h.prototype.pointerUp=function(o){this.stateChanged()},h.prototype.dispose=function(){},h.prototype.addMarkerVisualToContainer=function(o){this.container.childNodes.length>0?this.container.insertBefore(o,this.container.childNodes[0]):this.container.appendChild(o)},h.prototype.getState=function(){return{typeName:h.typeName,state:this.state,notes:this.notes}},h.prototype.restoreState=function(o){this._state=o.state,this.notes=o.notes},h.prototype.scale=function(o,a){},h.prototype.colorChanged=function(o){this.onColorChanged&&this.onColorChanged(o),this.stateChanged()},h.prototype.fillColorChanged=function(o){this.onFillColorChanged&&this.onFillColorChanged(o),this.stateChanged()},h.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)}},h.typeName="MarkerBase",h}(),Fe=function(){function h(){this.findGripByVisual=this.findGripByVisual.bind(this)}return h.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},h}(),Lt=function(){function h(){this.GRIP_SIZE=10,this.visual=w.createGroup(),this.visual.appendChild(w.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(w.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h}(),ht=function(){function h(){}return h.toITransformMatrix=function(o){return{a:o.a,b:o.b,c:o.c,d:o.d,e:o.e,f:o.f}},h.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},h}(),ot=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.left=0,c.top=0,c.width=0,c.height=0,c.defaultSize={x:50,y:20},c.offsetX=0,c.offsetY=0,c.rotationAngle=0,c.CB_DISTANCE=10,c._suppressMarkerCreateEvent=!1,c.container.transform.baseVal.appendItem(w.createTransform()),c.setupControlBox(),c}return Le(o,h),Object.defineProperty(o.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"visual",{get:function(){return this._visual},set:function(a){this._visual=a;var u=w.createTransform();this._visual.transform.baseVal.appendItem(u)},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!!(this.controlGrips.findGripByVisual(a)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.left=a.x,this.top=a.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var p=this.unrotatePoint(a);if(this.manipulationStartX=p.x,this.manipulationStartY=p.y,this.offsetX=p.x-this.left,this.offsetY=p.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(u),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u)){this.activeGrip=this.rotatorGrip;var c=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=c.x-this.width/2,this.top=c.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var G=this.container.transform.baseVal.getItem(0);G.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(G,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},o.prototype.moveVisual=function(a){this.visual.style.transform="translate("+a.x+"px, "+a.y+"px)"},o.prototype.manipulate=function(a){var u=this.unrotatePoint(a);this.state==="creating"?this.resize(a):this.state==="move"?(this.left=this.manipulationStartLeft+(u.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(u.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(u):this.state==="rotate"&&this.rotate(a)},o.prototype.resize=function(a){var u=this.manipulationStartLeft,p=this.manipulationStartWidth,c=this.manipulationStartTop,G=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:u=this.manipulationStartLeft+a.x-this.manipulationStartX,p=this.manipulationStartWidth+this.manipulationStartLeft-u;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:p=this.manipulationStartWidth+a.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:c=this.manipulationStartTop+a.y-this.manipulationStartY,G=this.manipulationStartHeight+this.manipulationStartTop-c;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:G=this.manipulationStartHeight+a.y-this.manipulationStartY}p>=0?(this.left=u,this.width=p):(this.left=u+p,this.width=-p),G>=0?(this.top=c,this.height=G):(this.top=c+G,this.height=-G),this.setSize()},o.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},o.prototype.rotate=function(a){if(Math.abs(a.x-this.centerX)>.1){var u=Math.sign(a.x-this.centerX);this.rotationAngle=180*Math.atan((a.y-this.centerY)/(a.x-this.centerX))/Math.PI+90*u,this.applyRotation()}},o.prototype.applyRotation=function(){var a=this.container.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(a,0)},o.prototype.rotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM(),p=w.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.unrotatePoint=function(a){if(this.rotationAngle===0)return a;var u=this.container.getCTM();u=u.inverse();var p=w.createPoint(a.x,a.y);return{x:(p=p.matrixTransform(u)).x,y:p.y}},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=w.createGroup();var a=w.createTransform();a.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(a),this.container.appendChild(this.controlBox),this.controlRect=w.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=w.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 Fe,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 Lt;return a.visual.transform.baseVal.appendItem(w.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.controlGrips.topLeft.GRIP_SIZE,u=-a/2,p=u,c=(this.width+this.CB_DISTANCE)/2-a/2,G=(this.height+this.CB_DISTANCE)/2-a/2,Ne=this.height+this.CB_DISTANCE-a/2,he=this.width+this.CB_DISTANCE-a/2;this.positionGrip(this.controlGrips.topLeft.visual,u,p),this.positionGrip(this.controlGrips.topCenter.visual,c,p),this.positionGrip(this.controlGrips.topRight.visual,he,p),this.positionGrip(this.controlGrips.centerLeft.visual,u,G),this.positionGrip(this.controlGrips.centerRight.visual,he,G),this.positionGrip(this.controlGrips.bottomLeft.visual,u,Ne),this.positionGrip(this.controlGrips.bottomCenter.visual,c,Ne),this.positionGrip(this.controlGrips.bottomRight.visual,he,Ne),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,c,p-3*this.CB_DISTANCE)},o.prototype.positionGrip=function(a,u,p){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,p),a.transform.baseVal.replaceItem(c,0)},o.prototype.hideControlBox=function(){this.controlBox.style.display="none"},o.prototype.showControlBox=function(){this.controlBox.style.display=""},o.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ht.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ht.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.left=u.left,this.top=u.top,this.width=u.width,this.height=u.height,this.rotationAngle=u.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ht.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,u.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ht.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,u.containerTransformMatrix))},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u);var p=this.rotatePoint({x:this.left,y:this.top}),c=this.unrotatePoint({x:p.x*a,y:p.y*u});this.left=c.x,this.top=c.y,this.width=this.width*a,this.height=this.height*u,this.adjustControlBox()},o}(Be),st=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.createVisual=c.createVisual.bind(c),c}return Le(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=w.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),w.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},o.prototype.pointerUp=function(a){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&w.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&w.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&w.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&w.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},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.title="Rectangle marker",o}(ot),Et=function(h){function o(a,u,p,c){var G=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return G.widths=[],G.widthBoxes=[],G.widths=u,G.currentWidth=p,G.setCurrentWidth=G.setCurrentWidth.bind(G),G}return Le(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.widths.forEach(function(p){var c=document.createElement("div");c.style.display="flex",c.style.flexGrow="2",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=p===a.currentWidth?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentWidth(p,c)}),u.appendChild(c);var G=document.createElement("div");G.innerText=p.toString(),G.style.marginRight="5px",c.appendChild(G);var Ne=document.createElement("div");Ne.style.minHeight="20px",Ne.style.flexGrow="2",Ne.style.display="flex",Ne.style.alignItems="center";var he=document.createElement("hr");he.style.minWidth="20px",he.style.border="0px",he.style.borderTop=p+"px solid "+a.uiStyleSettings.toolboxColor,he.style.flexGrow="2",Ne.appendChild(he),c.appendChild(Ne),a.widthBoxes.push(c)}),u},o.prototype.setCurrentWidth=function(a,u){var p=this;this.currentWidth=a,this.widthBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},o}(qe),bt=function(h){function o(a,u,p,c){var G=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return G.styles=[],G.styleBoxes=[],G.styles=u,G.currentStyle=p,G.setCurrentStyle=G.setCurrentStyle.bind(G),G}return Le(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",this.styles.forEach(function(p){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.styles.length-5+"%",c.style.borderColor=p===a.currentStyle?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentStyle(p,c)}),u.appendChild(c);var G=document.createElement("div");G.style.minHeight="20px",G.style.flexGrow="2",G.style.overflow="hidden";var Ne=`<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>`;G.innerHTML=Ne,c.appendChild(G),a.styleBoxes.push(c)}),u},o.prototype.setCurrentStyle=function(a,u){var p=this;this.currentStyle=a,this.styleBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},o}(qe),ft=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new He("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Et("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new bt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Le(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.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),we=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},St=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.x1=0,c.y1=0,c.x2=0,c.y2=0,c.defaultLength=50,c.manipulationStartX=0,c.manipulationStartY=0,c.manipulationStartX1=0,c.manipulationStartY1=0,c.manipulationStartX2=0,c.manipulationStartY2=0,c.setupControlBox(),c}return Le(o,h),o.prototype.ownsTarget=function(a){return!!h.prototype.ownsTarget.call(this,a)||!(!this.grip1.ownsTarget(a)&&!this.grip2.ownsTarget(a))},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartX=a.x,this.manipulationStartY=a.y,this.state==="new"&&(this.x1=a.x,this.y1=a.y,this.x2=a.x,this.y2=a.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(u)?this.activeGrip=this.grip1:this.grip2.ownsTarget(u)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},o.prototype.pointerUp=function(a){var u=this.state;h.prototype.pointerUp.call(this,a),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(a),this._state="select",u==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},o.prototype.adjustVisual=function(){},o.prototype.manipulate=function(a){this.state==="creating"?this.resize(a):this.state==="move"?(this.x1=this.manipulationStartX1+a.x-this.manipulationStartX,this.y1=this.manipulationStartY1+a.y-this.manipulationStartY,this.x2=this.manipulationStartX2+a.x-this.manipulationStartX,this.y2=this.manipulationStartY2+a.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(a)},o.prototype.resize=function(a){switch(this.activeGrip){case this.grip1:this.x1=a.x,this.y1=a.y;break;case this.grip2:case void 0:this.x2=a.x,this.y2=a.y}this.adjustVisual(),this.adjustControlBox()},o.prototype.select=function(){h.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},o.prototype.deselect=function(){h.prototype.deselect.call(this),this.controlBox.style.display="none"},o.prototype.setupControlBox=function(){this.controlBox=w.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 Lt;return a.visual.transform.baseVal.appendItem(w.createTransform()),this.controlBox.appendChild(a.visual),a},o.prototype.positionGrips=function(){var a=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-a/2,this.y1-a/2),this.positionGrip(this.grip2.visual,this.x2-a/2,this.y2-a/2)},o.prototype.positionGrip=function(a,u,p){var c=a.transform.baseVal.getItem(0);c.setTranslate(u,p),a.transform.baseVal.replaceItem(c,0)},o.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},h.prototype.getState.call(this))},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.x1=u.x1,this.y1=u.y1,this.x2=u.x2,this.y2=u.y2},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.x1=this.x1*a,this.y1=this.y1*u,this.x2=this.x2*a,this.y2=this.y2*u,this.adjustVisual(),this.adjustControlBox()},o}(Be),lt=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new He("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Et("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new bt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Le(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.selectorLine&&a!==this.visibleLine)},o.prototype.createVisual=function(){this.visual=w.createGroup(),this.selectorLine=w.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=w.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},o.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),w.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),w.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),w.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},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.createVisual(),this.adjustVisual()},o.typeName="LineMarker",o.title="Line marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',o}(St),ke=function(h){function o(a,u,p,c){var G=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return G.fonts=[],G.fontBoxes=[],G.fonts=u,G.currentFont=p,G.setCurrentFont=G.setCurrentFont.bind(G),G}return Le(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.overflow="hidden",u.style.flexGrow="2",this.fonts.forEach(function(p){var c=document.createElement("div");c.style.display="inline-block",c.style.alignItems="center",c.style.justifyContent="space-between",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.overflow="hidden",c.style.maxWidth=100/a.fonts.length-5+"%",c.style.borderColor=p===a.currentFont?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentFont(p,c)}),u.appendChild(c);var G=document.createElement("div");G.style.display="flex",G.style.minHeight="20px",G.style.flexGrow="2",G.style.fontFamily=p,G.style.overflow="hidden";var Ne=document.createElement("div");Ne.style.whiteSpace="nowrap",Ne.style.overflow="hidden",Ne.style.textOverflow="ellipsis",Ne.innerHTML="The quick brown fox jumps over the lazy dog",G.appendChild(Ne),c.appendChild(G),a.fontBoxes.push(c)}),u},o.prototype.setCurrentFont=function(a,u){var p=this;this.currentFont=a,this.fontBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},o}(qe),Re=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.color="transparent",c.padding=5,c.DEFAULT_TEXT="your text here",c.text=c.DEFAULT_TEXT,c.isMoved=!1,c.color=p.defaultColor,c.fontFamily=p.defaultFontFamily,c.defaultSize={x:100,y:30},c.setColor=c.setColor.bind(c),c.setFont=c.setFont.bind(c),c.renderText=c.renderText.bind(c),c.sizeText=c.sizeText.bind(c),c.textEditDivClicked=c.textEditDivClicked.bind(c),c.showTextEditor=c.showTextEditor.bind(c),c.setSize=c.setSize.bind(c),c.positionTextEditor=c.positionTextEditor.bind(c),c.colorPanel=new He("Color",p.defaultColorSet,p.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.fontFamilyPanel=new ke("Font",p.defaultFontFamilies,p.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c}return Le(o,h),o.prototype.ownsTarget=function(a){if(h.prototype.ownsTarget.call(this,a)||a===this.visual||a===this.textElement||a===this.bgRectangle)return!0;var u=!1;return this.textElement.childNodes.forEach(function(p){p===a&&(u=!0)}),u},o.prototype.createVisual=function(){this.visual=w.createGroup(),this.bgRectangle=w.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=w.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(w.createTransform()),this.textElement.transform.baseVal.appendItem(w.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.isMoved=!1,this.pointerDownPoint=a,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.renderText=function(){var a=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(u){a.textElement.appendChild(w.createTSpan(u.trim()===""?" ":u.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},o.prototype.getTextScale=function(){var a=this.textElement.getBBox(),u=1;if(a.width>0&&a.height>0){var p=(1*this.width-this.width*this.padding*2/100)/a.width,c=(1*this.height-this.height*this.padding*2/100)/a.height;u=Math.min(p,c)}return u},o.prototype.getTextPosition=function(a){var u=this.textElement.getBBox(),p=0,c=0;return u.width>0&&u.height>0&&(p=(this.width-u.width*a)/2,c=this.height/2-u.height*a/2),{x:p,y:c}},o.prototype.sizeText=function(){var a=this.textElement.getBBox(),u=this.getTextScale(),p=this.getTextPosition(u);p.y-=a.y*u,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+p.x+"px, "+p.y+"px) scale("+u+", "+u+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(p.x,p.y),this.textElement.transform.baseVal.getItem(1).setScale(u,u))},o.prototype.manipulate=function(a){h.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){h.prototype.resize.call(this,a),this.isMoved=!0,this.setSize(),this.sizeText()},o.prototype.setSize=function(){h.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(w.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),w.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},o.prototype.pointerUp=function(a){var u=this.state;u==="creating"&&(this._suppressMarkerCreateEvent=!0),h.prototype.pointerUp.call(this,a),this.setSize(),(u==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},o.prototype.showTextEditor=function(){var a=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(u){u.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var u=Number.parseFloat(a.textEditor.style.fontSize);a.textEditor.clientWidth>=Number.parseInt(a.textEditor.style.maxWidth)&&u>.9;)u-=.1,a.textEditor.style.fontSize=Math.max(u,.9)+"em"}),this.textEditor.addEventListener("keyup",function(u){u.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(u){if(u.clipboardData){var p=u.clipboardData.getData("text"),c=window.getSelection();if(!c.rangeCount)return!1;c.deleteFromDocument(),c.getRangeAt(0).insertNode(document.createTextNode(p)),u.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){a.textEditDivClicked(a.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},o.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var a=this.getTextScale(),u=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),p=this.textElement.getBBox(),c={x:p.width*a,y:p.height*a};u.x-=c.x/2,u.y-=c.y/2,this.textEditor.style.top=u.y+"px",this.textEditor.style.left=u.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-u.x+"px",this.textEditor.style.fontSize=Math.max(16*a,12)+"px",this.textElement.style.display="none"}},o.prototype.textEditDivClicked=function(a){this.text=a.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},o.prototype.select=function(){h.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},o.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),h.prototype.deselect.call(this)},o.prototype.dblClick=function(a,u){h.prototype.dblClick.call(this,a,u),this.showTextEditor()},o.prototype.setColor=function(a){this.textElement&&w.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&&w.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},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.color=u.color,this.fontFamily=u.fontFamily,this.padding=u.padding,this.text=u.text,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize(),this.sizeText(),this.positionTextEditor()},o.typeName="TextMarker",o.title="Text marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',o}(ot),D=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.color="transparent",c.lineWidth=3,c.drawing=!1,c.pixelRatio=1,c.color=p.defaultColor,c.lineWidth=p.defaultStrokeWidth,c.pixelRatio=p.freehandPixelRatio,c.setColor=c.setColor.bind(c),c.addCanvas=c.addCanvas.bind(c),c.finishCreation=c.finishCreation.bind(c),c.setLineWidth=c.setLineWidth.bind(c),c.colorPanel=new He("Color",p.defaultColorSet,p.defaultColor),c.colorPanel.onColorChanged=c.setColor,c.lineWidthPanel=new Et("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.lineWidthPanel.onWidthChanged=c.setLineWidth,c}return Le(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual&&a!==this.drawingImage)},o.prototype.createVisual=function(){this.visual=w.createGroup(),this.drawingImage=w.createImage(),this.visual.appendChild(this.drawingImage);var a=w.createTransform();this.visual.transform.baseVal.appendItem(a),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(a.x,a.y),this.drawing=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.manipulate=function(a){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(a.x,a.y),this.canvasContext.stroke()):h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),w.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),w.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()):h.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(),h.prototype.select.call(this)},o.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),h.prototype.deselect.call(this)},o.prototype.finishCreation=function(){for(var a=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),u=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],p=u[0],c=u[1],G=u[2],Ne=u[3],he=!1,wt=0;wt<this.canvasElement.height;wt++)for(var se=0;se<this.canvasElement.width;se++)a.data[wt*this.canvasElement.width*4+4*se+3]>0&&(he=!0,wt<c&&(c=wt),se<p&&(p=se),wt>Ne&&(Ne=wt),se>G&&(G=se));if(he){this.left=p/this.pixelRatio,this.top=c/this.pixelRatio,this.width=(G-p)/this.pixelRatio,this.height=(Ne-c)/this.pixelRatio;var J=document.createElement("canvas");J.width=G-p,J.height=Ne-c,J.getContext("2d").putImageData(this.canvasContext.getImageData(p,c,G-p,Ne-c),0,0),this.drawingImgUrl=J.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},o.prototype.setDrawingImage=function(){w.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),w.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},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){this.createVisual(),h.prototype.restoreState.call(this,a),this.drawingImgUrl=a.drawingImgUrl,this.setDrawingImage()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setDrawingImage()},o.typeName="FreehandMarker",o.title="Freehand marker",o.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',o}(ot),B=function(h){function o(a,u,p){var c=h.call(this,a,p||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return c.typeBoxes=[],c.currentType=u,c.setCurrentType=c.setCurrentType.bind(c),c}return Le(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2";for(var p=function(Ne){var he="both";switch(Ne){case 0:he="both";break;case 1:he="start";break;case 2:he="end";break;case 3:he="none"}var wt=document.createElement("div");if(wt.style.display="flex",wt.style.flexGrow="2",wt.style.alignItems="center",wt.style.justifyContent="space-between",wt.style.padding="5px",wt.style.borderWidth="2px",wt.style.borderStyle="solid",wt.style.borderColor=he===c.currentType?c.uiStyleSettings.toolboxAccentColor:"transparent",wt.addEventListener("click",function(){a.setCurrentType(he,wt)}),u.appendChild(wt),he==="both"||he==="start"){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.minHeight="20px",se.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,se.style.marginLeft="5px",wt.appendChild(se)}var J=document.createElement("div");J.style.display="flex",J.style.alignItems="center",J.style.minHeight="20px",J.style.flexGrow="2";var Me=document.createElement("hr");if(Me.style.minWidth="20px",Me.style.border="0px",Me.style.borderTop="3px solid "+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee"),Me.style.flexGrow="2",J.appendChild(Me),wt.appendChild(J),he==="both"||he==="end"){var rt=document.createElement("div");rt.style.display="flex",rt.style.alignItems="center",rt.style.minHeight="20px",rt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(c.uiStyleSettings!==void 0?c.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,rt.style.marginRight="5px",wt.appendChild(rt)}c.typeBoxes.push(wt)},c=this,G=0;G<4;G++)p(G);return u},o.prototype.setCurrentType=function(a,u){var p=this;this.currentType=a,this.typeBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings!==void 0?p.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},o}(qe),I=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.arrowType="end",c.arrowBaseHeight=10,c.arrowBaseWidth=10,c.getArrowPoints=c.getArrowPoints.bind(c),c.setArrowType=c.setArrowType.bind(c),c.arrowTypePanel=new B("Arrow type","end"),c.arrowTypePanel.onArrowTypeChanged=c.setArrowType,c}return Le(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.arrow1&&a!==this.arrow2)},o.prototype.getArrowPoints=function(a,u){var p=this.arrowBaseWidth+2*this.strokeWidth,c=this.arrowBaseHeight+2*this.strokeWidth;return a-p/2+","+(u+c/2)+" "+a+","+(u-c/2)+" "+(a+p/2)+","+(u+c/2)},o.prototype.createTips=function(){this.arrow1=w.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(w.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=w.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(w.createTransform()),this.visual.appendChild(this.arrow2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.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",w.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),w.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.arrow1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(u,0);var p=this.arrow2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(p,0)}},o.prototype.setArrowType=function(a){this.arrowType=a,this.adjustVisual(),this.stateChanged()},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({arrowType:this.arrowType},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.arrowType=u.arrowType,this.createTips(),this.adjustVisual()},o.typeName="ArrowMarker",o.title="Arrow marker",o.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',o}(lt),b=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.fillColor=p.defaultFillColor,c.strokeWidth=0,c.fillPanel=new He("Color",p.defaultColorSet,p.defaultFillColor),c.fillPanel.onColorChanged=c.setFillColor,c}return Le(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.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),x=function(h){function o(a,u,p,c){var G=h.call(this,a,c||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return G.opacities=[],G.opacityBoxes=[],G.opacities=u,G.currentOpacity=p,G.setCurrentOpacity=G.setCurrentOpacity.bind(G),G}return Le(o,h),o.prototype.getUi=function(){var a=this,u=document.createElement("div");return u.style.display="flex",u.style.overflow="hidden",u.style.flexGrow="2",u.style.justifyContent="space-between",this.opacities.forEach(function(p){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.justifyContent="center",c.style.padding="5px",c.style.borderWidth="2px",c.style.borderStyle="solid",c.style.borderColor=p===a.currentOpacity?a.uiStyleSettings.toolboxAccentColor:"transparent",c.addEventListener("click",function(){a.setCurrentOpacity(p,c)}),u.appendChild(c);var G=document.createElement("div");G.innerText=100*p+"%",c.appendChild(G),a.opacityBoxes.push(c)}),u},o.prototype.setCurrentOpacity=function(a,u){var p=this;this.currentOpacity=a,this.opacityBoxes.forEach(function(c){c.style.borderColor=c===u?p.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},o}(qe),S=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.setOpacity=c.setOpacity.bind(c),c.fillColor=p.defaultHighlightColor,c.strokeWidth=0,c.opacity=p.defaultHighlightOpacity,c.fillPanel=new He("Color",p.defaultColorSet,c.fillColor),c.fillPanel.onColorChanged=c.setFillColor,c.opacityPanel=new x("Opacity",p.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Le(o,h),o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&w.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=h.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}(b),A='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',ae=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.bgColor="transparent",c.tipPosition={x:0,y:0},c.tipBase1Position={x:0,y:0},c.tipBase2Position={x:0,y:0},c.tipMoving=!1,c.color=p.defaultStrokeColor,c.bgColor=p.defaultFillColor,c.fontFamily=p.defaultFontFamily,c.defaultSize={x:100,y:30},c.setBgColor=c.setBgColor.bind(c),c.getTipPoints=c.getTipPoints.bind(c),c.positionTip=c.positionTip.bind(c),c.setTipPoints=c.setTipPoints.bind(c),c.colorPanel=new He("Text color",p.defaultColorSet,c.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),c.colorPanel.onColorChanged=c.setColor,c.bgColorPanel=new He("Fill color",p.defaultColorSet,c.bgColor,A),c.bgColorPanel.onColorChanged=c.setBgColor,c.fontFamilyPanel=new ke("Font",p.defaultFontFamilies,p.defaultFontFamily),c.fontFamilyPanel.onFontChanged=c.setFont,c.tipGrip=new Lt,c.tipGrip.visual.transform.baseVal.appendItem(w.createTransform()),c.controlBox.appendChild(c.tipGrip.visual),c}return Le(o,h),o.prototype.ownsTarget=function(a){return h.prototype.ownsTarget.call(this,a)||this.tipGrip.ownsTarget(a)||this.tip===a},o.prototype.createTip=function(){w.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=w.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},o.prototype.pointerDown=function(a,u){this.state==="new"&&h.prototype.pointerDown.call(this,a,u),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(u)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):h.prototype.pointerDown.call(this,a,u)},o.prototype.pointerUp=function(a){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,h.prototype.pointerUp.call(this,a);else{var u=this.state==="creating";h.prototype.pointerUp.call(this,a),this.setTipPoints(u),this.positionTip()}},o.prototype.manipulate=function(a){if(this.tipMoving){var u=this.unrotatePoint(a);this.tipPosition={x:u.x-this.manipulationStartLeft,y:u.y-this.manipulationStartTop},this.positionTip()}else h.prototype.manipulate.call(this,a)},o.prototype.setBgColor=function(a){this.bgRectangle&&this.tip&&(w.setAttributes(this.bgRectangle,[["fill",a]]),w.setAttributes(this.tip,[["fill",a]])),this.bgColor=a,this.fillColorChanged(a)},o.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},o.prototype.setTipPoints=function(a){a===void 0&&(a=!1);var u=Math.min(this.height/2,15),p=this.height/5;a&&(this.tipPosition={x:u+p/2,y:this.height+20});var c=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:0},this.tipBase2Position={x:u+p,y:0}):(this.tipBase1Position={x:0,y:u},this.tipBase2Position={x:0,y:u+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?c<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:0},this.tipBase2Position={x:this.width-u,y:0}):(this.tipBase1Position={x:this.width,y:u},this.tipBase2Position={x:this.width,y:u+p}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?c<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-u-p,y:this.height},this.tipBase2Position={x:this.width-u,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-u-p},this.tipBase2Position={x:this.width,y:this.height-u}):c<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(p=this.width/5,u=Math.min(this.width/2,15),this.tipBase1Position={x:u,y:this.height},this.tipBase2Position={x:u+p,y:this.height}):(this.tipBase1Position={x:0,y:this.height-u},this.tipBase2Position={x:0,y:this.height-u-p})},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.positionTip()},o.prototype.positionTip=function(){w.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(),h.prototype.select.call(this)},o.prototype.getState=function(){var a=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.bgColor=u.bgColor,this.tipPosition=u.tipPosition,h.prototype.restoreState.call(this,a),this.createTip(),this.setTipPoints()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.tipPosition={x:this.tipPosition.x*a,y:this.tipPosition.y*u},this.positionTip()},o.typeName="CalloutMarker",o.title="Callout marker",o.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',o}(Re),ge=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.fillColor="transparent",c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.opacity=1,c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.fillColor=p.defaultFillColor,c.setStrokeColor=c.setStrokeColor.bind(c),c.setFillColor=c.setFillColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.setOpacity=c.setOpacity.bind(c),c.createVisual=c.createVisual.bind(c),c.strokePanel=new He("Line color",te(p.defaultColorSet,["transparent"]),p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.fillPanel=new He("Fill color",te(p.defaultColorSet,["transparent"]),c.fillColor,A),c.fillPanel.onColorChanged=c.setFillColor,c.strokeWidthPanel=new Et("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new bt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c.opacityPanel=new x("Opacity",p.defaultOpacitySteps,c.opacity),c.opacityPanel.onOpacityChanged=c.setOpacity,c}return Le(o,h),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.visual)},o.prototype.createVisual=function(){this.visual=w.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="new"&&(this.createVisual(),this.moveVisual(a),this._state="creating")},o.prototype.manipulate=function(a){h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){h.prototype.resize.call(this,a),this.setSize()},o.prototype.setSize=function(){h.prototype.setSize.call(this),w.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){h.prototype.pointerUp.call(this,a),this.setSize()},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.visual&&w.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(a),this.stateChanged()},o.prototype.setFillColor=function(a){this.fillColor=a,this.visual&&w.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(a),this.stateChanged()},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.visual&&w.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.visual&&w.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},o.prototype.setOpacity=function(a){this.opacity=a,this.visual&&w.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},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){var u=a;this.fillColor=u.fillColor,this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.opacity=u.opacity,this.createVisual(),h.prototype.restoreState.call(this,a),this.setSize()},o.prototype.scale=function(a,u){h.prototype.scale.call(this,a,u),this.setSize()},o.typeName="EllipseMarker",o.title="Ellipse marker",o.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',o}(ot),xe=function(h){function o(a,u,p){return h.call(this,a,u,p)||this}return Le(o,h),Object.defineProperty(o.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),o.prototype.ownsTarget=function(a){return!(!h.prototype.ownsTarget.call(this,a)&&a!==this.tip1&&a!==this.tip2)},o.prototype.createTips=function(){this.tip1=w.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(w.createTransform()),this.visual.appendChild(this.tip1),this.tip2=w.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(w.createTransform()),this.visual.appendChild(this.tip2)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.state==="creating"&&this.createTips()},o.prototype.adjustVisual=function(){if(h.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(w.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()]]),w.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var a=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),u=this.tip1.transform.baseVal.getItem(0);u.setRotate(a,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(u,0);var p=this.tip2.transform.baseVal.getItem(0);p.setRotate(a+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(p,0)}},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.prototype.getState.call(this);return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.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}(lt),Ct=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokePanel.colors=p.defaultColorSet,c.fillColor="transparent",c}return Le(o,h),Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=h.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}(ge),At=function(){function h(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),h.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))},h.prototype.replaceLastUndoStep=function(o){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=o)},h.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},h.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}},h.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},h}(),Ee=function(h){function o(a,u,p){var c=h.call(this,a,u,p)||this;return c.strokeColor="transparent",c.strokeWidth=0,c.strokeDasharray="",c.curveX=0,c.curveY=0,c.manipulationStartCurveX=0,c.manipulationStartCurveY=0,c.setStrokeColor=c.setStrokeColor.bind(c),c.setStrokeWidth=c.setStrokeWidth.bind(c),c.setStrokeDasharray=c.setStrokeDasharray.bind(c),c.positionGrips=c.positionGrips.bind(c),c.addControlGrips=c.addControlGrips.bind(c),c.adjustVisual=c.adjustVisual.bind(c),c.setupControlBox=c.setupControlBox.bind(c),c.resize=c.resize.bind(c),c.strokeColor=p.defaultColor,c.strokeWidth=p.defaultStrokeWidth,c.strokeDasharray=p.defaultStrokeDasharray,c.strokePanel=new He("Line color",p.defaultColorSet,p.defaultColor),c.strokePanel.onColorChanged=c.setStrokeColor,c.strokeWidthPanel=new Et("Line width",p.defaultStrokeWidths,p.defaultStrokeWidth),c.strokeWidthPanel.onWidthChanged=c.setStrokeWidth,c.strokeStylePanel=new bt("Line style",p.defaultStrokeDasharrays,p.defaultStrokeDasharray),c.strokeStylePanel.onStyleChanged=c.setStrokeDasharray,c}return Le(o,h),o.prototype.ownsTarget=function(a){return!(!h.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=w.createGroup(),this.selectorCurve=w.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=w.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},o.prototype.pointerDown=function(a,u){h.prototype.pointerDown.call(this,a,u),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=a.x,this.curveY=a.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(u)&&(this.activeGrip=this.curveGrip,this._state="resize")},o.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),w.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),w.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),w.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},o.prototype.setupControlBox=function(){h.prototype.setupControlBox.call(this),this.curveControlLine1=w.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=w.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,h.prototype.addControlGrips.call(this)},o.prototype.positionGrips=function(){h.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),h.prototype.manipulate.call(this,a)},o.prototype.resize=function(a){this.activeGrip===this.curveGrip&&(this.curveX=a.x,this.curveY=a.y),h.prototype.resize.call(this,a),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},o.prototype.setStrokeColor=function(a){this.strokeColor=a,this.adjustVisual(),this.colorChanged(a)},o.prototype.setStrokeWidth=function(a){this.strokeWidth=a,this.adjustVisual()},o.prototype.setStrokeDasharray=function(a){this.strokeDasharray=a,this.adjustVisual()},o.prototype.scale=function(a,u){this.curveX=this.curveX*a,this.curveY=this.curveY*u,h.prototype.scale.call(this,a,u)},Object.defineProperty(o.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),o.prototype.getState=function(){var a=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},h.prototype.getState.call(this));return a.typeName=o.typeName,a},o.prototype.restoreState=function(a){h.prototype.restoreState.call(this,a);var u=a;this.strokeColor=u.strokeColor,this.strokeWidth=u.strokeWidth,this.strokeDasharray=u.strokeDasharray,this.curveX=u.curveX,this.curveY=u.curveY,this.createVisual(),this.adjustVisual()},o.typeName="CurveMarker",o.title="Curve marker",o.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',o}(St),it=function(){function h(o,a){a===void 0&&(a=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=o,this.cancelable=a}return Object.defineProperty(h.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),h.prototype.preventDefault=function(){this._defaultPrevented=!0},h}(),pt=function(h){function o(a,u,p){var c=h.call(this,a,!1)||this;return c.dataUrl=u,c.state=p,c}return Le(o,h),o}(it),Ge=function(h){function o(a,u,p){p===void 0&&(p=!1);var c=h.call(this,a,p)||this;return c.marker=u,c}return Le(o,h),o}(it),Dt=function(){function h(){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 h.prototype.addEventListener=function(o,a){this[o].push(a)},h.prototype.removeEventListener=function(o,a){var u=this[o].indexOf(a);u>-1&&this[o].splice(u,1)},h}(),Tt=function(){function h(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 we,this._isOpen=!1,this.undoRedoManager=new At,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Dt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=h.instanceCounter++,this.styles=new Qe(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(h.prototype,"ALL_MARKER_TYPES",{get:function(){return[ft,D,I,Re,Ct,ge,S,ae,xe,b,lt,Ee]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ft,D,I,Re,ge,S,ae]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ft,D,I,Re,S]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(o){var a=this;this._availableMarkerTypes.splice(0),o.forEach(function(u){if(typeof u=="string"){var p=a.ALL_MARKER_TYPES.find(function(c){return c.typeName===u});p!==void 0&&a._availableMarkerTypes.push(p)}else a._availableMarkerTypes.push(u)})},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),h.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ie.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},h.prototype.show=function(){var o=this;this.styles.styleSheetRoot===void 0&&kt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=kt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(a){return a(new it(o))})},h.prototype.render=function(){return Se(this,void 0,void 0,function(){var o;return Te(this,function(a){switch(a.label){case 0:return this.setCurrentMarker(),(o=new dt).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()]}})})},h.prototype.close=function(o){var a=this;if(o===void 0&&(o=!1),this.isOpen){var u=!1;o||this.eventListeners.beforeclose.forEach(function(p){var c=new it(a,!0);p(c),c.defaultPrevented&&(u=!0)}),u||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(p){return p(new it(a))}),this.detachEvents(),this._isOpen=!1)}},h.prototype.addMarkersToToolbar=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];(o=this._availableMarkerTypes).push.apply(o,a)},h.prototype.addRenderEventListener=function(o){this.addEventListener("render",function(a){o(a.dataUrl,a.state)})},h.prototype.removeRenderEventListener=function(o){},h.prototype.addCloseEventListener=function(o){this.addEventListener("close",function(){o()})},h.prototype.removeCloseEventListener=function(o){},h.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))},h.prototype.onPopupTargetResize=function(){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.editorCanvas.clientWidth/o>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*o:this.editorCanvas.clientWidth,u=a<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/o;this.resize(a,u)},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.prototype.resize=function(o,a){this._isResizing=!0;var u=o/this.imageWidth,p=a/this.imageHeight;this.imageWidth=Math.round(o),this.imageHeight=Math.round(a),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(u,p),this._isResizing=!1},h.prototype.scaleMarkers=function(o,a){var u,p=this;this._currentMarker&&this._currentMarker instanceof Re?this._currentMarker.scale(o,a):(u=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(c){c!==p._currentMarker&&c.scale(o,a)}),u!==void 0&&this.setCurrentMarker(u)},h.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"},h.prototype.setTopLeft=function(){var o=this.editingTarget.getBoundingClientRect(),a=this.editorCanvas.getBoundingClientRect();this.left=o.left-a.left,this.top=o.top-a.top},h.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)},h.prototype.addDefs=function(){for(var o,a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];this.defs=w.createDefs(),this.addDefsToImage(),(o=this.defs).append.apply(o,a)},h.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},h.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)},h.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},h.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},h.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)},h.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},h.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)},h.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()},h.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")},h.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"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.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 ze(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 Xe(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},h.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.removeMarker=function(o){this.markerImage.removeChild(o.container),this.markers.indexOf(o)>-1&&this.markers.splice(this.markers.indexOf(o),1),o.dispose()},h.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())},h.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()}},h.prototype.deleteSelectedMarker=function(){var o=this;if(this._currentMarker!==void 0){var a=!1;if(this.eventListeners.markerbeforedelete.forEach(function(p){var c=new Ge(o,o._currentMarker,!0);p(c),c.defaultPrevented&&(a=!0)}),!a){var u=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(p){return p(new Ge(o,u))})}}},h.prototype.clear=function(){var o=this,a=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(G){var Ne=new Ge(o,void 0,!0);G(Ne),Ne.defaultPrevented&&(a=!0)}),!a)){this.setCurrentMarker();for(var u=function(G){var Ne=p.markers[G];p.setCurrentMarker(p.markers[G]),p._currentMarker.dispose(),p.markerImage.removeChild(p._currentMarker.container),p.markers.splice(p.markers.indexOf(p._currentMarker),1),p.eventListeners.markerdelete.forEach(function(he){return he(new Ge(o,Ne))})},p=this,c=this.markers.length-1;c>=0;c--)u(c);this.addUndoStep()}},Object.defineProperty(h.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),h.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))},h.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)},h.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},h.prototype.addUndoStep=function(){var o=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var a=this.getState(),u=this.undoRedoManager.getLastUndoStep();if(!u||u.width===a.width&&u.height===a.height){var p=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(a),p<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(c){return c(new it(o))})}else this.undoRedoManager.replaceLastUndoStep(a),this.eventListeners.statechange.forEach(function(c){return c(new it(o))})}},h.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},h.prototype.undoStep=function(){var o=this,a=this.undoRedoManager.undo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new it(o))}))},h.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},h.prototype.redoStep=function(){var o=this,a=this.undoRedoManager.redo();a!==void 0&&(this.restoreState(a),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(u){return u(new it(o))}))},h.prototype.stepZoom=function(){var o=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=o<this.zoomSteps.length-1?this.zoomSteps[o+1]:this.zoomSteps[0]},h.prototype.panTo=function(o){this.contentDiv.scrollBy({left:this.prevPanPoint.x-o.x,top:this.prevPanPoint.y-o.y}),this.prevPanPoint=o},h.prototype.startRenderAndClose=function(){return Se(this,void 0,void 0,function(){var o,a,u=this;return Te(this,function(p){switch(p.label){case 0:return[4,this.render()];case 1:return o=p.sent(),a=this.getState(),this.eventListeners.render.forEach(function(c){return c(new pt(u,o,a))}),this.close(!0),[2]}})})},h.prototype.getState=function(o){o===!0&&this.setCurrentMarker();var a={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(u){return a.markers.push(u.getState())}),a},h.prototype.restoreState=function(o){var a=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);o.markers.forEach(function(u){var p=a._availableMarkerTypes.find(function(G){return G.typeName===u.typeName});if(p!==void 0){var c=a.addNewMarker(p);c.restoreState(u),a.markers.push(c)}}),o.width&&o.height&&(o.width!==this.imageWidth||o.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/o.width,this.imageHeight/o.height),this.eventListeners.restorestate.forEach(function(u){return u(new it(a))})},h.prototype.addNewMarker=function(o){var a=w.createGroup();return this.markerImage.appendChild(a),new o(a,this.overlayContainer,this.settings)},h.prototype.createNewMarker=function(o){var a,u=this;(a=typeof o=="string"?this._availableMarkerTypes.find(function(p){return p.typeName===o}):o)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(a),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(a.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(p){return p(new Ge(u,u._currentMarker))}))},h.prototype.markerCreated=function(o){var a=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(o),this.setCurrentMarker(o),o instanceof D&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(D):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(u){return u(new Ge(a,a._currentMarker))})},h.prototype.colorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=o,this.settings.defaultStrokeColor=o)},h.prototype.fillColorChanged=function(o){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=o)},h.prototype.markerStateChanged=function(o){var a=this;this.eventListeners.markerchange.forEach(function(u){return u(new Ge(a,o))})},h.prototype.setCurrentMarker=function(o){var a=this;this._currentMarker!==o&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(u){return u(new Ge(a,a._currentMarker))})),this._currentMarker=o,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(u){return u(new Ge(a,a._currentMarker))}))},h.prototype.onPointerDown=function(o){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||o.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0?(this.setCurrentMarker(a),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:o.clientX,y:o.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(o.clientX,o.clientY))},h.prototype.onDblClick=function(o){if(this._isFocused||this.focus(),this.mode==="select"){var a=this.markers.find(function(u){return u.ownsTarget(o.target)});a!==void 0&&a!==this._currentMarker&&this.setCurrentMarker(a),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(o.clientX,o.clientY),o.target):this.setCurrentMarker()}},h.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}))},h.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()},h.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},h.prototype.onKeyUp=function(o){this._currentMarker===void 0||this.notesArea!==void 0||o.key!=="Delete"&&o.key!=="Backspace"||this.deleteSelectedMarker()},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.markerImage.getBoundingClientRect();return{x:(o-u.left)/this.zoomLevel,y:(a-u.top)/this.zoomLevel}},h.prototype.onWindowResize=function(){this.positionUI()},h.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()},h.prototype.addLicenseKey=function(o){Ie.addKey(o)},h.prototype.addEventListener=function(o,a){this.eventListeners.addEventListener(o,a)},h.prototype.removeEventListener=function(o,a){this.eventListeners.removeEventListener(o,a)},h.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(h.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),h.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 it(o))}))},h.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 it(o))}))},h.instanceCounter=0,h}();/* **********************************
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 Ft=function(h,o){return(Ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,u){a.__proto__=u}||function(a,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(a[p]=u[p])})(h,o)};function Pt(h,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=h}Ft(h,o),h.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}function ut(h,o,a,u){return new(a||(a=Promise))(function(p,c){function G(wt){try{he(u.next(wt))}catch(se){c(se)}}function Ne(wt){try{he(u.throw(wt))}catch(se){c(se)}}function he(wt){var se;wt.done?p(wt.value):(se=wt.value,se instanceof a?se:new a(function(J){J(se)})).then(G,Ne)}he((u=u.apply(h,o||[])).next())})}function Wt(h,o){var a,u,p,c,G={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return c={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function Ne(he){return function(wt){return function(se){if(a)throw new TypeError("Generator is already executing.");for(;G;)try{if(a=1,u&&(p=2&se[0]?u.return:se[0]?u.throw||((p=u.return)&&p.call(u),0):u.next)&&!(p=p.call(u,se[1])).done)return p;switch(u=0,p&&(se=[2&se[0],p.value]),se[0]){case 0:case 1:p=se;break;case 4:return G.label++,{value:se[1],done:!1};case 5:G.label++,u=se[1],se=[0];continue;case 7:se=G.ops.pop(),G.trys.pop();continue;default:if(!(p=G.trys,(p=p.length>0&&p[p.length-1])||se[0]!==6&&se[0]!==2)){G=0;continue}if(se[0]===3&&(!p||se[1]>p[0]&&se[1]<p[3])){G.label=se[1];break}if(se[0]===6&&G.label<p[1]){G.label=p[1],p=se;break}if(p&&G.label<p[2]){G.label=p[2],G.ops.push(se);break}p[2]&&G.ops.pop(),G.trys.pop();continue}se=o.call(h,G)}catch(J){se=[6,J],u=0}finally{a=p=0}if(5&se[0])throw se[1];return{value:se[0]?se[1]:void 0,done:!0}}([he,wt])}}}var Nt=function(){function h(){}return h.addKey=function(o){h.key=o},Object.defineProperty(h,"isLicensed",{get:function(){return!!h.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(h.key)},enumerable:!1,configurable:!0}),h}(),We=function(){function h(){}return h.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},h.setAttributes=function(o,a){for(var u=0,p=a;u<p.length;u++){var c=p[u],G=c[0],Ne=c[1];o.setAttribute(G,Ne)}},h.createRect=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","rect");return p.setAttribute("width",o.toString()),p.setAttribute("height",a.toString()),u&&h.setAttributes(p,u),p},h.createLine=function(o,a,u,p,c){var G=document.createElementNS("http://www.w3.org/2000/svg","line");return G.setAttribute("x1",o.toString()),G.setAttribute("y1",a.toString()),G.setAttribute("x2",u.toString()),G.setAttribute("y2",p.toString()),c&&h.setAttributes(G,c),G},h.createPolygon=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","polygon");return u.setAttribute("points",o),a&&h.setAttributes(u,a),u},h.createCircle=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","circle");return u.setAttribute("cx",(o/2).toString()),u.setAttribute("cy",(o/2).toString()),u.setAttribute("r",o.toString()),a&&h.setAttributes(u,a),u},h.createEllipse=function(o,a,u){var p=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return p.setAttribute("cx",(o/2).toString()),p.setAttribute("cy",(a/2).toString()),p.setAttribute("rx",(o/2).toString()),p.setAttribute("ry",(a/2).toString()),u&&h.setAttributes(p,u),p},h.createGroup=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","g");return o&&h.setAttributes(a,o),a},h.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},h.createMarker=function(o,a,u,p,c,G,Ne){var he=document.createElementNS("http://www.w3.org/2000/svg","marker");return h.setAttributes(he,[["id",o],["orient",a],["markerWidth",u.toString()],["markerHeight",p.toString()],["refX",c.toString()],["refY",G.toString()]]),he.appendChild(Ne),he},h.createText=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","text");return a.setAttribute("x","0"),a.setAttribute("y","0"),o&&h.setAttributes(a,o),a},h.createTSpan=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","tspan");return u.textContent=o,a&&h.setAttributes(u,a),u},h.createImage=function(o){var a=document.createElementNS("http://www.w3.org/2000/svg","image");return o&&h.setAttributes(a,o),a},h.createPoint=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return u.x=o,u.y=a,u},h.createPath=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",o),a&&h.setAttributes(u,a),u},h.createElement=function(o,a){var u=document.createElementNS("http://www.w3.org/2000/svg",o);return a&&h.setAttributes(u,a),u},h.getHollowRectanglePath=function(o,a,u,p,c,G,Ne,he){return"M"+o+","+a+"V"+(a+p)+"H"+(o+u)+"V"+a+"H"+c+"V"+G+"H"+(c+Ne)+"V"+(G+he)+"H"+c+"V"+a+"Z"},h}(),gt=function(){function h(o){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+o+"_"}return Object.defineProperty(h.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),h.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},h.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)},h.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 vt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new vt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new vt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new _t("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new _t("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},h.prototype.removeStyleSheet=function(){var o;this.styleSheet&&(((o=this.styleSheetRoot)!==null&&o!==void 0?o:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},h}(),vt=function(h,o){this.selector=h,this.style=o},_t=function(h,o){this.localName=h,this.style=o},Xt=function(){function h(){this.blocks=[],this.display=""}return h.prototype.addButtonBlock=function(o){o.className=this.blockClassName,o.buttonClassName=this.buttonClassName,o.buttonColorsClassName=this.buttonColorsClassName,o.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(o)},h.prototype.addElementBlock=function(o){o.className===void 0&&(o.className=this.blockClassName),this.blocks.push(o)},h.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},h}(),Gt=function(){function h(){}return h.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},h}(),Zt=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.buttons=[],a}return Pt(o,h),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=h.prototype.getUI.call(this);return this.buttons.forEach(function(u){return a.appendChild(u.getUI())}),a},o}(Gt),Ht=function(){function h(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(h.prototype,"icon",{get:function(){return this._icon},set:function(o){this._icon=o,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isActive",{get:function(){return this._isActive},set:function(o){this._isActive=o,this.adjustClassName()},enumerable:!1,configurable:!0}),h.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},h.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,"")))},h.prototype.hide=function(){this._isHidden=!0},h}(),yt=function(h){function o(){var a=h!==null&&h.apply(this,arguments)||this;return a.elements=[],a}return Pt(o,h),o.prototype.addElement=function(a){this.elements.push(a)},o.prototype.getUI=function(){var a=h.prototype.getUI.call(this);return this.elements.forEach(function(u){return a.appendChild(u)}),a},o}(Gt),Yt=function(){function h(o,a){this.horizontal=o,this.vertical=a}return Object.defineProperty(h.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),h.prototype.getVerticalLength=function(o){return o/this.ratio},h.prototype.getHorizontalLength=function(o){return o*this.ratio},h}(),Mt=function(){function h(){}return h.getIcon=function(o,a){if(o>0&&a>0){var u=new Yt(o,a),p=u.ratio>=1?20:u.getHorizontalLength(20),c=u.ratio<1?20:u.getVerticalLength(20),G=document.createElementNS("http://www.w3.org/2000/svg","svg");G.setAttribute("xmlns","http://www.w3.org/2000/svg"),G.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(G);var Ne=We.createDefs();G.appendChild(Ne);var he=We.createElement("clipPath",[["id","text-bg-clip"]]);Ne.appendChild(he);var wt=We.createPath(We.getHollowRectanglePath((24-p)/2,(24-c)/2,p,c,(24-p)/2+2,(24-c)/2+2,p-4,c-4));G.appendChild(wt);var se=We.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);se.appendChild(We.createTSpan(o+":"+a)),G.appendChild(se);var J=se.getBBox();We.setAttributes(se,[["x",((24-J.width)/2).toString()],["y",((24-J.height)/2-J.y).toString()]]);var Me=We.createPath(We.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(J.width))/2,(24-Math.ceil(J.height))/2,Math.ceil(J.width),Math.ceil(J.height)));return he.appendChild(Me),We.setAttributes(wt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(G),G.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>'},h}(),qt=function(h){function o(a,u,p){var c=h.call(this,a,u)||this;return c.isDropdownOpen=!1,c.onClick=c.dropdownButtonClicked,c.dropdownButtons=p,c}return Pt(o,h),o.prototype.setupDropdown=function(){var a=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(u){u.className=a.className,u.colorsClassName=a.colorsClassName,a.dropdownBlock.appendChild(u.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},o.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},o.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},o.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},o.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},o.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},o}(Ht),It=function(){function h(o,a){this.GRIP_SIZE=10,this.color=o,this.fillColor=a,this.visual=We.createGroup(),this.visual.appendChild(We.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(We.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return h.prototype.ownsTarget=function(o){return o===this.visual||o===this.visual.childNodes[0]||o===this.visual.childNodes[1]},h.prototype.setCenter=function(o,a){this.visual.childNodes.forEach(function(u){return We.setAttributes(u,[["cx",o.toString()],["cy",a.toString()]])})},h}(),bn=function(){function h(o,a,u,p){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=o,this.canvasHeight=a,this.margin=u,this.container=p,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(h.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(h.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(o){this._isGridVisible=o,this.gridContainer&&We.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(o){this._zoomFactor=o,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),h.prototype.open=function(){var o=this;this.cropShadeElement=We.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=We.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var a=0;a<this.numberOfGridLines;a++)this.horizontalGridLines.push(We.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(We.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.verticalGridLines.forEach(function(u){return o.gridContainer.appendChild(u)}),this.cropRectElement=We.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new It(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},h.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),We.setAttributes(this.cropRectElement,[["x",a.x.toString()],["y",a.y.toString()],["width",a.width.toString()],["height",a.height.toString()]]);var u=a.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(c,G){var Ne=a.y+u*(G+1);We.setAttributes(c,[["x1",""+a.x],["y1",""+Ne],["x2",""+(a.x+a.width)],["y2",""+Ne]])});var p=a.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(c,G){var Ne=a.x+p*(G+1);We.setAttributes(c,[["x1",""+Ne],["y1",""+a.y],["x2",""+Ne],["y2",""+(a.y+a.height)]])}),We.setAttributes(this.cropShadeElement,[["d",We.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},h.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)},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.container.getBoundingClientRect();return{x:o-u.left+this.margin,y:a-u.top+this.margin}},h.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)},h.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()},h.prototype.onPointerUp=function(o){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(o.pointerId)},h.prototype.move=function(o){var a=o.x-this.previousPoint.x,u=o.y-this.previousPoint.y;this.zoomFactor!==1&&(a=-a/this.zoomFactor,u=-u/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+a),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+u),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=o},h.prototype.resize=function(o){var a=Object.assign({},this.cropRect),u=o.x-this.previousPoint.x,p=o.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:a.x+u<this.margin&&(u=this.margin-a.x),a.x+=u,a.width=this.cropRect.x+this.cropRect.width-a.x;break;case this.bottomRightGrip:case this.topRightGrip:a.width+u>this.canvasWidth*this.zoomFactor&&(u=this.canvasWidth*this.zoomFactor-a.width),a.width+=u}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(a.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(u),a.height=this.aspectRatio.getVerticalLength(a.width)):(a.y+=p,a.height=this.cropRect.y+this.cropRect.height-a.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?a.height=this.aspectRatio.getVerticalLength(a.width):a.height+=p}a.width<10&&(a.x=this.cropRect.x,a.width=10),a.height<10&&(a.y=this.cropRect.y,a.height=10),this.previousPoint=o,a.x>=this.margin&&a.y>=this.margin&&a.x-this.margin+a.width<=this.canvasWidth&&a.y-this.margin+a.height<=this.canvasHeight&&(this.cropRect=a,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},h.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var o=this.cropRect.x+this.cropRect.width/2,a=this.cropRect.y+this.cropRect.height/2,u=this.aspectRatio.getHorizontalLength(this.cropRect.height),p=this.aspectRatio.getVerticalLength(this.cropRect.width);u/this.canvasWidth<p/this.canvasHeight?this.cropRect.width=u:this.cropRect.height=p,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=o-this.cropRect.width/2,this.cropRect.y=a-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},h.prototype.getRescaledRect=function(o,a,u,p,c,G){var Ne=u/o,he=p/a;return{x:(c.x-G)*Ne+G,y:(c.y-G)*he+G,width:c.width*Ne,height:c.height*he}},h.prototype.scaleCanvas=function(o,a){var u=this.getRescaledRect(this.canvasWidth,this.canvasHeight,o,a,this.cropRect,this.margin);this.canvasWidth=o,this.canvasHeight=a,this.onCropChange&&this.onCropChange(u),this.setCropRectangle(u)},h}(),oi=function(){function h(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(h.prototype,"angle",{get:function(){return this._angle},set:function(o){this._angle=o,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),h.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},h.prototype.onPointerDown=function(o){this.controlContainer.setPointerCapture(o.pointerId),this.isDragging=!0,this.previousPoint={x:o.clientX,y:o.clientY}},h.prototype.onPointerMove=function(o){this.isDragging&&(this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.previousPoint.x=o.clientX)},h.prototype.onPointerUp=function(o){this.isDragging&&this.onAngleChange&&this.onAngleChange((o.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(o.pointerId)},h.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var o=this.angleLabelText.getBBox();We.setAttributes(this.angleLabelElement,[["x",((this.width-o.width)/2).toString()],["y",(this.height/2).toString()]])}},h.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)}},h.prototype.getVisual=function(){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",this.width+"px"),o.setAttribute("height",this.height+"px"),o.setAttribute("viewBox","0 0 "+this.width+" "+this.height),o.style.flexShrink="0",document.body.appendChild(o);for(var a="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,u=1;u<=this.width/5+10;u++){var p=u%5==0?this.height/3:this.height/6;a+="h4v"+-p+"h1v"+p}a+="v1H0Z",this.scaleShape=We.createPath(a);var c=We.createTransform();this.scaleShape.transform.baseVal.appendItem(c),o.appendChild(this.scaleShape),this.angleLabelElement=We.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=We.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var G=We.createTSpan("");return G.innerHTML="&deg;",this.angleLabelElement.appendChild(G),o.appendChild(this.angleLabelElement),document.body.removeChild(o),o},h}(),li=function(){function h(){this.naturalSize=!1,this.imageType="image/png"}return h.prototype.rasterize=function(o,a,u,p,c,G,Ne){var he=this;return new Promise(function(wt){var se=document.createElement("canvas");se.width=o.width.baseVal.value-2*p,se.height=o.height.baseVal.value-2*p;var J=1,Me=1;he.naturalSize===!0?(J=a.naturalWidth/(o.width.baseVal.value-2*p)/G,Me=a.naturalHeight/(o.height.baseVal.value-2*p)/Ne,se.width=a.naturalWidth/G,se.height=a.naturalHeight/Ne):he.width!==void 0&&he.height!==void 0&&(J=he.width/u.width,Me=he.height/u.height,se.width*=J,se.height*=Me);var rt=se.getContext("2d");rt.translate(se.width/2,se.height/2),rt.rotate(c*Math.PI/180),rt.scale(G,Ne),rt.translate(-se.width/2,-se.height/2),rt.drawImage(a,0,0,se.width,se.height);var ct=document.createElement("canvas");ct.width=u.width*J,ct.height=u.height*Me,ct.getContext("2d").putImageData(rt.getImageData((u.x-p)*J,(u.y-p)*Me,u.width*J,u.height*Me),0,0),wt(ct.toDataURL(he.imageType,he.imageQuality))})},h}(),De=function(){function h(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=h.instanceCounter++,this.styles=new gt(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(h.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(o){this._zoomToCropEnabled=o,o?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.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(h.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(h.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(h.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}),h.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},h.prototype.show=function(){this.showUI(),this.open()},h.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)},h.prototype.addRenderEventListener=function(o){this.renderEventListeners.push(o)},h.prototype.removeRenderEventListener=function(o){this.renderEventListeners.indexOf(o)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(o),1)},h.prototype.addCloseEventListener=function(o){this.closeEventListeners.push(o)},h.prototype.removeCloseEventListener=function(o){this.closeEventListeners.indexOf(o)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(o),1)},h.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))},h.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var o=1*this.target.clientWidth/this.target.clientHeight,a=this.contentDiv.clientWidth/o>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*o:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,u=a+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/o;this.resize(a,u)}},h.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},h.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",We.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},h.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()},h.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();We.setAttributes(this.editingTarget,[["href",a]]),this.setEditingTargetSize()},h.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},h.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=We.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=We.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=We.createGroup(),this.editingTargetRotationScaleContainer=We.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var o=We.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(o);var a=We.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(a),this.editingTargetContainer=We.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)},h.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},h.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=We.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new bn(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()},h.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)}},h.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)},h.prototype.cropRectChanged=function(o){this.cropRect=o,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},h.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},h.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"},h.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},h.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},h.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},h.prototype.addTopToolbar=function(){var o=this;this.topToolbar=new Xt,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 Zt;a.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(a);var u=[];this.aspectRatios.forEach(function(Me){var rt=new Ht(Mt.getIcon(Me.horizontal,Me.vertical),Me.horizontal===0&&Me.vertical===0?"FREE":Me.horizontal+":"+Me.vertical);rt.onClick=function(){return o.ratioButtonClicked(Me)},u.push(rt)}),this.aspectRatioButton=new qt(Mt.getIcon(0,0),"Aspect ratio",u),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,a.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var p=new Ht('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");p.isActive=this.isGridVisible,p.onClick=function(){o.isGridVisible=!o.isGridVisible,p.isActive=o.isGridVisible},a.addButton(p);var c=new Ht('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(c.isActive=this.zoomToCropEnabled,c.onClick=function(){o.zoomToCropEnabled=!o.zoomToCropEnabled,c.isActive=o.zoomToCropEnabled},a.addButton(c),!Nt.isLicensed){var G=new yt;this.topToolbar.addElementBlock(G);var Ne=document.createElement("div");Ne.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var he=document.createElement("a");he.style.color="currentColor",he.href="https://markerjs.com/products/cropro",he.target="_blank",he.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>',Ne.appendChild(he),G.addElement(Ne)}var wt=new Zt;wt.minWidth=3*this.toolbarHeight+"px",wt.contentAlign="end",this.topToolbar.addButtonBlock(wt);var se=new Ht('<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");se.onClick=this.startRenderAndClose,wt.addButton(se),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(se.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var J=new Ht('<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");J.onClick=this.close,wt.addButton(J),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(J.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},h.prototype.addBottomToolbar=function(){var o=this;this.bottomToolbar=new Xt,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 Zt;a.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(a);var u=new Ht('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");u.onClick=this.rotateLeftButtonClicked,a.addButton(u);var p=new Ht('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");p.onClick=this.rotateRightButtonClicked,a.addButton(p);var c=new yt;c.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(c),this.straightener=new oi("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(wt){o.rotateBy(wt),o.straightener.angle=o.rotationAngle},c.addElement(this.straightener.getUI());var G=new Zt;G.minWidth=2*this.toolbarHeight+"px",G.contentAlign="end",this.bottomToolbar.addButtonBlock(G);var Ne=new Ht('<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");Ne.onClick=this.flipHorizontallyButtonClicked,G.addButton(Ne);var he=new Ht('<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");he.onClick=this.flipVerticallyButtonClicked,G.addButton(he)},h.prototype.ratioButtonClicked=function(o){this.aspectRatio=o,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},h.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Mt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},h.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Yt(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},h.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},h.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},h.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()}},h.prototype.clientToLocalCoordinates=function(o,a){var u=this.cropImage.getBoundingClientRect();return{x:o-u.left,y:a-u.top}},h.prototype.onWindowResize=function(){this.positionUI()},h.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()},h.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)},h.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)},h.prototype.rotateTo=function(o){o=(o=o>180?o-360:o)<=-180?o+360:o,this.rotationAngle=o,this.applyRotation()},h.prototype.rotateBy=function(o){this.rotateTo((this.rotationAngle+o)%360)},h.prototype.applyRotation=function(){var o=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var a=this.editingTargetRotationContainer.transform.baseVal.getItem(0);a.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(a,0);var u=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/u.width,this.imageHeight/u.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=o},h.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},h.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},h.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},h.prototype.startRenderAndClose=function(){return ut(this,void 0,void 0,function(){var o,a;return Wt(this,function(u){switch(u.label){case 0:return[4,this.render()];case 1:return o=u.sent(),a=this.getState(),this.renderEventListeners.forEach(function(p){return p(o,a)}),this.close(!0),[2]}})})},h.prototype.render=function(){return ut(this,void 0,void 0,function(){var o;return Wt(this,function(a){switch(a.label){case 0:return(o=new li).naturalSize=this.renderAtNaturalSize,o.imageType=this.renderImageType,o.imageQuality=this.renderImageQuality,o.width=this.renderWidth,o.height=this.renderHeight,this.unzoomFromCrop(),We.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()]}})})},h.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new _t("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 _t("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new _t("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var o=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new _t("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 _t("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new _t("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new vt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new vt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new _t("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 _t("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new _t("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 _t("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 _t("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},h.instanceCounter=0,h}(),Ze=y("8hTe"),on=y.n(Ze),hn=/<pre[^>]*>/g;function gn(h){var o=document.createElement("div");return o.innerHTML=h,o.childNodes.length===0?"":o.childNodes[0].nodeValue}var En=Ye.a=function(h){var o=h.value,a=o===void 0?"":o,u=h.edit,p=u===void 0?!1:u,c=h.className,G=h.showTextOnly,Ne=h.showLines,he=h.replaces,wt=h.zoomImg,se=h.hasMask,J=h.style,Me=J===void 0?{}:J,rt=h.stylesPrev,ct=rt===void 0?{}:rt,at=String(a),Ot=Object(F.useRef)(),en=Object(F.useRef)(),mn=Object(F.useState)(""),ln=Object(P.a)(mn,2),tn=ln[0],wn=ln[1],Sn=Object(F.useState)("office"),Pn=Object(P.a)(Sn,2),Yn=Pn[0],vn=Pn[1],Dn=function(){var nn=new De(en.current);nn.displayMode="popup",nn.addRenderEventListener(function(){var Wn=Object(q.a)(R.a.mark(function rn(zn){var fn;return R.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return Ot.current.style.display="none",On.next=3,Object($e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:zn}});case 3:fn=On.sent,fn!=null&&fn.id&&he(en.current.getAttribute("src").replace(Oe.a.API_SERVER,""),"/api/attachments/".concat(fn==null?void 0:fn.id,"?type=").concat(fn.content_type));case 5:case"end":return On.stop()}},rn)}));return function(rn){return Wn.apply(this,arguments)}}()),nn.show()},pi=function(){var nn=new Tt(en.current);nn.settings.displayMode="popup",nn.addEventListener("render",function(){var Wn=Object(q.a)(R.a.mark(function rn(zn){var fn;return R.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(Ot.current.style.display="none",!en.current){On.next=6;break}return On.next=4,Object($e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:zn.dataUrl}});case 4:fn=On.sent,fn!=null&&fn.id&&he(en.current.getAttribute("src").replace(Oe.a.API_SERVER,""),"/api/attachments/".concat(fn==null?void 0:fn.id,"?type=").concat(fn.content_type));case 6:case"end":return On.stop()}},rn)}));return function(rn){return Wn.apply(this,arguments)}}()),nn.show(),window.markerArea=nn},Fn=Object(F.useMemo)(function(){try{var kn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,nn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Wn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;at=at.replace(kn,"("+Oe.a.API_SERVER+"/api/attachments/").replace(nn,'"'+Oe.a.API_SERVER+"/api/attachments/").replace(Wn,'"'+Oe.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,`
`),at=at.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(_i){}var rn=de(at),zn=K();if(at.match(/\[TOC\]/)&&(rn=rn.replace("<p>[TOC]</p>",v()),je()),rn=rn.replace(/(__special_katext_id_\d+__)/g,function(_i,On){var Ln=zn[On],mi=Ln.type,wi=Ln.expression;return Object(Ce.renderToString)(gn(wi)||"",{displayMode:mi==="block",throwOnError:!1,output:"html"})}),rn=rn.replace(/▁/g,"\u2581\u2581\u2581"),X(),G){var fn=document.createElement("div");return fn.innerHTML=rn,fn.innerText}return setTimeout(function(){return Ii()},500),rn},[at]),ti=Object(F.useRef)();fe.WebkitLineClamp=Ne,Ne&&(Me=Object(ue.a)(Object(ue.a)({},Me),fe));function Ni(kn){var nn=kn.target;if(nn.tagName.toUpperCase()==="IMG"){if(wt){var Wn=nn.getAttribute("src");wn(Wn),vn("image")}}else if(nn.tagName.toUpperCase()==="A"){var rn=nn.getAttribute("href");if(rn.indexOf("office")>-1)kn.preventDefault(),wn(rn),vn("office");else if(rn.indexOf("application/pdf")>-1)kn.preventDefault(),wn(rn),vn("pdf");else if(rn.indexOf("type=text")>-1)kn.preventDefault(),wn(rn),vn("html");else if(rn.startsWith("#")){kn.preventDefault();var zn=document.getElementById(rn.replace("#",""));zn&&zn.scrollIntoView(!0)}}}var Ii=function(){var nn,Wn=(nn=ti.current)===null||nn===void 0?void 0:nn.querySelectorAll("video");Wn==null||Wn.forEach(function(rn){if(rn.oncontextmenu=function(){return!1},rn.src.indexOf(".m3u8")>-1&&!rn.canPlayType("application/vnd.apple.mpegurl")){if(Q.a.isSupported()){var zn=new Q.a;zn.loadSource(rn.src),zn.attachMedia(rn)}}})};Object(F.useEffect)(function(){if(ti.current&&Fn&&(Fn.match(hn)&&window.PR.prettyPrint()),ti.current)return ti.current.addEventListener("click",Ni),function(){ti.current.removeEventListener("click",Ni),X(),je()}},[Fn,ti.current,Ni]);var ji=function(nn){if(!p)return;nn.target.nodeName==="IMG"?(Ot.current.style.display="flex",Ot.current.style.width=nn.target.clientWidth+"px",Ot.current.style.height=nn.target.clientHeight+"px",Ot.current.style.top=nn.target.offsetTop+"px",Ot.current.style.left=nn.target.offsetLeft+"px",en.current.src=nn.target.getAttribute("src")):Ot.current.style.display="none"};return O.a.createElement("div",{style:{position:"relative"}},O.a.createElement("div",{ref:ti,style:Object(ue.a)({},Me),className:"".concat(c||""," markdown-body ").concat(on.a.mdBody),onMouseOver:ji,dangerouslySetInnerHTML:{__html:Fn}}),O.a.createElement("div",{ref:Ot,className:on.a.button},O.a.createElement(ve.a,null,O.a.createElement(me.a,{onClick:function(){return Dn()}},"\u88C1\u526A"),O.a.createElement(me.a,{onClick:function(){return pi()}},"\u7F16\u8F91"))),O.a.createElement("img",{ref:en,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),O.a.createElement(Ve.a,{close:!0,data:tn,hasMask:se,type:tn!=null&&tn.length?Yn:"",style:Object(ue.a)({},ct),onClose:function(){return wn("")}}))}},"9VGf":function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return Z});var z=y("q1tI"),ve=y.n(z);function Z(me,ue){var q=Object(z.useRef)();Object(z.useEffect)(function(){q.current=me}),Object(z.useEffect)(function(){function P(){q.current()}if(ue!==null){var L=setInterval(P,ue);return function(){return clearInterval(L)}}},[ue])}},Bd2K:function(nt,Ye,y){(function(z){z(y("VrN/"),y("osHv"))})(function(z){z.defineOption("autoCloseTags",!1,function(R,F,O){if(O!=z.Init&&O&&R.removeKeyMap("autoCloseTags"),!F)return;var T={name:"autoCloseTags"};(typeof F!="object"||F.whenClosing!==!1)&&(T["'/'"]=function(ee){return q(ee)}),(typeof F!="object"||F.whenOpening!==!1)&&(T["'>'"]=function(ee){return me(ee)}),R.addKeyMap(T)});var ve=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Z=["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 me(R){if(R.getOption("disableInput"))return z.Pass;for(var F=R.listSelections(),O=[],T=R.getOption("autoCloseTags"),ee=0;ee<F.length;ee++){if(!F[ee].empty())return z.Pass;var U=F[ee].head,W=R.getTokenAt(U),V=z.innerMode(R.getMode(),W.state),$=V.state,ie=V.mode.xmlCurrentTag&&V.mode.xmlCurrentTag($),re=ie&&ie.name;if(!re)return z.Pass;var be=V.mode.configuration=="html",je=typeof T=="object"&&T.dontCloseTags||be&&ve,fe=typeof T=="object"&&T.indentTags||be&&Z;W.end>U.ch&&(re=re.slice(0,re.length-W.end+U.ch));var le=re.toLowerCase();if(!re||W.type=="string"&&(W.end!=U.ch||!/[\"\']/.test(W.string.charAt(W.string.length-1))||W.string.length==1)||W.type=="tag"&&ie.close||W.string.indexOf("/")==U.ch-W.start-1||je&&P(je,le)>-1||L(R,V.mode.xmlCurrentContext&&V.mode.xmlCurrentContext($)||[],re,U,!0))return z.Pass;var v=typeof T=="object"&&T.emptyTags;if(v&&P(v,re)>-1){O[ee]={text:"/>",newPos:z.Pos(U.line,U.ch+2)};continue}var pe=fe&&P(fe,le)>-1;O[ee]={indent:pe,text:">"+(pe?`
`:"")+"</"+re+">",newPos:pe?z.Pos(U.line+1,0):z.Pos(U.line,U.ch+1)}}for(var ne=typeof T=="object"&&T.dontIndentOnAutoClose,ee=F.length-1;ee>=0;ee--){var ye=O[ee];R.replaceRange(ye.text,F[ee].head,F[ee].anchor,"+insert");var j=R.listSelections().slice(0);j[ee]={head:ye.newPos,anchor:ye.newPos},R.setSelections(j),!ne&&ye.indent&&(R.indentLine(ye.newPos.line,null,!0),R.indentLine(ye.newPos.line+1,null,!0))}}function ue(R,F){for(var O=R.listSelections(),T=[],ee=F?"/":"</",U=R.getOption("autoCloseTags"),W=typeof U=="object"&&U.dontIndentOnSlash,V=0;V<O.length;V++){if(!O[V].empty())return z.Pass;var $=O[V].head,ie=R.getTokenAt($),re=z.innerMode(R.getMode(),ie.state),be=re.state;if(F&&(ie.type=="string"||ie.string.charAt(0)!="<"||ie.start!=$.ch-1))return z.Pass;var je,fe=re.mode.name!="xml"&&R.getMode().name=="htmlmixed";if(fe&&re.mode.name=="javascript")je=ee+"script";else if(fe&&re.mode.name=="css")je=ee+"style";else{var le=re.mode.xmlCurrentContext&&re.mode.xmlCurrentContext(be);if(!le||le.length&&L(R,le,le[le.length-1],$))return z.Pass;je=ee+le[le.length-1]}R.getLine($.line).charAt(ie.end)!=">"&&(je+=">"),T[V]=je}if(R.replaceSelections(T),O=R.listSelections(),!W)for(var V=0;V<O.length;V++)(V==O.length-1||O[V].head.line<O[V+1].head.line)&&R.indentLine(O[V].head.line)}function q(R){return R.getOption("disableInput")?z.Pass:ue(R,!0)}z.commands.closeTag=function(R){return ue(R)};function P(R,F){if(R.indexOf)return R.indexOf(F);for(var O=0,T=R.length;O<T;++O)if(R[O]==F)return O;return-1}function L(R,F,O,T,ee){if(!z.scanForClosingTag)return!1;var U=Math.min(R.lastLine()+1,T.line+500),W=z.scanForClosingTag(R,T,null,U);if(!W||W.tag!=O)return!1;for(var V=ee?1:0,$=F.length-1;$>=0&&F[$]==O;$--)++V;T=W.to;for(var $=1;$<V;$++){var ie=z.scanForClosingTag(R,T,null,U);if(!ie||ie.tag!=O)return!1;T=ie.to}return!0}})},BjJ7:function(nt,Ye,y){"use strict";y.d(Ye,"d",function(){return ve}),y.d(Ye,"c",function(){return Z}),y.d(Ye,"e",function(){return me}),y.d(Ye,"b",function(){return ue}),y.d(Ye,"a",function(){return P});var z=y("m3rI");function ve(L){var R=!0;if(L.length>0){for(var F=0;F<L.length;F++)if(L[F].compile_success==0||!L[F].compile_success){R=!1;break}}else R=!1;return R}function Z(L){for(var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",F=[],O=0;O<L.length;O++){var T=L[O],ee=R?"".concat(R,"/").concat(T.name):"".concat(T.name);F.push({title:T.name,isLeaf:!(T.type==="tree"),key:ee})}return F}function me(L,R,F){for(var O=0;O<L.length;O++){var T=L[O];if(T.key===R){T.children=F;break}T.children&&me(T.children,R,F)}return L}function ue(L,R,F){var O;return function(){var T=this,ee=arguments,U=function(){O=null,F||L.apply(T,ee)},W=F&&!O;clearTimeout(O),O=setTimeout(U,R),W&&L.apply(T,ee)}}var q=!0,P=z.a.API_SERVER},"C+DQ":function(nt,Ye,y){},D1Df:function(nt,Ye,y){"use strict";function z(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?z=function(Y){return typeof Y}:z=function(Y){return Y&&typeof Symbol=="function"&&Y.constructor===Symbol&&Y!==Symbol.prototype?"symbol":typeof Y},z(C)}function ve(){return ve=Object.assign||function(C){for(var k=1;k<arguments.length;k++){var Y=arguments[k];for(var M in Y)Object.prototype.hasOwnProperty.call(Y,M)&&(C[M]=Y[M])}return C},ve.apply(this,arguments)}function Z(C,k){var Y=Object.keys(C);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(C);k&&(M=M.filter(function(de){return Object.getOwnPropertyDescriptor(C,de).enumerable})),Y.push.apply(Y,M)}return Y}function me(C){for(var k=1;k<arguments.length;k++){var Y=arguments[k]!=null?arguments[k]:{};k%2?Z(Y,!0).forEach(function(M){W(C,M,Y[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(Y)):Z(Y).forEach(function(M){Object.defineProperty(C,M,Object.getOwnPropertyDescriptor(Y,M))})}return C}function ue(C,k){if(C==null)return{};var Y=q(C,k),M,de;if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(C);for(de=0;de<_.length;de++){if(M=_[de],k.indexOf(M)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(C,M))continue;Y[M]=C[M]}}return Y}function q(C,k){if(C==null)return{};var Y={},M=Object.keys(C),de,_;for(_=0;_<M.length;_++){if(de=M[_],k.indexOf(de)>=0)continue;Y[de]=C[de]}return Y}function P(C,k){if(!(C instanceof k))throw new TypeError("Cannot call a class as a function")}function L(C,k){for(var Y=0;Y<k.length;Y++){var M=k[Y];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(C,M.key,M)}}function R(C,k,Y){return k&&L(C.prototype,k),Y&&L(C,Y),C}function F(C,k){return k&&(z(k)==="object"||typeof k=="function")?k:T(C)}function O(C){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(Y){return Y.__proto__||Object.getPrototypeOf(Y)},O(C)}function T(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function ee(C,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(k&&k.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),k&&U(C,k)}function U(C,k){return U=Object.setPrototypeOf||function(M,de){return M.__proto__=de,M},U(C,k)}function W(C,k,Y){return k in C?Object.defineProperty(C,k,{value:Y,enumerable:!0,configurable:!0,writable:!0}):C[k]=Y,C}var V=y("q1tI"),$=y("17x9"),ie=y("H38U"),re=y("aRTE");function be(C){for(var k="",Y=0;Y<C.length;Y++){var M=C.charCodeAt(Y);M<128?k+=String.fromCharCode(M):M<2048?(k+=String.fromCharCode(192|M>>6),k+=String.fromCharCode(128|M&63)):M<55296||M>=57344?(k+=String.fromCharCode(224|M>>12),k+=String.fromCharCode(128|M>>6&63),k+=String.fromCharCode(128|M&63)):(Y++,M=65536+((M&1023)<<10|C.charCodeAt(Y)&1023),k+=String.fromCharCode(240|M>>18),k+=String.fromCharCode(128|M>>12&63),k+=String.fromCharCode(128|M>>6&63),k+=String.fromCharCode(128|M&63))}return k}var je={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},fe={},le=4,v=.1;function pe(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Y=[];return C.forEach(function(M,de){var _=null;M.forEach(function(m,Q){if(!m&&_!==null){Y.push("M".concat(_+k," ").concat(de+k,"h").concat(Q-_,"v1H").concat(_+k,"z")),_=null;return}if(Q===M.length-1){if(!m)return;_===null?Y.push("M".concat(Q+k,",").concat(de+k," h1v1H").concat(Q+k,"z")):Y.push("M".concat(_+k,",").concat(de+k," h").concat(Q+1-_,"v1H").concat(_+k,"z"));return}m&&_===null&&(_=Q)})}),Y.join("")}function ne(C,k){return C.slice().map(function(Y,M){return M<k.y||M>=k.y+k.h?Y:Y.map(function(de,_){return _<k.x||_>=k.x+k.w?de:!1})})}function ye(C,k){var Y=C.imageSettings,M=C.size,de=C.includeMargin;if(Y==null)return null;var _=de?le:0,m=k.length+_*2,Q=Math.floor(M*v),Oe=m/M,Ce=(Y.width||Q)*Oe,Ve=(Y.height||Q)*Oe,$e=Y.x==null?k.length/2-Ce/2:Y.x*Oe,_e=Y.y==null?k.length/2-Ve/2:Y.y*Oe,Le=null;if(Y.excavate){var Se=Math.floor($e),Te=Math.floor(_e),te=Math.ceil(Ce+$e-Se),w=Math.ceil(Ve+_e-Te);Le={x:Se,y:Te,w:te,h:w}}return{x:$e,y:_e,h:Ve,w:Ce,excavation:Le}}var j=function(){try{new Path2D().addPath(new Path2D)}catch(C){return!1}return!0}(),E=function(C){ee(k,C);function k(){var Y,M;P(this,k);for(var de=arguments.length,_=new Array(de),m=0;m<de;m++)_[m]=arguments[m];return M=F(this,(Y=O(k)).call.apply(Y,[this].concat(_))),W(T(M),"_canvas",void 0),W(T(M),"_image",void 0),W(T(M),"state",{imgLoaded:!1}),W(T(M),"handleImageLoad",function(){M.setState({imgLoaded:!0})}),M}return R(k,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(){this.update()}},{key:"update",value:function(){var M=this.props,de=M.value,_=M.size,m=M.level,Q=M.bgColor,Oe=M.fgColor,Ce=M.includeMargin,Ve=M.imageSettings,$e=new ie(-1,re[m]);if($e.addData(be(de)),$e.make(),this._canvas!=null){var _e=this._canvas,Le=_e.getContext("2d");if(!Le)return;var Se=$e.modules;if(Se===null)return;var Te=Ce?le:0,te=Se.length+Te*2,w=ye(this.props,Se);Ve!=null&&w!=null&&(w.excavation!=null&&(Se=ne(Se,w.excavation)));var Ie=window.devicePixelRatio||1;_e.height=_e.width=_*Ie;var dt=_/te*Ie;Le.scale(dt,dt),Le.fillStyle=Q,Le.fillRect(0,0,te,te),Le.fillStyle=Oe,j?Le.fill(new Path2D(pe(Se,Te))):Se.forEach(function(kt,Qe){kt.forEach(function(Je,Pe){Je&&Le.fillRect(Pe+Te,Qe+Te,1,1)})}),this.state.imgLoaded&&this._image&&w!=null&&Le.drawImage(this._image,w.x+Te,w.y+Te,w.w,w.h)}}},{key:"render",value:function(){var M=this,de=this.props,_=de.value,m=de.size,Q=de.level,Oe=de.bgColor,Ce=de.fgColor,Ve=de.style,$e=de.includeMargin,_e=de.imageSettings,Le=ue(de,["value","size","level","bgColor","fgColor","style","includeMargin","imageSettings"]),Se=me({height:m,width:m},Ve),Te=null,te=_e&&_e.src;return _e!=null&&te!=null&&(Te=V.createElement("img",{src:te,style:{display:"none"},onLoad:this.handleImageLoad,ref:function(Ie){return M._image=Ie}})),V.createElement(V.Fragment,null,V.createElement("canvas",ve({style:Se,height:m,width:m,ref:function(Ie){return M._canvas=Ie}},Le)),Te)}}]),k}(V.PureComponent);W(E,"defaultProps",je);var K=function(C){ee(k,C);function k(){return P(this,k),F(this,O(k).apply(this,arguments))}return R(k,[{key:"render",value:function(){var M=this.props,de=M.value,_=M.size,m=M.level,Q=M.bgColor,Oe=M.fgColor,Ce=M.includeMargin,Ve=M.imageSettings,$e=ue(M,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]),_e=new ie(-1,re[m]);_e.addData(be(de)),_e.make();var Le=_e.modules;if(Le===null)return null;var Se=Ce?le:0,Te=Le.length+Se*2,te=ye(this.props,Le),w=null;Ve!=null&&te!=null&&(te.excavation!=null&&(Le=ne(Le,te.excavation)),w=V.createElement("image",{xlinkHref:Ve.src,height:te.h,width:te.w,x:te.x+Se,y:te.y+Se,preserveAspectRatio:"none"}));var Ie=pe(Le,Se);return V.createElement("svg",ve({shapeRendering:"crispEdges",height:_,width:_,viewBox:"0 0 ".concat(Te," ").concat(Te)},$e),V.createElement("path",{fill:Q,d:"M0,0 h".concat(Te,"v").concat(Te,"H0z")}),V.createElement("path",{fill:Oe,d:Ie}),w)}}]),k}(V.PureComponent);W(K,"defaultProps",je);var X=function(k){var Y=k.renderAs,M=ue(k,["renderAs"]),de=Y==="svg"?K:E;return V.createElement(de,M)};X.defaultProps=me({renderAs:"canvas"},je),nt.exports=X},DlQD:function(nt,Ye,y){(function(z,ve){nt.exports=ve()})(this,function(){"use strict";function z(D,B){for(var I=0;I<B.length;I++){var b=B[I];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(D,b.key,b)}}function ve(D,B,I){return B&&z(D.prototype,B),I&&z(D,I),D}function Z(D,B){if(!D)return;if(typeof D=="string")return me(D,B);var I=Object.prototype.toString.call(D).slice(8,-1);if(I==="Object"&&D.constructor&&(I=D.constructor.name),I==="Map"||I==="Set")return Array.from(D);if(I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return me(D,B)}function me(D,B){(B==null||B>D.length)&&(B=D.length);for(var I=0,b=new Array(B);I<B;I++)b[I]=D[I];return b}function ue(D,B){var I;if(typeof Symbol=="undefined"||D[Symbol.iterator]==null){if(Array.isArray(D)||(I=Z(D))||B&&D&&typeof D.length=="number"){I&&(D=I);var b=0;return function(){return b>=D.length?{done:!0}:{done:!1,value:D[b++]}}}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 I=D[Symbol.iterator](),I.next.bind(I)}function q(D,B){return B={exports:{}},D(B,B.exports),B.exports}var P=q(function(D){function B(){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 I(b){D.exports.defaults=b}D.exports={defaults:B(),getDefaults:B,changeDefaults:I}}),L=P.defaults,R=P.getDefaults,F=P.changeDefaults,O=/[&<>"']/,T=/[&<>"']/g,ee=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,W={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},V=function(B){return W[B]};function $(D,B){if(B){if(O.test(D))return D.replace(T,V)}else if(ee.test(D))return D.replace(U,V);return D}var ie=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function re(D){return D.replace(ie,function(B,I){return I=I.toLowerCase(),I==="colon"?":":I.charAt(0)==="#"?I.charAt(1)==="x"?String.fromCharCode(parseInt(I.substring(2),16)):String.fromCharCode(+I.substring(1)):""})}var be=/(^|[^\[])\^/g;function je(D,B){D=D.source||D,B=B||"";var I={replace:function(x,S){return S=S.source||S,S=S.replace(be,"$1"),D=D.replace(x,S),I},getRegex:function(){return new RegExp(D,B)}};return I}var fe=/[^\w:]/g,le=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(D,B,I){if(D){var b;try{b=decodeURIComponent(re(I)).replace(fe,"").toLowerCase()}catch(x){return null}if(b.indexOf("javascript:")===0||b.indexOf("vbscript:")===0||b.indexOf("data:")===0)return null}B&&!le.test(I)&&(I=E(B,I));try{I=encodeURI(I).replace(/%25/g,"%")}catch(x){return null}return I}var pe={},ne=/^[^:]+:\/*[^/]*$/,ye=/^([^:]+:)[\s\S]*$/,j=/^([^:]+:\/*[^/]*)[\s\S]*$/;function E(D,B){pe[" "+D]||(ne.test(D)?pe[" "+D]=D+"/":pe[" "+D]=k(D,"/",!0)),D=pe[" "+D];var I=D.indexOf(":")===-1;return B.substring(0,2)==="//"?I?B:D.replace(ye,"$1")+B:B.charAt(0)==="/"?I?B:D.replace(j,"$1")+B:D+B}var K={exec:function(){}};function X(D){for(var B=1,I,b;B<arguments.length;B++){I=arguments[B];for(b in I)Object.prototype.hasOwnProperty.call(I,b)&&(D[b]=I[b])}return D}function C(D,B){var I=D.replace(/\|/g,function(S,A,ae){for(var ge=!1,xe=A;--xe>=0&&ae[xe]==="\\";)ge=!ge;return ge?"|":" |"}),b=I.split(/ \|/),x=0;if(b.length>B)b.splice(B);else for(;b.length<B;)b.push("");for(;x<b.length;x++)b[x]=b[x].trim().replace(/\\\|/g,"|");return b}function k(D,B,I){var b=D.length;if(b===0)return"";for(var x=0;x<b;){var S=D.charAt(b-x-1);if(S===B&&!I)x++;else if(S!==B&&I)x++;else break}return D.substr(0,b-x)}function Y(D,B){if(D.indexOf(B[1])===-1)return-1;for(var I=D.length,b=0,x=0;x<I;x++)if(D[x]==="\\")x++;else if(D[x]===B[0])b++;else if(D[x]===B[1]&&(b--,b<0))return x;return-1}function M(D){D&&D.sanitize&&!D.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 de={escape:$,unescape:re,edit:je,cleanUrl:v,resolveUrl:E,noopTest:K,merge:X,splitCells:C,rtrim:k,findClosingBracket:Y,checkSanitizeDeprecation:M},_=P.defaults,m=de.rtrim,Q=de.splitCells,Oe=de.escape,Ce=de.findClosingBracket;function Ve(D,B,I){var b=B.href,x=B.title?Oe(B.title):null,S=D[1].replace(/\\([\[\]])/g,"$1");return D[0].charAt(0)!=="!"?{type:"link",raw:I,href:b,title:x,text:S}:{type:"image",raw:I,href:b,title:x,text:Oe(S)}}function $e(D,B){var I=D.match(/^(\s+)(?:```)/);if(I===null)return B;var b=I[1];return B.split(`
`).map(function(x){var S=x.match(/^\s+/);if(S===null)return x;var A=S[0];return A.length>=b.length?x.slice(b.length):x}).join(`
`)}var _e=function(){function D(I){this.options=I||_}var B=D.prototype;return B.space=function(b){var x=this.rules.block.newline.exec(b);if(x)return x[0].length>1?{type:"space",raw:x[0]}:{raw:`
`}},B.code=function(b,x){var S=this.rules.block.code.exec(b);if(S){var A=x[x.length-1];if(A&&A.type==="paragraph")return{raw:S[0],text:S[0].trimRight()};var ae=S[0].replace(/^ {4}/gm,"");return{type:"code",raw:S[0],codeBlockStyle:"indented",text:this.options.pedantic?ae:m(ae,`
`)}}},B.fences=function(b){var x=this.rules.block.fences.exec(b);if(x){var S=x[0],A=$e(S,x[3]||"");return{type:"code",raw:S,lang:x[2]?x[2].trim():x[2],text:A}}},B.heading=function(b){var x=this.rules.block.heading.exec(b);if(x)return{type:"heading",raw:x[0],depth:x[1].length,text:x[2]}},B.nptable=function(b){var x=this.rules.block.nptable.exec(b);if(x){var S={type:"table",header:Q(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(`
`):[],raw:x[0]};if(S.header.length===S.align.length){var A=S.align.length,ae;for(ae=0;ae<A;ae++)/^ *-+: *$/.test(S.align[ae])?S.align[ae]="right":/^ *:-+: *$/.test(S.align[ae])?S.align[ae]="center":/^ *:-+ *$/.test(S.align[ae])?S.align[ae]="left":S.align[ae]=null;for(A=S.cells.length,ae=0;ae<A;ae++)S.cells[ae]=Q(S.cells[ae],S.header.length);return S}}},B.hr=function(b){var x=this.rules.block.hr.exec(b);if(x)return{type:"hr",raw:x[0]}},B.blockquote=function(b){var x=this.rules.block.blockquote.exec(b);if(x){var S=x[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:x[0],text:S}}},B.list=function(b){var x=this.rules.block.list.exec(b);if(x){for(var S=x[0],A=x[2],ae=A.length>1,ge=A[A.length-1]===")",xe={type:"list",raw:S,ordered:ae,start:ae?+A.slice(0,-1):"",loose:!1,items:[]},Ct=x[0].match(this.rules.block.item),At=!1,Ee,it,pt,Ge,Dt,Tt,Ft,Pt=Ct.length,ut=0;ut<Pt;ut++)Ee=Ct[ut],S=Ee,it=Ee.length,Ee=Ee.replace(/^ *([*+-]|\d+[.)]) */,""),~Ee.indexOf(`
`)&&(it-=Ee.length,Ee=this.options.pedantic?Ee.replace(/^ {1,4}/gm,""):Ee.replace(new RegExp("^ {1,"+it+"}","gm"),"")),ut!==Pt-1&&(pt=this.rules.block.bullet.exec(Ct[ut+1])[0],(ae?pt.length===1||!ge&&pt[pt.length-1]===")":pt.length>1||this.options.smartLists&&pt!==A)&&(Ge=Ct.slice(ut+1).join(`
`),xe.raw=xe.raw.substring(0,xe.raw.length-Ge.length),ut=Pt-1)),Dt=At||/\n\n(?!\s*$)/.test(Ee),ut!==Pt-1&&(At=Ee.charAt(Ee.length-1)===`
`,Dt||(Dt=At)),Dt&&(xe.loose=!0),Tt=/^\[[ xX]\] /.test(Ee),Ft=void 0,Tt&&(Ft=Ee[1]!==" ",Ee=Ee.replace(/^\[[ xX]\] +/,"")),xe.items.push({type:"list_item",raw:S,task:Tt,checked:Ft,loose:Dt,text:Ee});return xe}},B.html=function(b){var x=this.rules.block.html.exec(b);if(x)return{type:this.options.sanitize?"paragraph":"html",raw:x[0],pre:!this.options.sanitizer&&(x[1]==="pre"||x[1]==="script"||x[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(x[0]):Oe(x[0]):x[0]}},B.def=function(b){var x=this.rules.block.def.exec(b);if(x){x[3]&&(x[3]=x[3].substring(1,x[3].length-1));var S=x[1].toLowerCase().replace(/\s+/g," ");return{tag:S,raw:x[0],href:x[2],title:x[3]}}},B.table=function(b){var x=this.rules.block.table.exec(b);if(x){var S={type:"table",header:Q(x[1].replace(/^ *| *\| *$/g,"")),align:x[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:x[3]?x[3].replace(/\n$/,"").split(`
`):[]};if(S.header.length===S.align.length){S.raw=x[0];var A=S.align.length,ae;for(ae=0;ae<A;ae++)/^ *-+: *$/.test(S.align[ae])?S.align[ae]="right":/^ *:-+: *$/.test(S.align[ae])?S.align[ae]="center":/^ *:-+ *$/.test(S.align[ae])?S.align[ae]="left":S.align[ae]=null;for(A=S.cells.length,ae=0;ae<A;ae++)S.cells[ae]=Q(S.cells[ae].replace(/^ *\| *| *\| *$/g,""),S.header.length);return S}}},B.lheading=function(b){var x=this.rules.block.lheading.exec(b);if(x)return{type:"heading",raw:x[0],depth:x[2].charAt(0)==="="?1:2,text:x[1]}},B.paragraph=function(b){var x=this.rules.block.paragraph.exec(b);if(x)return{type:"paragraph",raw:x[0],text:x[1].charAt(x[1].length-1)===`
`?x[1].slice(0,-1):x[1]}},B.text=function(b,x){var S=this.rules.block.text.exec(b);if(S){var A=x[x.length-1];return A&&A.type==="text"?{raw:S[0],text:S[0]}:{type:"text",raw:S[0],text:S[0]}}},B.escape=function(b){var x=this.rules.inline.escape.exec(b);if(x)return{type:"escape",raw:x[0],text:Oe(x[1])}},B.tag=function(b,x,S){var A=this.rules.inline.tag.exec(b);if(A)return!x&&/^<a /i.test(A[0])?x=!0:x&&/^<\/a>/i.test(A[0])&&(x=!1),!S&&/^<(pre|code|kbd|script)(\s|>)/i.test(A[0])?S=!0:S&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(A[0])&&(S=!1),{type:this.options.sanitize?"text":"html",raw:A[0],inLink:x,inRawBlock:S,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(A[0]):Oe(A[0]):A[0]}},B.link=function(b){var x=this.rules.inline.link.exec(b);if(x){var S=Ce(x[2],"()");if(S>-1){var A=x[0].indexOf("!")===0?5:4,ae=A+x[1].length+S;x[2]=x[2].substring(0,S),x[0]=x[0].substring(0,ae).trim(),x[3]=""}var ge=x[2],xe="";if(this.options.pedantic){var Ct=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ge);Ct?(ge=Ct[1],xe=Ct[3]):xe=""}else xe=x[3]?x[3].slice(1,-1):"";ge=ge.trim().replace(/^<([\s\S]*)>$/,"$1");var At=Ve(x,{href:ge&&ge.replace(this.rules.inline._escapes,"$1"),title:xe&&xe.replace(this.rules.inline._escapes,"$1")},x[0]);return At}},B.reflink=function(b,x){var S;if((S=this.rules.inline.reflink.exec(b))||(S=this.rules.inline.nolink.exec(b))){var A=(S[2]||S[1]).replace(/\s+/g," ");if(A=x[A.toLowerCase()],!A||!A.href){var ae=S[0].charAt(0);return{type:"text",raw:ae,text:ae}}var ge=Ve(S,A,S[0]);return ge}},B.strong=function(b,x,S){S===void 0&&(S="");var A=this.rules.inline.strong.start.exec(b);if(A&&(!A[1]||A[1]&&(S===""||this.rules.inline.punctuation.exec(S)))){x=x.slice(-1*b.length);var ae=A[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ae.lastIndex=0;for(var ge;(A=ae.exec(x))!=null;)if(ge=this.rules.inline.strong.middle.exec(x.slice(0,A.index+3)),ge)return{type:"strong",raw:b.slice(0,ge[0].length),text:b.slice(2,ge[0].length-2)}}},B.em=function(b,x,S){S===void 0&&(S="");var A=this.rules.inline.em.start.exec(b);if(A&&(!A[1]||A[1]&&(S===""||this.rules.inline.punctuation.exec(S)))){x=x.slice(-1*b.length);var ae=A[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ae.lastIndex=0;for(var ge;(A=ae.exec(x))!=null;)if(ge=this.rules.inline.em.middle.exec(x.slice(0,A.index+2)),ge)return{type:"em",raw:b.slice(0,ge[0].length),text:b.slice(1,ge[0].length-1)}}},B.codespan=function(b){var x=this.rules.inline.code.exec(b);if(x){var S=x[2].replace(/\n/g," "),A=/[^ ]/.test(S),ae=S.startsWith(" ")&&S.endsWith(" ");return A&&ae&&(S=S.substring(1,S.length-1)),S=Oe(S,!0),{type:"codespan",raw:x[0],text:S}}},B.br=function(b){var x=this.rules.inline.br.exec(b);if(x)return{type:"br",raw:x[0]}},B.del=function(b){var x=this.rules.inline.del.exec(b);if(x)return{type:"del",raw:x[0],text:x[1]}},B.autolink=function(b,x){var S=this.rules.inline.autolink.exec(b);if(S){var A,ae;return S[2]==="@"?(A=Oe(this.options.mangle?x(S[1]):S[1]),ae="mailto:"+A):(A=Oe(S[1]),ae=A),{type:"link",raw:S[0],text:A,href:ae,tokens:[{type:"text",raw:A,text:A}]}}},B.url=function(b,x){var S;if(S=this.rules.inline.url.exec(b)){var A,ae;if(S[2]==="@")A=Oe(this.options.mangle?x(S[0]):S[0]),ae="mailto:"+A;else{var ge;do ge=S[0],S[0]=this.rules.inline._backpedal.exec(S[0])[0];while(ge!==S[0]);A=Oe(S[0]),S[1]==="www."?ae="http://"+A:ae=A}return{type:"link",raw:S[0],text:A,href:ae,tokens:[{type:"text",raw:A,text:A}]}}},B.inlineText=function(b,x,S){var A=this.rules.inline.text.exec(b);if(A){var ae;return x?ae=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(A[0]):Oe(A[0]):A[0]:ae=Oe(this.options.smartypants?S(A[0]):A[0]),{type:"text",raw:A[0],text:ae}}},D}(),Le=de.noopTest,Se=de.edit,Te=de.merge,te={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:Le,table:Le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};te._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,te._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,te.def=Se(te.def).replace("label",te._label).replace("title",te._title).getRegex(),te.bullet=/(?:[*+-]|\d{1,9}[.)])/,te.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,te.item=Se(te.item,"gm").replace(/bull/g,te.bullet).getRegex(),te.list=Se(te.list).replace(/bull/g,te.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+te.def.source+")").getRegex(),te._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",te._comment=/<!--(?!-?>)[\s\S]*?-->/,te.html=Se(te.html,"i").replace("comment",te._comment).replace("tag",te._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),te.paragraph=Se(te._paragraph).replace("hr",te.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",te._tag).getRegex(),te.blockquote=Se(te.blockquote).replace("paragraph",te.paragraph).getRegex(),te.normal=Te({},te),te.gfm=Te({},te.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*|$)"}),te.gfm.nptable=Se(te.gfm.nptable).replace("hr",te.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",te._tag).getRegex(),te.gfm.table=Se(te.gfm.table).replace("hr",te.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",te._tag).getRegex(),te.pedantic=Te({},te.normal,{html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",te._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:Le,paragraph:Se(te.normal._paragraph).replace("hr",te.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",te.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var w={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,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:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};w._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",w.punctuation=Se(w.punctuation).replace(/punctuation/g,w._punctuation).getRegex(),w._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",w._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",w.em.start=Se(w.em.start).replace(/punctuation/g,w._punctuation).getRegex(),w.em.middle=Se(w.em.middle).replace(/punctuation/g,w._punctuation).replace(/overlapSkip/g,w._overlapSkip).getRegex(),w.em.endAst=Se(w.em.endAst,"g").replace(/punctuation/g,w._punctuation).getRegex(),w.em.endUnd=Se(w.em.endUnd,"g").replace(/punctuation/g,w._punctuation).getRegex(),w.strong.start=Se(w.strong.start).replace(/punctuation/g,w._punctuation).getRegex(),w.strong.middle=Se(w.strong.middle).replace(/punctuation/g,w._punctuation).replace(/blockSkip/g,w._blockSkip).getRegex(),w.strong.endAst=Se(w.strong.endAst,"g").replace(/punctuation/g,w._punctuation).getRegex(),w.strong.endUnd=Se(w.strong.endUnd,"g").replace(/punctuation/g,w._punctuation).getRegex(),w.blockSkip=Se(w._blockSkip,"g").getRegex(),w.overlapSkip=Se(w._overlapSkip,"g").getRegex(),w._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,w._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,w._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])?)+(?![-_])/,w.autolink=Se(w.autolink).replace("scheme",w._scheme).replace("email",w._email).getRegex(),w._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,w.tag=Se(w.tag).replace("comment",te._comment).replace("attribute",w._attribute).getRegex(),w._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,w._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,w._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,w.link=Se(w.link).replace("label",w._label).replace("href",w._href).replace("title",w._title).getRegex(),w.reflink=Se(w.reflink).replace("label",w._label).getRegex(),w.reflinkSearch=Se(w.reflinkSearch,"g").replace("reflink",w.reflink).replace("nolink",w.nolink).getRegex(),w.normal=Te({},w),w.pedantic=Te({},w.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:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",w._label).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w._label).getRegex()}),w.gfm=Te({},w.normal,{escape:Se(w.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),w.gfm.url=Se(w.gfm.url,"i").replace("email",w.gfm._extended_email).getRegex(),w.breaks=Te({},w.gfm,{br:Se(w.br).replace("{2,}","*").getRegex(),text:Se(w.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Ie={block:te,inline:w},dt=P.defaults,kt=Ie.block,Qe=Ie.inline;function Je(D){return D.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 Pe(D){var B="",I,b,x=D.length;for(I=0;I<x;I++)b=D.charCodeAt(I),Math.random()>.5&&(b="x"+b.toString(16)),B+="&#"+b+";";return B}var ze=function(){function D(I){this.tokens=[],this.tokens.links=Object.create(null),this.options=I||dt,this.options.tokenizer=this.options.tokenizer||new _e,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var b={block:kt.normal,inline:Qe.normal};this.options.pedantic?(b.block=kt.pedantic,b.inline=Qe.pedantic):this.options.gfm&&(b.block=kt.gfm,this.options.breaks?b.inline=Qe.breaks:b.inline=Qe.gfm),this.tokenizer.rules=b}D.lex=function(b,x){var S=new D(x);return S.lex(b)};var B=D.prototype;return B.lex=function(b){return b=b.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(b,this.tokens,!0),this.inline(this.tokens),this.tokens},B.blockTokens=function(b,x,S){x===void 0&&(x=[]),S===void 0&&(S=!0),b=b.replace(/^ +$/gm,"");for(var A,ae,ge,xe;b;){if(A=this.tokenizer.space(b)){b=b.substring(A.raw.length),A.type&&x.push(A);continue}if(A=this.tokenizer.code(b,x)){b=b.substring(A.raw.length),A.type?x.push(A):(xe=x[x.length-1],xe.raw+=`
`+A.raw,xe.text+=`
`+A.text);continue}if(A=this.tokenizer.fences(b)){b=b.substring(A.raw.length),x.push(A);continue}if(A=this.tokenizer.heading(b)){b=b.substring(A.raw.length),x.push(A);continue}if(A=this.tokenizer.nptable(b)){b=b.substring(A.raw.length),x.push(A);continue}if(A=this.tokenizer.hr(b)){b=b.substring(A.raw.length),x.push(A);continue}if(A=this.tokenizer.blockquote(b)){b=b.substring(A.raw.length),A.tokens=this.blockTokens(A.text,[],S),x.push(A);continue}if(A=this.tokenizer.list(b)){for(b=b.substring(A.raw.length),ge=A.items.length,ae=0;ae<ge;ae++)A.items[ae].tokens=this.blockTokens(A.items[ae].text,[],!1);x.push(A);continue}if(A=this.tokenizer.html(b)){b=b.substring(A.raw.length),x.push(A);continue}if(S&&(A=this.tokenizer.def(b))){b=b.substring(A.raw.length),this.tokens.links[A.tag]||(this.tokens.links[A.tag]={href:A.href,title:A.title});continue}if(A=this.tokenizer.table(b)){b=b.substring(A.raw.length),x.push(A);continue}if(A=this.tokenizer.lheading(b)){b=b.substring(A.raw.length),x.push(A);continue}if(S&&(A=this.tokenizer.paragraph(b))){b=b.substring(A.raw.length),x.push(A);continue}if(A=this.tokenizer.text(b,x)){b=b.substring(A.raw.length),A.type?x.push(A):(xe=x[x.length-1],xe.raw+=`
`+A.raw,xe.text+=`
`+A.text);continue}if(b){var Ct="Infinite loop on byte: "+b.charCodeAt(0);if(this.options.silent){console.error(Ct);break}else throw new Error(Ct)}}return x},B.inline=function(b){var x,S,A,ae,ge,xe,Ct=b.length;for(x=0;x<Ct;x++){xe=b[x];switch(xe.type){case"paragraph":case"text":case"heading":{xe.tokens=[],this.inlineTokens(xe.text,xe.tokens);break}case"table":{for(xe.tokens={header:[],cells:[]},ae=xe.header.length,S=0;S<ae;S++)xe.tokens.header[S]=[],this.inlineTokens(xe.header[S],xe.tokens.header[S]);for(ae=xe.cells.length,S=0;S<ae;S++)for(ge=xe.cells[S],xe.tokens.cells[S]=[],A=0;A<ge.length;A++)xe.tokens.cells[S][A]=[],this.inlineTokens(ge[A],xe.tokens.cells[S][A]);break}case"blockquote":{this.inline(xe.tokens);break}case"list":{for(ae=xe.items.length,S=0;S<ae;S++)this.inline(xe.items[S].tokens);break}}}return b},B.inlineTokens=function(b,x,S,A,ae){x===void 0&&(x=[]),S===void 0&&(S=!1),A===void 0&&(A=!1),ae===void 0&&(ae="");var ge,xe=b,Ct;if(this.tokens.links){var At=Object.keys(this.tokens.links);if(At.length>0)for(;(Ct=this.tokenizer.rules.inline.reflinkSearch.exec(xe))!=null;)At.includes(Ct[0].slice(Ct[0].lastIndexOf("[")+1,-1))&&(xe=xe.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+xe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ct=this.tokenizer.rules.inline.blockSkip.exec(xe))!=null;)xe=xe.slice(0,Ct.index)+"["+"a".repeat(Ct[0].length-2)+"]"+xe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;b;){if(ge=this.tokenizer.escape(b)){b=b.substring(ge.raw.length),x.push(ge);continue}if(ge=this.tokenizer.tag(b,S,A)){b=b.substring(ge.raw.length),S=ge.inLink,A=ge.inRawBlock,x.push(ge);continue}if(ge=this.tokenizer.link(b)){b=b.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,A)),x.push(ge);continue}if(ge=this.tokenizer.reflink(b,this.tokens.links)){b=b.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,A)),x.push(ge);continue}if(ge=this.tokenizer.strong(b,xe,ae)){b=b.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],S,A),x.push(ge);continue}if(ge=this.tokenizer.em(b,xe,ae)){b=b.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],S,A),x.push(ge);continue}if(ge=this.tokenizer.codespan(b)){b=b.substring(ge.raw.length),x.push(ge);continue}if(ge=this.tokenizer.br(b)){b=b.substring(ge.raw.length),x.push(ge);continue}if(ge=this.tokenizer.del(b)){b=b.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],S,A),x.push(ge);continue}if(ge=this.tokenizer.autolink(b,Pe)){b=b.substring(ge.raw.length),x.push(ge);continue}if(!S&&(ge=this.tokenizer.url(b,Pe))){b=b.substring(ge.raw.length),x.push(ge);continue}if(ge=this.tokenizer.inlineText(b,A,Je)){b=b.substring(ge.raw.length),ae=ge.raw.slice(-1),x.push(ge);continue}if(b){var Ee="Infinite loop on byte: "+b.charCodeAt(0);if(this.options.silent){console.error(Ee);break}else throw new Error(Ee)}}return x},ve(D,null,[{key:"rules",get:function(){return{block:kt,inline:Qe}}}]),D}(),Xe=P.defaults,qe=de.cleanUrl,He=de.escape,Be=function(){function D(I){this.options=I||Xe}var B=D.prototype;return B.code=function(b,x,S){var A=(x||"").match(/\S*/)[0];if(this.options.highlight){var ae=this.options.highlight(b,A);ae!=null&&ae!==b&&(S=!0,b=ae)}return A?'<pre><code class="'+this.options.langPrefix+He(A,!0)+'">'+(S?b:He(b,!0))+`</code></pre>
`:"<pre><code>"+(S?b:He(b,!0))+`</code></pre>
`},B.blockquote=function(b){return`<blockquote>
`+b+`</blockquote>
`},B.html=function(b){return b},B.heading=function(b,x,S,A){return this.options.headerIds?"<h"+x+' id="'+this.options.headerPrefix+A.slug(S)+'">'+b+"</h"+x+`>
`:"<h"+x+">"+b+"</h"+x+`>
`},B.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},B.list=function(b,x,S){var A=x?"ol":"ul",ae=x&&S!==1?' start="'+S+'"':"";return"<"+A+ae+`>
`+b+"</"+A+`>
`},B.listitem=function(b){return"<li>"+b+`</li>
`},B.checkbox=function(b){return"<input "+(b?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},B.paragraph=function(b){return"<p>"+b+`</p>
`},B.table=function(b,x){return x&&(x="<tbody>"+x+"</tbody>"),`<table>
<thead>
`+b+`</thead>
`+x+`</table>
`},B.tablerow=function(b){return`<tr>
`+b+`</tr>
`},B.tablecell=function(b,x){var S=x.header?"th":"td",A=x.align?"<"+S+' align="'+x.align+'">':"<"+S+">";return A+b+"</"+S+`>
`},B.strong=function(b){return"<strong>"+b+"</strong>"},B.em=function(b){return"<em>"+b+"</em>"},B.codespan=function(b){return"<code>"+b+"</code>"},B.br=function(){return this.options.xhtml?"<br/>":"<br>"},B.del=function(b){return"<del>"+b+"</del>"},B.link=function(b,x,S){if(b=qe(this.options.sanitize,this.options.baseUrl,b),b===null)return S;var A='<a href="'+He(b)+'"';return x&&(A+=' title="'+x+'"'),A+=">"+S+"</a>",A},B.image=function(b,x,S){if(b=qe(this.options.sanitize,this.options.baseUrl,b),b===null)return S;var A='<img src="'+b+'" alt="'+S+'"';return x&&(A+=' title="'+x+'"'),A+=this.options.xhtml?"/>":">",A},B.text=function(b){return b},D}(),Fe=function(){function D(){}var B=D.prototype;return B.strong=function(b){return b},B.em=function(b){return b},B.codespan=function(b){return b},B.del=function(b){return b},B.html=function(b){return b},B.text=function(b){return b},B.link=function(b,x,S){return""+S},B.image=function(b,x,S){return""+S},B.br=function(){return""},D}(),Lt=function(){function D(){this.seen={}}var B=D.prototype;return B.slug=function(b){var x=b.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(x)){var S=x;do this.seen[S]++,x=S+"-"+this.seen[S];while(this.seen.hasOwnProperty(x))}return this.seen[x]=0,x},D}(),ht=P.defaults,ot=de.unescape,st=function(){function D(I){this.options=I||ht,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Fe,this.slugger=new Lt}D.parse=function(b,x){var S=new D(x);return S.parse(b)};var B=D.prototype;return B.parse=function(b,x){x===void 0&&(x=!0);var S="",A,ae,ge,xe,Ct,At,Ee,it,pt,Ge,Dt,Tt,Ft,Pt,ut,Wt,Nt,We,gt=b.length;for(A=0;A<gt;A++){Ge=b[A];switch(Ge.type){case"space":continue;case"hr":{S+=this.renderer.hr();continue}case"heading":{S+=this.renderer.heading(this.parseInline(Ge.tokens),Ge.depth,ot(this.parseInline(Ge.tokens,this.textRenderer)),this.slugger);continue}case"code":{S+=this.renderer.code(Ge.text,Ge.lang,Ge.escaped);continue}case"table":{for(it="",Ee="",xe=Ge.header.length,ae=0;ae<xe;ae++)Ee+=this.renderer.tablecell(this.parseInline(Ge.tokens.header[ae]),{header:!0,align:Ge.align[ae]});for(it+=this.renderer.tablerow(Ee),pt="",xe=Ge.cells.length,ae=0;ae<xe;ae++){for(At=Ge.tokens.cells[ae],Ee="",Ct=At.length,ge=0;ge<Ct;ge++)Ee+=this.renderer.tablecell(this.parseInline(At[ge]),{header:!1,align:Ge.align[ge]});pt+=this.renderer.tablerow(Ee)}S+=this.renderer.table(it,pt);continue}case"blockquote":{pt=this.parse(Ge.tokens),S+=this.renderer.blockquote(pt);continue}case"list":{for(Dt=Ge.ordered,Tt=Ge.start,Ft=Ge.loose,xe=Ge.items.length,pt="",ae=0;ae<xe;ae++)ut=Ge.items[ae],Wt=ut.checked,Nt=ut.task,Pt="",ut.task&&(We=this.renderer.checkbox(Wt),Ft?ut.tokens.length>0&&ut.tokens[0].type==="text"?(ut.tokens[0].text=We+" "+ut.tokens[0].text,ut.tokens[0].tokens&&ut.tokens[0].tokens.length>0&&ut.tokens[0].tokens[0].type==="text"&&(ut.tokens[0].tokens[0].text=We+" "+ut.tokens[0].tokens[0].text)):ut.tokens.unshift({type:"text",text:We}):Pt+=We),Pt+=this.parse(ut.tokens,Ft),pt+=this.renderer.listitem(Pt,Nt,Wt);S+=this.renderer.list(pt,Dt,Tt);continue}case"html":{S+=this.renderer.html(Ge.text);continue}case"paragraph":{S+=this.renderer.paragraph(this.parseInline(Ge.tokens));continue}case"text":{for(pt=Ge.tokens?this.parseInline(Ge.tokens):Ge.text;A+1<gt&&b[A+1].type==="text";)Ge=b[++A],pt+=`
`+(Ge.tokens?this.parseInline(Ge.tokens):Ge.text);S+=x?this.renderer.paragraph(pt):pt;continue}default:{var vt='Token with "'+Ge.type+'" type was not found.';if(this.options.silent){console.error(vt);return}else throw new Error(vt)}}}return S},B.parseInline=function(b,x){x=x||this.renderer;var S="",A,ae,ge=b.length;for(A=0;A<ge;A++){ae=b[A];switch(ae.type){case"escape":{S+=x.text(ae.text);break}case"html":{S+=x.html(ae.text);break}case"link":{S+=x.link(ae.href,ae.title,this.parseInline(ae.tokens,x));break}case"image":{S+=x.image(ae.href,ae.title,ae.text);break}case"strong":{S+=x.strong(this.parseInline(ae.tokens,x));break}case"em":{S+=x.em(this.parseInline(ae.tokens,x));break}case"codespan":{S+=x.codespan(ae.text);break}case"br":{S+=x.br();break}case"del":{S+=x.del(this.parseInline(ae.tokens,x));break}case"text":{S+=x.text(ae.text);break}default:{var xe='Token with "'+ae.type+'" type was not found.';if(this.options.silent){console.error(xe);return}else throw new Error(xe)}}}return S},D}(),Et=de.merge,bt=de.checkSanitizeDeprecation,ft=de.escape,we=P.getDefaults,St=P.changeDefaults,lt=P.defaults;function ke(D,B,I){if(typeof D=="undefined"||D===null)throw new Error("marked(): input parameter is undefined or null");if(typeof D!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(D)+", string expected");if(typeof B=="function"&&(I=B,B=null),B=Et({},ke.defaults,B||{}),bt(B),I){var b=B.highlight,x;try{x=ze.lex(D,B)}catch(ge){return I(ge)}var S=function(xe){var Ct;if(!xe)try{Ct=st.parse(x,B)}catch(At){xe=At}return B.highlight=b,xe?I(xe):I(null,Ct)};if(!b||b.length<3)return S();if(delete B.highlight,!x.length)return S();var A=0;ke.walkTokens(x,function(ge){ge.type==="code"&&(A++,setTimeout(function(){b(ge.text,ge.lang,function(xe,Ct){if(xe)return S(xe);Ct!=null&&Ct!==ge.text&&(ge.text=Ct,ge.escaped=!0),A--,A===0&&S()})},0))}),A===0&&S();return}try{var ae=ze.lex(D,B);return B.walkTokens&&ke.walkTokens(ae,B.walkTokens),st.parse(ae,B)}catch(ge){if(ge.message+=`
Please report this to https://github.com/markedjs/marked.`,B.silent)return"<p>An error occurred:</p><pre>"+ft(ge.message+"",!0)+"</pre>";throw ge}}ke.options=ke.setOptions=function(D){return Et(ke.defaults,D),St(ke.defaults),ke},ke.getDefaults=we,ke.defaults=lt,ke.use=function(D){var B=Et({},D);if(D.renderer&&function(){var b=ke.defaults.renderer||new Be,x=function(ae){var ge=b[ae];b[ae]=function(){for(var xe=arguments.length,Ct=new Array(xe),At=0;At<xe;At++)Ct[At]=arguments[At];var Ee=D.renderer[ae].apply(b,Ct);return Ee===!1&&(Ee=ge.apply(b,Ct)),Ee}};for(var S in D.renderer)x(S);B.renderer=b}(),D.tokenizer&&function(){var b=ke.defaults.tokenizer||new _e,x=function(ae){var ge=b[ae];b[ae]=function(){for(var xe=arguments.length,Ct=new Array(xe),At=0;At<xe;At++)Ct[At]=arguments[At];var Ee=D.tokenizer[ae].apply(b,Ct);return Ee===!1&&(Ee=ge.apply(b,Ct)),Ee}};for(var S in D.tokenizer)x(S);B.tokenizer=b}(),D.walkTokens){var I=ke.defaults.walkTokens;B.walkTokens=function(b){D.walkTokens(b),I&&I(b)}}ke.setOptions(B)},ke.walkTokens=function(D,B){for(var I=ue(D),b;!(b=I()).done;){var x=b.value;B(x);switch(x.type){case"table":{for(var S=ue(x.tokens.header),A;!(A=S()).done;){var ae=A.value;ke.walkTokens(ae,B)}for(var ge=ue(x.tokens.cells),xe;!(xe=ge()).done;)for(var Ct=xe.value,At=ue(Ct),Ee;!(Ee=At()).done;){var it=Ee.value;ke.walkTokens(it,B)}break}case"list":{ke.walkTokens(x.items,B);break}default:x.tokens&&ke.walkTokens(x.tokens,B)}}},ke.Parser=st,ke.parser=st.parse,ke.Renderer=Be,ke.TextRenderer=Fe,ke.Lexer=ze,ke.lexer=ze.lex,ke.Tokenizer=_e,ke.Slugger=Lt,ke.parse=ke;var Re=ke;return Re})},ELLl:function(nt,Ye,y){(function(z){z(y("VrN/"))})(function(z){var ve={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Z=z.Pos;z.defineOption("autoCloseBrackets",!1,function(W,V,$){$&&$!=z.Init&&(W.removeKeyMap(ue),W.state.closeBrackets=null),V&&(q(me(V,"pairs")),W.state.closeBrackets=V,W.addKeyMap(ue))});function me(W,V){return V=="pairs"&&typeof W=="string"?W:typeof W=="object"&&W[V]!=null?W[V]:ve[V]}var ue={Backspace:R,Enter:F};function q(W){for(var V=0;V<W.length;V++){var $=W.charAt(V),ie="'"+$+"'";ue[ie]||(ue[ie]=P($))}}q(ve.pairs+"`");function P(W){return function(V){return T(V,W)}}function L(W){var V=W.state.closeBrackets;if(!V||V.override)return V;var $=W.getModeAt(W.getCursor());return $.closeBrackets||V}function R(W){var V=L(W);if(!V||W.getOption("disableInput"))return z.Pass;for(var $=me(V,"pairs"),ie=W.listSelections(),re=0;re<ie.length;re++){if(!ie[re].empty())return z.Pass;var be=ee(W,ie[re].head);if(!be||$.indexOf(be)%2!=0)return z.Pass}for(var re=ie.length-1;re>=0;re--){var je=ie[re].head;W.replaceRange("",Z(je.line,je.ch-1),Z(je.line,je.ch+1),"+delete")}}function F(W){var V=L(W),$=V&&me(V,"explode");if(!$||W.getOption("disableInput"))return z.Pass;for(var ie=W.listSelections(),re=0;re<ie.length;re++){if(!ie[re].empty())return z.Pass;var be=ee(W,ie[re].head);if(!be||$.indexOf(be)%2!=0)return z.Pass}W.operation(function(){var je=W.lineSeparator()||`
`;W.replaceSelection(je+je,null),W.execCommand("goCharLeft"),ie=W.listSelections();for(var fe=0;fe<ie.length;fe++){var le=ie[fe].head.line;W.indentLine(le,null,!0),W.indentLine(le+1,null,!0)}})}function O(W){var V=z.cmpPos(W.anchor,W.head)>0;return{anchor:new Z(W.anchor.line,W.anchor.ch+(V?-1:1)),head:new Z(W.head.line,W.head.ch+(V?1:-1))}}function T(W,V){var $=L(W);if(!$||W.getOption("disableInput"))return z.Pass;var ie=me($,"pairs"),re=ie.indexOf(V);if(re==-1)return z.Pass;for(var be=me($,"closeBefore"),je=me($,"triples"),fe=ie.charAt(re+1)==V,le=W.listSelections(),v=re%2==0,pe,ne=0;ne<le.length;ne++){var ye=le[ne],j=ye.head,E,K=W.getRange(j,Z(j.line,j.ch+1));if(v&&!ye.empty())E="surround";else if((fe||!v)&&K==V)fe&&U(W,j)?E="both":je.indexOf(V)>=0&&W.getRange(j,Z(j.line,j.ch+3))==V+V+V?E="skipThree":E="skip";else if(fe&&j.ch>1&&je.indexOf(V)>=0&&W.getRange(Z(j.line,j.ch-2),j)==V+V){if(j.ch>2&&/\bstring/.test(W.getTokenTypeAt(Z(j.line,j.ch-2))))return z.Pass;E="addFour"}else if(fe){var X=j.ch==0?" ":W.getRange(Z(j.line,j.ch-1),j);if(!z.isWordChar(K)&&X!=V&&!z.isWordChar(X))E="both";else return z.Pass}else if(v&&(K.length===0||/\s/.test(K)||be.indexOf(K)>-1))E="both";else return z.Pass;if(!pe)pe=E;else if(pe!=E)return z.Pass}var C=re%2?ie.charAt(re-1):V,k=re%2?V:ie.charAt(re+1);W.operation(function(){if(pe=="skip")W.execCommand("goCharRight");else if(pe=="skipThree")for(var Y=0;Y<3;Y++)W.execCommand("goCharRight");else if(pe=="surround"){for(var M=W.getSelections(),Y=0;Y<M.length;Y++)M[Y]=C+M[Y]+k;W.replaceSelections(M,"around"),M=W.listSelections().slice();for(var Y=0;Y<M.length;Y++)M[Y]=O(M[Y]);W.setSelections(M)}else pe=="both"?(W.replaceSelection(C+k,null),W.triggerElectric(C+k),W.execCommand("goCharLeft")):pe=="addFour"&&(W.replaceSelection(C+C+C+C,"before"),W.execCommand("goCharRight"))})}function ee(W,V){var $=W.getRange(Z(V.line,V.ch-1),Z(V.line,V.ch+1));return $.length==2?$:null}function U(W,V){var $=W.getTokenAt(Z(V.line,V.ch+1));return/\bstring/.test($.type)&&$.start==V.ch&&(V.ch==0||!/\bstring/.test(W.getTokenTypeAt(V)))}})},FIWC:function(nt,Ye,y){nt.exports={flex_box_center:"flex_box_center___gdHkq",flex_space_between:"flex_space_between___lk_Gv",flex_box_vertical_center:"flex_box_vertical_center___2WNVo",flex_box_center_end:"flex_box_center_end___13O11",flex_box_column:"flex_box_column___kMb8L",wrap:"wrap___1y6rg",crumbs:"crumbs___1vKDo"}},Gytx:function(nt,Ye){nt.exports=function(z,ve,Z,me){var ue=Z?Z.call(me,z,ve):void 0;if(ue!==void 0)return!!ue;if(z===ve)return!0;if(typeof z!="object"||!z||typeof ve!="object"||!ve)return!1;var q=Object.keys(z),P=Object.keys(ve);if(q.length!==P.length)return!1;for(var L=Object.prototype.hasOwnProperty.bind(ve),R=0;R<q.length;R++){var F=q[R];if(!L(F))return!1;var O=z[F],T=ve[F];if(ue=Z?Z.call(me,O,T,F):void 0,ue===!1||ue===void 0&&O!==T)return!1}return!0}},H38U:function(nt,Ye,y){var z=y("f4xo"),ve=y("rcnY"),Z=y("wU8J"),me=y("Iq15"),ue=y("dWSS");function q(L,R){this.typeNumber=L,this.errorCorrectLevel=R,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var P=q.prototype;P.addData=function(L){var R=new z(L);this.dataList.push(R),this.dataCache=null},P.isDark=function(L,R){if(L<0||this.moduleCount<=L||R<0||this.moduleCount<=R)throw new Error(L+","+R);return this.modules[L][R]},P.getModuleCount=function(){return this.moduleCount},P.make=function(){if(this.typeNumber<1){var L=1;for(L=1;L<40;L++){for(var R=ve.getRSBlocks(L,this.errorCorrectLevel),F=new Z,O=0,T=0;T<R.length;T++)O+=R[T].dataCount;for(var T=0;T<this.dataList.length;T++){var ee=this.dataList[T];F.put(ee.mode,4),F.put(ee.getLength(),me.getLengthInBits(ee.mode,L)),ee.write(F)}if(F.getLengthInBits()<=O*8)break}this.typeNumber=L}this.makeImpl(!1,this.getBestMaskPattern())},P.makeImpl=function(L,R){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var F=0;F<this.moduleCount;F++){this.modules[F]=new Array(this.moduleCount);for(var O=0;O<this.moduleCount;O++)this.modules[F][O]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(L,R),this.typeNumber>=7&&this.setupTypeNumber(L),this.dataCache==null&&(this.dataCache=q.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,R)},P.setupPositionProbePattern=function(L,R){for(var F=-1;F<=7;F++){if(L+F<=-1||this.moduleCount<=L+F)continue;for(var O=-1;O<=7;O++){if(R+O<=-1||this.moduleCount<=R+O)continue;0<=F&&F<=6&&(O==0||O==6)||0<=O&&O<=6&&(F==0||F==6)||2<=F&&F<=4&&2<=O&&O<=4?this.modules[L+F][R+O]=!0:this.modules[L+F][R+O]=!1}}},P.getBestMaskPattern=function(){for(var L=0,R=0,F=0;F<8;F++){this.makeImpl(!0,F);var O=me.getLostPoint(this);(F==0||L>O)&&(L=O,R=F)}return R},P.createMovieClip=function(L,R,F){var O=L.createEmptyMovieClip(R,F),T=1;this.make();for(var ee=0;ee<this.modules.length;ee++)for(var U=ee*T,W=0;W<this.modules[ee].length;W++){var V=W*T,$=this.modules[ee][W];$&&(O.beginFill(0,100),O.moveTo(V,U),O.lineTo(V+T,U),O.lineTo(V+T,U+T),O.lineTo(V,U+T),O.endFill())}return O},P.setupTimingPattern=function(){for(var L=8;L<this.moduleCount-8;L++){if(this.modules[L][6]!=null)continue;this.modules[L][6]=L%2==0}for(var R=8;R<this.moduleCount-8;R++){if(this.modules[6][R]!=null)continue;this.modules[6][R]=R%2==0}},P.setupPositionAdjustPattern=function(){for(var L=me.getPatternPosition(this.typeNumber),R=0;R<L.length;R++)for(var F=0;F<L.length;F++){var O=L[R],T=L[F];if(this.modules[O][T]!=null)continue;for(var ee=-2;ee<=2;ee++)for(var U=-2;U<=2;U++)ee==-2||ee==2||U==-2||U==2||ee==0&&U==0?this.modules[O+ee][T+U]=!0:this.modules[O+ee][T+U]=!1}},P.setupTypeNumber=function(L){for(var R=me.getBCHTypeNumber(this.typeNumber),F=0;F<18;F++){var O=!L&&(R>>F&1)==1;this.modules[Math.floor(F/3)][F%3+this.moduleCount-8-3]=O}for(var F=0;F<18;F++){var O=!L&&(R>>F&1)==1;this.modules[F%3+this.moduleCount-8-3][Math.floor(F/3)]=O}},P.setupTypeInfo=function(L,R){for(var F=this.errorCorrectLevel<<3|R,O=me.getBCHTypeInfo(F),T=0;T<15;T++){var ee=!L&&(O>>T&1)==1;T<6?this.modules[T][8]=ee:T<8?this.modules[T+1][8]=ee:this.modules[this.moduleCount-15+T][8]=ee}for(var T=0;T<15;T++){var ee=!L&&(O>>T&1)==1;T<8?this.modules[8][this.moduleCount-T-1]=ee:T<9?this.modules[8][15-T-1+1]=ee:this.modules[8][15-T-1]=ee}this.modules[this.moduleCount-8][8]=!L},P.mapData=function(L,R){for(var F=-1,O=this.moduleCount-1,T=7,ee=0,U=this.moduleCount-1;U>0;U-=2)for(U==6&&U--;;){for(var W=0;W<2;W++)if(this.modules[O][U-W]==null){var V=!1;ee<L.length&&(V=(L[ee]>>>T&1)==1);var $=me.getMask(R,O,U-W);$&&(V=!V),this.modules[O][U-W]=V,T--,T==-1&&(ee++,T=7)}if(O+=F,O<0||this.moduleCount<=O){O-=F,F=-F;break}}},q.PAD0=236,q.PAD1=17,q.createData=function(L,R,F){for(var O=ve.getRSBlocks(L,R),T=new Z,ee=0;ee<F.length;ee++){var U=F[ee];T.put(U.mode,4),T.put(U.getLength(),me.getLengthInBits(U.mode,L)),U.write(T)}for(var W=0,ee=0;ee<O.length;ee++)W+=O[ee].dataCount;if(T.getLengthInBits()>W*8)throw new Error("code length overflow. ("+T.getLengthInBits()+">"+W*8+")");for(T.getLengthInBits()+4<=W*8&&T.put(0,4);T.getLengthInBits()%8!=0;)T.putBit(!1);for(;!(T.getLengthInBits()>=W*8);){if(T.put(q.PAD0,8),T.getLengthInBits()>=W*8)break;T.put(q.PAD1,8)}return q.createBytes(T,O)},q.createBytes=function(L,R){for(var F=0,O=0,T=0,ee=new Array(R.length),U=new Array(R.length),W=0;W<R.length;W++){var V=R[W].dataCount,$=R[W].totalCount-V;O=Math.max(O,V),T=Math.max(T,$),ee[W]=new Array(V);for(var ie=0;ie<ee[W].length;ie++)ee[W][ie]=255&L.buffer[ie+F];F+=V;var re=me.getErrorCorrectPolynomial($),be=new ue(ee[W],re.getLength()-1),je=be.mod(re);U[W]=new Array(re.getLength()-1);for(var ie=0;ie<U[W].length;ie++){var fe=ie+je.getLength()-U[W].length;U[W][ie]=fe>=0?je.get(fe):0}}for(var le=0,ie=0;ie<R.length;ie++)le+=R[ie].totalCount;for(var v=new Array(le),pe=0,ie=0;ie<O;ie++)for(var W=0;W<R.length;W++)ie<ee[W].length&&(v[pe++]=ee[W][ie]);for(var ie=0;ie<T;ie++)for(var W=0;W<R.length;W++)ie<U[W].length&&(v[pe++]=U[W][ie]);return v},nt.exports=q},HmJG:function(nt,Ye,y){},Iq15:function(nt,Ye,y){var z=y("nVVt"),ve=y("dWSS"),Z=y("dQei"),me={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},ue={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,G18:1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,G15_MASK:1<<14|1<<12|1<<10|1<<4|1<<1,getBCHTypeInfo:function(q){for(var P=q<<10;ue.getBCHDigit(P)-ue.getBCHDigit(ue.G15)>=0;)P^=ue.G15<<ue.getBCHDigit(P)-ue.getBCHDigit(ue.G15);return(q<<10|P)^ue.G15_MASK},getBCHTypeNumber:function(q){for(var P=q<<12;ue.getBCHDigit(P)-ue.getBCHDigit(ue.G18)>=0;)P^=ue.G18<<ue.getBCHDigit(P)-ue.getBCHDigit(ue.G18);return q<<12|P},getBCHDigit:function(q){for(var P=0;q!=0;)P++,q>>>=1;return P},getPatternPosition:function(q){return ue.PATTERN_POSITION_TABLE[q-1]},getMask:function(q,P,L){switch(q){case me.PATTERN000:return(P+L)%2==0;case me.PATTERN001:return P%2==0;case me.PATTERN010:return L%3==0;case me.PATTERN011:return(P+L)%3==0;case me.PATTERN100:return(Math.floor(P/2)+Math.floor(L/3))%2==0;case me.PATTERN101:return P*L%2+P*L%3==0;case me.PATTERN110:return(P*L%2+P*L%3)%2==0;case me.PATTERN111:return(P*L%3+(P+L)%2)%2==0;default:throw new Error("bad maskPattern:"+q)}},getErrorCorrectPolynomial:function(q){for(var P=new ve([1],0),L=0;L<q;L++)P=P.multiply(new ve([1,Z.gexp(L)],0));return P},getLengthInBits:function(q,P){if(1<=P&&P<10)switch(q){case z.MODE_NUMBER:return 10;case z.MODE_ALPHA_NUM:return 9;case z.MODE_8BIT_BYTE:return 8;case z.MODE_KANJI:return 8;default:throw new Error("mode:"+q)}else if(P<27)switch(q){case z.MODE_NUMBER:return 12;case z.MODE_ALPHA_NUM:return 11;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 10;default:throw new Error("mode:"+q)}else if(P<41)switch(q){case z.MODE_NUMBER:return 14;case z.MODE_ALPHA_NUM:return 13;case z.MODE_8BIT_BYTE:return 16;case z.MODE_KANJI:return 12;default:throw new Error("mode:"+q)}else throw new Error("type:"+P)},getLostPoint:function(q){for(var P=q.getModuleCount(),L=0,R=0;R<P;R++)for(var F=0;F<P;F++){for(var O=0,T=q.isDark(R,F),ee=-1;ee<=1;ee++){if(R+ee<0||P<=R+ee)continue;for(var U=-1;U<=1;U++){if(F+U<0||P<=F+U)continue;if(ee==0&&U==0)continue;T==q.isDark(R+ee,F+U)&&O++}}O>5&&(L+=3+O-5)}for(var R=0;R<P-1;R++)for(var F=0;F<P-1;F++){var W=0;q.isDark(R,F)&&W++,q.isDark(R+1,F)&&W++,q.isDark(R,F+1)&&W++,q.isDark(R+1,F+1)&&W++,(W==0||W==4)&&(L+=3)}for(var R=0;R<P;R++)for(var F=0;F<P-6;F++)q.isDark(R,F)&&!q.isDark(R,F+1)&&q.isDark(R,F+2)&&q.isDark(R,F+3)&&q.isDark(R,F+4)&&!q.isDark(R,F+5)&&q.isDark(R,F+6)&&(L+=40);for(var F=0;F<P;F++)for(var R=0;R<P-6;R++)q.isDark(R,F)&&!q.isDark(R+1,F)&&q.isDark(R+2,F)&&q.isDark(R+3,F)&&q.isDark(R+4,F)&&!q.isDark(R+5,F)&&q.isDark(R+6,F)&&(L+=40);for(var V=0,F=0;F<P;F++)for(var R=0;R<P;R++)q.isDark(R,F)&&V++;var $=Math.abs(100*V/P/P-50)/5;return L+=$*10,L}};nt.exports=ue},LdHM:function(nt,Ye,y){"use strict";y.d(Ye,"b",function(){return be}),y.d(Ye,"a",function(){return fe});var z=y("1OyB"),ve=y("vuIU"),Z=y("Ji7U"),me=y("LK+K"),ue=y("q1tI"),q=y("rePB"),P=y("Ff2n"),L=y("ODXe"),R=y("4IlW"),F=y("bX4T"),O=y("YrtM"),T=y("TSYQ"),ee=y.n(T),U=y("+nKL"),W=y("8OUc"),V=function(Q,Oe){var Ce=Q.prefixCls,Ve=Q.id,$e=Q.flattenOptions,_e=Q.childrenAsData,Le=Q.values,Se=Q.searchValue,Te=Q.multiple,te=Q.defaultActiveFirstOption,w=Q.height,Ie=Q.itemHeight,dt=Q.notFoundContent,kt=Q.open,Qe=Q.menuItemSelectedIcon,Je=Q.virtual,Pe=Q.onSelect,ze=Q.onToggleOpen,Xe=Q.onActiveValue,qe=Q.onScroll,He=Q.onMouseEnter,Be="".concat(Ce,"-item"),Fe=Object(O.a)(function(){return $e},[kt,$e],function(Re,D){return D[0]&&Re[1]!==D[1]}),Lt=ue.useRef(null),ht=function(D){D.preventDefault()},ot=function(D){Lt.current&&Lt.current.scrollTo({index:D})},st=function(D){for(var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,I=Fe.length,b=0;b<I;b+=1){var x=(D+b*B+I)%I,S=Fe[x],A=S.group,ae=S.data;if(!A&&!ae.disabled)return x}return-1},Et=ue.useState(function(){return st(0)}),bt=Object(L.a)(Et,2),ft=bt[0],we=bt[1],St=function(D){we(D);var B=Fe[D];if(!B){Xe(null,-1);return}Xe(B.data.value,D)};ue.useEffect(function(){St(te!==!1?st(0):-1)},[Fe.length,Se]),ue.useEffect(function(){var Re=setTimeout(function(){if(!Te&&kt&&Le.size===1){var D=Array.from(Le)[0],B=Fe.findIndex(function(I){var b=I.data;return b.value===D});St(B),ot(B)}});return function(){return clearTimeout(Re)}},[kt]);var lt=function(D){D!==void 0&&Pe(D,{selected:!Le.has(D)}),Te||ze(!1)};if(ue.useImperativeHandle(Oe,function(){return{onKeyDown:function(D){var B=D.which;switch(B){case R.a.UP:case R.a.DOWN:{var I=0;if(B===R.a.UP?I=-1:B===R.a.DOWN&&(I=1),I!==0){var b=st(ft+I,I);ot(b),St(b)}break}case R.a.ENTER:{var x=Fe[ft];x&&!x.data.disabled?lt(x.data.value):lt(void 0),kt&&D.preventDefault();break}case R.a.ESC:ze(!1)}},onKeyUp:function(){},scrollTo:function(D){ot(D)}}}),Fe.length===0)return ue.createElement("div",{role:"listbox",id:"".concat(Ve,"_list"),className:"".concat(Be,"-empty"),onMouseDown:ht},dt);function ke(Re){var D=Fe[Re];if(!D)return null;var B=D.data||{},I=B.value,b=B.label,x=B.children,S=Object(F.a)(B,!0),A=_e?x:b;return D?ue.createElement("div",Object.assign({"aria-label":typeof A=="string"?A:null},S,{key:Re,role:"option",id:"".concat(Ve,"_list_").concat(Re),"aria-selected":Le.has(I)}),I):null}return ue.createElement(ue.Fragment,null,ue.createElement("div",{role:"listbox",id:"".concat(Ve,"_list"),style:{height:0,width:0,overflow:"hidden"}},ke(ft-1),ke(ft),ke(ft+1)),ue.createElement(U.a,{itemKey:"key",ref:Lt,data:Fe,height:w,itemHeight:Ie,fullHeight:!1,onMouseDown:ht,onScroll:qe,virtual:Je,onMouseEnter:He},function(Re,D){var B,I=Re.group,b=Re.groupOption,x=Re.data,S=x.label,A=x.key;if(I)return ue.createElement("div",{className:ee()(Be,"".concat(Be,"-group"))},S!==void 0?S:A);var ae=x.disabled,ge=x.value,xe=x.title,Ct=x.children,At=x.style,Ee=x.className,it=Object(P.a)(x,["disabled","value","title","children","style","className"]),pt=Le.has(ge),Ge="".concat(Be,"-option"),Dt=ee()(Be,Ge,Ee,(B={},Object(q.a)(B,"".concat(Ge,"-grouped"),b),Object(q.a)(B,"".concat(Ge,"-active"),ft===D&&!ae),Object(q.a)(B,"".concat(Ge,"-disabled"),ae),Object(q.a)(B,"".concat(Ge,"-selected"),pt),B)),Tt=_e?Ct:S,Ft=!Qe||typeof Qe=="function"||pt;return ue.createElement("div",Object.assign({},it,{"aria-selected":pt,className:Dt,title:xe,onMouseMove:function(){if(ft===D||ae)return;St(D)},onClick:function(){ae||lt(ge)},style:At}),ue.createElement("div",{className:"".concat(Ge,"-content")},Tt||ge),ue.isValidElement(Qe)||pt,Ft&&ue.createElement(W.a,{className:"".concat(Be,"-option-state"),customizeIcon:Qe,customizeIconProps:{isSelected:pt}},pt?"\u2713":null))}))},$=ue.forwardRef(V);$.displayName="OptionList";var ie=$,re=function(){return null};re.isSelectOption=!0;var be=re,je=function(){return null};je.isSelectOptGroup=!0;var fe=je,le=y("VTBJ"),v=y("Zm9Q");function pe(m){var Q=m.key,Oe=m.props,Ce=Oe.children,Ve=Oe.value,$e=Object(P.a)(Oe,["children","value"]);return Object(le.a)({key:Q,value:Ve!==void 0?Ve:Q,children:Ce},$e)}function ne(m){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(v.a)(m).map(function(Oe,Ce){if(!ue.isValidElement(Oe)||!Oe.type)return null;var Ve=Oe.type.isSelectOptGroup,$e=Oe.key,_e=Oe.props,Le=_e.children,Se=Object(P.a)(_e,["children"]);return Q||!Ve?pe(Oe):Object(le.a)(Object(le.a)({key:"__RC_SELECT_GRP__".concat($e===null?Ce:$e,"__"),label:$e},Se),{},{options:ne(Le)})}).filter(function(Oe){return Oe})}var ye=y("2Qr1"),j=y("qNPg"),E=y("U8pU"),K=y("Kwbf"),X=y("WKfj");function C(m){var Q=m.mode,Oe=m.options,Ce=m.children,Ve=m.backfill,$e=m.allowClear,_e=m.placeholder,Le=m.getInputElement,Se=m.showSearch,Te=m.onSearch,te=m.defaultOpen,w=m.autoFocus,Ie=m.labelInValue,dt=m.value,kt=m.inputValue,Qe=m.optionLabelProp,Je=Q==="multiple"||Q==="tags",Pe=Se!==void 0?Se:Je||Q==="combobox",ze=Oe||ne(Ce);if(Object(K.a)(Q!=="tags"||ze.every(function(Be){return!Be.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Q==="tags"||Q==="combobox"){var Xe=ze.some(function(Be){return Be.options?Be.options.some(function(Fe){return typeof("value"in Fe?Fe.value:Fe.key)=="number"}):typeof("value"in Be?Be.value:Be.key)=="number"});Object(K.a)(!Xe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(K.a)(Q!=="combobox"||!Qe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(K.a)(Q==="combobox"||!Ve,"`backfill` only works with `combobox` mode."),Object(K.a)(Q==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(K.b)(Q!=="combobox"||!Le||!$e||!_e,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Te&&!Pe&&Q!=="combobox"&&Q!=="tags"&&Object(K.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(K.b)(!te||w,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),dt!=null){var qe=Object(X.d)(dt);Object(K.a)(!Ie||qe.every(function(Be){return Object(E.a)(Be)==="object"&&("key"in Be||"value"in Be)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(K.a)(!Je||Array.isArray(dt),"`value` should be array when `mode` is `multiple` or `tags`")}if(Ce){var He=null;Object(v.a)(Ce).some(function(Be){if(!ue.isValidElement(Be)||!Be.type)return!1;var Fe=Be.type;if(Fe.isSelectOption)return!1;if(Fe.isSelectOptGroup){var Lt=Object(v.a)(Be.props.children).every(function(ht){return!ue.isValidElement(ht)||!Be.type||ht.type.isSelectOption?!0:(He=ht.type,!1)});return!Lt}return He=Fe,!0}),He&&Object(K.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(He.displayName||He.name||He,"`.")),Object(K.a)(kt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var k=C,Y=Object(j.a)({prefixCls:"rc-select",components:{optionList:ie},convertChildrenToData:ne,flattenOptions:ye.d,getLabeledValue:ye.e,filterOptions:ye.b,isValueDisabled:ye.g,findValueOption:ye.c,warningProps:k,fillOptionsWithMissingValue:ye.a}),M=function(m){Object(Z.a)(Oe,m);var Q=Object(me.a)(Oe);function Oe(){var Ce;return Object(z.a)(this,Oe),Ce=Q.apply(this,arguments),Ce.selectRef=ue.createRef(),Ce.focus=function(){Ce.selectRef.current.focus()},Ce.blur=function(){Ce.selectRef.current.blur()},Ce}return Object(ve.a)(Oe,[{key:"render",value:function(){return ue.createElement(Y,Object.assign({ref:this.selectRef},this.props))}}]),Oe}(ue.Component);M.Option=be,M.OptGroup=fe;var de=M,_=Ye.c=de},M8RZ:function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return R});var z=y("fWQN"),ve=y("mtLc"),Z=y("yKVA"),me=y("879j"),ue=y("q1tI"),q=y.n(ue),P=y("i8i4"),L=y.n(P),R=function(F){Object(Z.a)(T,F);var O=Object(me.a)(T);function T(ee){var U;Object(z.a)(this,T),U=O.call(this,ee);var W=window.document;return U.node=W.createElement("div"),W.body.appendChild(U.node),U}return Object(ve.a)(T,[{key:"render",value:function(){var U=this.props.children;return Object(P.createPortal)(U,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),T}(q.a.Component)},O2Wb:function(nt,Ye,y){nt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(nt,Ye,y){"use strict";var z=y("U8pU"),ve=y("VTBJ"),Z=y("Ff2n"),me=y("q1tI"),ue=y("uciX"),q=y("7ixt"),P=function(ee){var U=ee.overlay,W=ee.prefixCls,V=ee.id,$=ee.overlayInnerStyle;return me.createElement("div",{className:"".concat(W,"-inner"),id:V,role:"tooltip",style:$},typeof U=="function"?U():U)},L=P,R=function(ee,U){var W=ee.overlayClassName,V=ee.trigger,$=V===void 0?["hover"]:V,ie=ee.mouseEnterDelay,re=ie===void 0?0:ie,be=ee.mouseLeaveDelay,je=be===void 0?.1:be,fe=ee.overlayStyle,le=ee.prefixCls,v=le===void 0?"rc-tooltip":le,pe=ee.children,ne=ee.onVisibleChange,ye=ee.afterVisibleChange,j=ee.transitionName,E=ee.animation,K=ee.placement,X=K===void 0?"right":K,C=ee.align,k=C===void 0?{}:C,Y=ee.destroyTooltipOnHide,M=Y===void 0?!1:Y,de=ee.defaultVisible,_=ee.getTooltipContainer,m=ee.overlayInnerStyle,Q=Object(Z.a)(ee,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Oe=Object(me.useRef)(null);Object(me.useImperativeHandle)(U,function(){return Oe.current});var Ce=Object(ve.a)({},Q);"visible"in ee&&(Ce.popupVisible=ee.visible);var Ve=function(){var Te=ee.arrowContent,te=Te===void 0?null:Te,w=ee.overlay,Ie=ee.id;return[me.createElement("div",{className:"".concat(v,"-arrow"),key:"arrow"},te),me.createElement(L,{key:"content",prefixCls:v,id:Ie,overlay:w,overlayInnerStyle:m})]},$e=!1,_e=!1;if(typeof M=="boolean")$e=M;else if(M&&Object(z.a)(M)==="object"){var Le=M.keepParent;$e=Le===!0,_e=Le===!1}return me.createElement(ue.a,Object.assign({popupClassName:W,prefixCls:v,popup:Ve,action:$,builtinPlacements:q.a,popupPlacement:X,ref:Oe,popupAlign:k,getPopupContainer:_,onPopupVisibleChange:ne,afterPopupVisibleChange:ye,popupTransitionName:j,popupAnimation:E,defaultPopupVisible:de,destroyPopupOnHide:$e,autoDestroy:_e,mouseLeaveDelay:je,popupStyle:fe,mouseEnterDelay:re},Ce),pe)},F=Object(me.forwardRef)(R),O=Ye.a=F},Ot1p:function(nt,Ye,y){"use strict";var z=y("2qtc"),ve=y("kLXV"),Z=y("rAM+"),me=y("miYZ"),ue=y("tsqr"),q=y("9og8"),P=y("tJVT"),L=y("jrin"),R=y("WmNS"),F=y.n(R),O=y("q1tI"),T=y.n(O),ee=y("VrN/"),U=y.n(ee),W=y("bdgK"),V=y("p77/"),$=y("Bd2K"),ie=y("ELLl"),re=y("19Vz"),be=y("lZu9"),je=y("+NIl"),fe=y("kSUc"),le=y("9Bee"),v=function(Ee){var it=Ee.value,pt=it===void 0?"":it,Ge=Ee.className,Dt=Ee.showTextOnly,Tt=Ee.showLines,Ft=Ee.style,Pt=Ft===void 0?{}:Ft,ut=Object(O.useMemo)(function(){return""},[pt]);return T.a.createElement(T.a.Fragment,null,T.a.createElement("div",{dangerouslySetInnerHTML:{__html:ut}}))},pe=y("Q9mQ"),ne=y("diRs"),ye=y("0Owb"),j=y("dejd"),E=y("C+DQ"),K=y("D1Df"),X=y.n(K),C=y("1vsH"),k=y("m3rI"),Y=[{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 M(Ee){var it=Ee.onActionCallback,pt=Ee.title,Ge=Ee.icon,Dt=Ee.actionName,Tt=Ee.className,Ft=Tt===void 0?"":Tt,Pt=Ee.children;function ut(){it(Dt)}return T.a.createElement("a",{title:pt,className:Ft,onClick:ut},T.a.createElement("i",{className:"md-iconfont ".concat(Ge)}),Pt)}var de=function(Ee){var it=Ee.watch,pt=Ee.showNullButton,Ge=Ee.onActionCallback,Dt=Ee.fullScreen,Tt=Ee.insertTemp,Ft=Ee.hidetoolBar,Pt=Ee.uuid,ut=Ee.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(C.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(C.E)("_educoder_session"),"&key=").concat(Pt,"&api=").concat(encodeURIComponent(k.a.PROXY_SERVER)));var Wt=[].concat(Y,[{title:"".concat(it?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(it?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return T.a.createElement("ul",{className:"markdown-toolbar-container"},!Ft&&Wt.map(function(Nt,We){return T.a.createElement("li",{key:We},Nt.actionName?T.a.createElement(M,Object(ye.a)({},Nt,{onActionCallback:Ge})):T.a.createElement("span",{className:"v-line"}))}),pt?T.a.createElement("li",null,T.a.createElement(M,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ge},T.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Tt&&T.a.createElement("li",null,T.a.createElement(M,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Tt),onActionCallback:Ge},T.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),T.a.createElement("li",null,T.a.createElement(ne.a,{title:"\u6253\u5F00\u624B\u673A\u626B\u4E00\u626B",content:T.a.createElement("div",null,T.a.createElement(X.a,{size:150,fgColor:"#000",value:"https://test2.educoder.net/upload.html?_educoder_session_login=".concat(Object(C.E)("_educoder_session_login"),"&_educoder_session=").concat(Object(C.E)("_educoder_session"),"&key=").concat(Pt,"&api=").concat(encodeURIComponent(k.a.PROXY_SERVER))}))},T.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return ut(!0)}},"\u624B\u673A\u4E0A\u4F20\u6587\u4EF6"))),T.a.createElement("li",{className:"btn-full-screen"},T.a.createElement(M,{icon:"".concat(Dt?"icon-shrink":"icon-enlarge"),title:Dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ge})))},_=y("M8RZ"),m=y("+L6B"),Q=y("2/Rp"),Oe=y("y8nQ"),Ce=y("Vl3Y"),Ve=y("5NDa"),$e=y("5rEg"),_e={labelCol:{span:4},wrapperCol:{span:20}},Le=function(Ee){var it=Ee.callback,pt=Ee.onCancel;function Ge(Dt){it(Dt)}return T.a.createElement(Ce.a,Object(ye.a)({},_e,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ge}),T.a.createElement(Ce.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},T.a.createElement($e.a,null)),T.a.createElement(Ce.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},T.a.createElement($e.a,null)),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(Q.a,{type:"ghost",onClick:pt},"\u53D6\u6D88")))},Se=y("7ahc"),Te=y("k1fw"),te=y("HmJG"),w=y("BjJ7"),Ie=Ce.a.useForm,dt={width:280,marginRight:10},kt={labelCol:{span:5},wrapperCol:{span:19}},Qe=function(Ee){var it=Ee.callback,pt=Ee.onCancel,Ge=Ie(),Dt=Object(P.a)(Ge,1),Tt=Dt[0],Ft=Object(O.useRef)();function Pt(Nt){it(Object(Te.a)(Object(Te.a)({},Nt),{},{name:Ft.current}))}function ut(Nt,We){Tt.setFieldsValue({src:"/api/attachments/".concat(Nt.id,"?type=").concat(Nt.content_type),type:We.type})}function Wt(Nt){var We=Nt.target.files[0];Ft.current=We.name,Pe(We,ut)}return T.a.createElement(Ce.a,Object(ye.a)({form:Tt},kt,{className:"upload-image-panel",onFinish:Pt}),T.a.createElement(Ce.a.Item,{label:"\u6587\u4EF6\u5730\u5740",required:!0},T.a.createElement("div",{className:"flex-container"},T.a.createElement(Ce.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6587\u4EF6\u5730\u5740"}]},T.a.createElement($e.a,{style:dt})),T.a.createElement(Je,{onFileChange:Wt}))),T.a.createElement(Ce.a.Item,{label:"\u6587\u4EF6\u63CF\u8FF0",name:"alt"},T.a.createElement($e.a,{style:{width:264}})),T.a.createElement(Ce.a.Item,{style:{textAlign:"right"}},T.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(Q.a,{type:"ghost",onClick:pt},"\u53D6\u6D88")))};function Je(Ee){var it=Ee.onFileChange;return T.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",T.a.createElement("input",{type:"file",onChange:it}))}function Pe(Ee,it){if(!Ee)throw new String("\u6CA1\u6709\u6587\u4EF6");var pt=new FormData;pt.append("editormd-image-file",Ee),pt.append("file_param_name","editormd-image-file"),pt.append("byxhr","true");var Ge=new window.XMLHttpRequest;Ge.withCredentials=!0,Ge.addEventListener("load",function(Dt){it(JSON.parse(Dt.target.responseText),Ee)},!1),Ge.addEventListener("error",function(Dt){console.error(Dt)},!1),Ge.open("POST","".concat(w.a,"/api/attachments.json")),Ge.send(pt)}var ze=y("giR+"),Xe=y("fyUT"),qe=y("7Kak"),He=y("9yH6"),Be=He.a.Group,Fe={margin:"0 8px"},Lt=function(Ee){var it=Ee.callback,pt=Ee.onCancel;function Ge(Dt){it(Dt)}return T.a.createElement(Ce.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ge},T.a.createElement("div",{className:"flex-container"},T.a.createElement("span",{style:Fe},"\u5355\u5143\u683C\u6570\uFF1A"),T.a.createElement("span",{style:Fe},"\u884C\u6570"),T.a.createElement(Ce.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},T.a.createElement(Xe.a,null)),T.a.createElement("span",{style:Fe},"\u5217\u6570"),T.a.createElement(Ce.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},T.a.createElement(Xe.a,null))),T.a.createElement("div",{className:"flex-container",style:{marginTop:12}},T.a.createElement("span",{style:Fe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),T.a.createElement(Ce.a.Item,{name:"align"},T.a.createElement(Be,null,T.a.createElement(He.a,{value:"default"},T.a.createElement("i",{className:"fa fa-align-justify"})),T.a.createElement(He.a,{value:"left"},T.a.createElement("i",{className:"fa fa-align-left"})),T.a.createElement(He.a,{value:"center"},T.a.createElement("i",{className:"fa fa-align-center"})),T.a.createElement(He.a,{value:"right"},T.a.createElement("i",{className:"fa fa-align-right"}))))),T.a.createElement("div",{className:"flex-container flex-end"},T.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),T.a.createElement(Q.a,{type:"ghost",onClick:pt},"\u53D6\u6D88")))},ht=y("ErOA"),ot=y("7Cbv"),st="link",Et="upload-image",bt="code-block",ft="add-table",we="------------",St={default:we,left:":".concat(we),center:":".concat(we,":"),right:"".concat(we,":")},lt=y("9VGf"),ke,Re;function D(){}var B=0,I=1e4,b="\u2581",x=`
**\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 S(Ee){return/^\d+$/.test(Ee)?"".concat(Ee,"px"):Ee}var A=navigator.platform.toUpperCase().indexOf("MAC")>=0,ae=A?"Cmd":"Ctrl",ge=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],xe=(ke={},Object(L.a)(ke,ae+"-B","bold"),Object(L.a)(ke,ae+"-I","italic"),ke),Ct=(Re={},Object(L.a)(Re,st,"\u6DFB\u52A0\u94FE\u63A5"),Object(L.a)(Re,bt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(L.a)(Re,Et,"\u6DFB\u52A0\u6587\u4EF6"),Object(L.a)(Re,ft,"\u6DFB\u52A0\u8868\u683C"),Re),At=Ye.a=function(Ee){var it=Ee.defaultValue,pt=it===void 0?"":it,Ge=Ee.onChange,Dt=Ee.width,Tt=Dt===void 0?"100%":Dt,Ft=Ee.height,Pt=Ft===void 0?400:Ft,ut=Ee.miniToolbar,Wt=ut===void 0?!1:ut,Nt=Ee.isFocus,We=Nt===void 0?!1:Nt,gt=Ee.watch,vt=Ee.insertTemp,_t=Ee.mode,Xt=_t===void 0?"markdown":_t,Gt=Ee.id,Zt=Gt===void 0?"markdown-editor-id":Gt,Ht=Ee.showResizeBar,yt=Ht===void 0?!1:Ht,Yt=Ee.noStorage,Mt=Yt===void 0?!1:Yt,qt=Ee.showNullButton,It=qt===void 0?!1:qt,bn=Ee.hidetoolBar,oi=bn===void 0?!1:bn,li=Ee.fullScreen,De=li===void 0?!1:li,Ze=Ee.onBlur,on=Ee.onCMBeforeChange,hn=Ee.onFullScreen,gn=Ee.className,En=gn===void 0?"":gn,h=Ee.disablePaste,o=h===void 0?!1:h,a=Ee.placeholder,u=a===void 0?"":a,p=Ee.values,c=p===void 0?"":p,G=Object(O.useState)(null),Ne=Object(P.a)(G,2),he=Ne[0],wt=Ne[1],se=Object(O.useState)(pt),J=Object(P.a)(se,2),Me=J[0],rt=J[1],ct=Object(O.useState)(gt),at=Object(P.a)(ct,2),Ot=at[0],en=at[1],mn=Object(O.useState)(De),ln=Object(P.a)(mn,2),tn=ln[0],wn=ln[1],Sn=Object(O.useState)(""),Pn=Object(P.a)(Sn,2),Yn=Pn[0],vn=Pn[1],Dn=Object(O.useState)(0),pi=Object(P.a)(Dn,2),Fn=pi[0],ti=pi[1],Ni=Object(O.useState)(Pt),Ii=Object(P.a)(Ni,2),ji=Ii[0],kn=Ii[1],nn=Object(O.useState)(!1),Wn=Object(P.a)(nn,2),rn=Wn[0],zn=Wn[1],fn=Object(O.useRef)(Object(ot.a)()),_i=Object(O.useRef)(!1),On=Object(O.useRef)(),Ln=Object(O.useRef)(),mi=Object(O.useRef)(),wi=Object(O.useRef)(),Si=Object(O.useRef)(),Ur=function(){var Rt=Object(q.a)(F.a.mark(function zt(){var Bt,Kt;return F.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return sn.next=2,Object(ht.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:fn.current}});case 2:Kt=sn.sent,Kt!=null&&(Bt=Kt.attachments)!==null&&Bt!==void 0&&Bt.length&&(console.log("cm:",he,Ln),Kt.attachments.map(function(Jt){Jt.content_type.indexOf("image")>-1?he.replaceSelection("![,](/api/attachments/".concat(Jt.id,"?type=").concat(Jt.content_type,")")):Jt.content_type.indexOf("video")>-1?he.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Jt.content_type.indexOf("pdf")>-1?he.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(Jt.id,"?type=").concat(Jt.content_type,'&disposition=inline" target="_blank">').concat(Jt.name,"</a>")):he.replaceSelection("[".concat(Jt.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(Jt.id,"?type=").concat(Jt.content_type,")"))}));case 4:case"end":return sn.stop()}},zt)}));return function(){return Rt.apply(this,arguments)}}();Object(O.useEffect)(function(){rt(c),he==null||he.setValue(c)},[c]),Object(O.useEffect)(function(){hn==null||hn(tn)},[tn]),Object(O.useEffect)(function(){if(Ln.current){var Rt=U.a.fromTextArea(Ln.current,{mode:Xt,lineNumbers:!Wt,lineWrapping:!0,value:pt,autoCloseTags:!0,autoCloseBrackets:!0});We&&Rt.focus();function zt(Bt,Kt){if(o){Kt.preventDefault();return}var Qt=Kt.clipboardData;if(Qt){var sn=Qt.types.toString(),Jt=Qt.items;if(sn==="Files"||Qt.types.indexOf("Files")>-1){if(Kt.preventDefault(),Xt=="stex")return;try{var Cn,Nn=Jt[1];((Cn=Jt[0])===null||Cn===void 0?void 0:Cn.kind)==="file"&&(Nn=Jt[0]);var $t=Nn.getAsFile(),Bi=$t.name.split(".").pop();Pe($t,function(un){if(un.id){var Hn,dn,ui;($t==null||((Hn=$t.type)===null||Hn===void 0)?void 0:Hn.indexOf("image"))>-1?Rt.replaceSelection("![,](/api/attachments/".concat(un.id,"?type=").concat(un.content_type,")")):($t==null||((dn=$t.type)===null||dn===void 0)?void 0:dn.indexOf("video"))>-1?Rt.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(un.id,'"></video>')):($t==null||((ui=$t.type)===null||ui===void 0)?void 0:ui.indexOf("pdf"))>-1?Rt.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat($t.type,'&disposition=inline" target="_blank">').concat($t.name,"</a>")):ge.includes(Bi)?Rt.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(un.id,'?type=office&disposition=inline" target="_blank">').concat($t.name,"</a>")):Rt.replaceSelection("[".concat($t.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,")"))}else(un==null?void 0:un.status)===401&&(document.location.href="/user/login")})}catch(un){ue.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Rt.on("paste",zt),Rt.on("dragleave",function(Bt,Kt){mi.current.classList.remove("mouse-hover-md")}),Rt.on("dragover",function(Bt,Kt){mi.current.classList.add("mouse-hover-md")}),Rt.on("drop",function(Bt,Kt){mi.current.classList.add("mouse-hover-md");var Qt;if(Qt=Kt.dataTransfer.files,Qt.length>0){Kt.preventDefault(),Kt.stopPropagation();for(var sn=function(Nn){var $t=Qt[Nn],Bi=$t.name.split(".").pop();Pe($t,function(un){if(un.id){var Hn,dn,ui;($t==null||((Hn=$t.type)===null||Hn===void 0)?void 0:Hn.indexOf("image"))>-1?Rt.replaceSelection("![,](/api/attachments/".concat(un.id,"?type=").concat(un.content_type,")")):($t==null||((dn=$t.type)===null||dn===void 0)?void 0:dn.indexOf("video"))>-1?Rt.replaceSelection('<video width="100%" controls src="'.concat(k.a.API_SERVER,"/api/attachments/").concat(un.id,'"></video>')):($t==null||((ui=$t.type)===null||ui===void 0)?void 0:ui.indexOf("pdf"))>-1?Rt.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat($t.type,'&disposition=inline" target="_blank">').concat($t.name,"</a>")):ge.includes(Bi)?Rt.replaceSelection('<a href="'.concat(k.a.API_SERVER,"/api/attachments/").concat(un.id,'?type=office&disposition=inline" target="_blank">').concat($t.name,"</a>")):Rt.replaceSelection("[".concat($t.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(un.id,"?type=").concat(un.content_type,")"))}else(un==null?void 0:un.status)===401&&(document.location.href="/user/login")})},Jt=0;Jt<Qt.length;Jt++)sn(Jt)}}),wt(Rt),function(){Rt.off("paste",zt)}}},[]);var ci=Object(O.useCallback)(function(){if(mi.current)try{}catch(Rt){console.log(Rt,"---- to set md editor body height")}},[ji,mi,tn]);Object(O.useEffect)(function(){function Rt(){var Bt=new W.default(function(Kt){var Qt=Object(Z.a)(Kt),sn;try{for(Qt.s();!(sn=Qt.n()).done;){var Jt=sn.value;(Jt.target.offsetHeight>0||Jt.target.offsetWidth>0)&&(ci(),he.setSize("100%","100%"),he.refresh())}}catch(Cn){Qt.e(Cn)}finally{Qt.f()}});return Bt.observe(Ln.current.parentElement),Bt}if(he){var zt=Rt();return function(){zt.unobserve(Ln.current.parentElement)}}},[he,ci]),Object(O.useEffect)(function(){if(he){for(var Rt=[],zt=function(){var Jt=Kt[Bt];Qt=Object(P.a)(Jt,2);var Cn=Qt[0],Nn=Qt[1],$t=Object(L.a)({},Cn,function(){Yi(Nn)});Rt.push($t),he.addKeyMap($t)},Bt=0,Kt=Object.entries(xe);Bt<Kt.length;Bt++){var Qt;zt()}return On.current=setInterval(function(){_i.current&&Ur()},4e3),function(){clearInterval(On.current);var sn=Object(Z.a)(Rt),Jt;try{for(sn.s();!(Jt=sn.n()).done;){var Cn=Jt.value;he.removeKeyMap(Cn)}}catch(Nn){sn.e(Nn)}finally{sn.f()}}}},[he]),Object(O.useEffect)(function(){De!==tn&&wn(De)},[De]),Object(lt.a)(function(){if(!Mt&&Fn>0){var Rt=new Date().getTime(),zt=window.sessionStorage.getItem(Zt);Rt>=Fn+I&&(!zt||zt!==Me)&&(window.sessionStorage.setItem(Zt,Me),zn(!0))}},I),Object(O.useEffect)(function(){en(gt)},[he,gt]),Object(O.useEffect)(function(){he&&(We&&he.focus())},[he,We]),Object(O.useEffect)(function(){if(Ot&&he){var Rt=he.getScrollerElement();function zt(Bt){var Kt=Bt.target;if(Si.current){var Qt=Kt.scrollTop/Kt.scrollHeight;Si.current.scrollTop=Si.current.scrollHeight*Qt}}return Rt.addEventListener("scroll",zt),function(){Rt.removeEventListener("scroll",zt)}}},[he,Ot]),Object(O.useEffect)(function(){if(he&&on){function Rt(zt,Bt){on(zt,Bt)}return he.on("beforeChange",Rt),function(){he.off("beforeChange",Rt)}}},[he,on]),Object(O.useEffect)(function(){if(he&&Ze){function Rt(){Ze(he.getValue())}return he.on("blur",Rt),function(){he.off("blur",Rt)}}},[he,Ze]),Object(O.useEffect)(function(){if(he){function Rt(zt){var Bt=zt.getValue();rt(Bt),ti(new Date().getTime()),zt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ge&&Ge(Bt)}return he.on("change",Rt),function(){he.off("change",Rt)}}},[he,Ge]),Object(O.useEffect)(function(){he&&(pt==null?(he.setValue(""),rt("")):pt!==he.getValue()&&(he.setValue(pt),rt(pt),he.setCursor(he.lineCount(),0)))},[he,pt]);var Yi=Object(O.useCallback)(function(Rt){var zt=he.getCursor(),Bt=he.getSelection(),Kt=Bt.split(`
`);switch(Rt){case"bold":return he.replaceSelection("**"+Bt+"**"),Bt===""&&he.setCursor(zt.line,zt.ch+2),he.focus();case"italic":return he.replaceSelection("*"+Bt+"*"),Bt===""&&he.setCursor(zt.line,zt.ch+1),he.focus();case"code":return he.replaceSelection("`"+Bt+"`"),Bt===""&&he.setCursor(zt.line,zt.ch+1),he.focus();case"inline-latex":return he.replaceSelection("`$$"+Bt+"$$`"),Bt===""&&he.setCursor(zt.line,zt.ch+3),he.focus();case"latex":return he.replaceSelection("```latex\n"+Bt+"\n```"),he.setCursor(zt.line+1,Bt.length+1),he.focus();case"line-break":return he.replaceSelection(`<br/>
`),he.focus();case"list-ul":return Bt===""?he.replaceSelection("- "+Bt):he.replaceSelection(Kt.map(function(Qt){return Qt===""?"":"- ".concat(Qt)}).join(`
`)),he.focus();case"list-ol":return Bt===""?he.replaceSelection("1. "+Bt):he.replaceSelection(Kt.map(function(Qt,sn){return Qt===""?"":"".concat(sn+1,". ").concat(Qt)}).join(`
`)),he.focus();case"add-null-ch":return Bt===""&&he.setCursor(zt.line,zt.ch+1),he.replaceSelection(b),he.focus();case"inster-template-1":return Bt===""&&he.setCursor(zt.line,zt.ch),he.replaceSelection(x),he.focus();case"eraser":return he.setValue(""),he.focus();case"trigger-watch":return en(!Ot),he.focus();case"trigger-full-screen":return wn(!tn),he.focus();case st:vn(st);return;case bt:vn(bt);return;case Et:vn(Et);return;case ft:vn(ft);return;default:throw new Error}},[he,Ot,tn]),ni=Object(O.useCallback)(function(Rt){vn("");switch(Yn){case st:var zt=Rt.title,Bt=Rt.link;return he.replaceSelection("[".concat(zt,"](").concat(Bt,")")),he.focus();case bt:var Kt=Rt.language,Qt=Rt.content;return he.replaceSelection(["```"+Kt,Qt,"```"].join(`
`)),he.focus();case Et:var sn=Rt.src,Jt=Rt.alt,Cn=Rt.name;return sn.indexOf("type=image")>-1?he.replaceSelection("![ ".concat(Jt||""," ]( ").concat(sn,' "').concat(Jt||"",'" )')):sn.indexOf("type=application/pdf")>-1?he.replaceSelection('<a href="'.concat(sn,'&disposition=inline" target="_blank">').concat(Cn,"</a>")):he.replaceSelection('<a href="'.concat(sn,'" target="_blank">').concat(Cn,"</a>")),he.focus();case ft:for(var Nn=Rt.row,$t=Rt.col,Bi=Rt.align,un=`
`,Hn=0;Hn<Nn;Hn++){for(var dn=[],ui=[],pr=0;pr<$t;pr++)Hn===1&&ui.push(St[Bi]),dn.push(" ");Hn===1&&(un+="| ".concat(ui.join(" | "),` |
`)),un+="| ".concat(dn.join($t===1?"":" | "),` |
`)}return he.replaceSelection(un+`
`),he.focus();default:throw new Error}},[he,Yn]),Ji=Object(O.useMemo)(function(){switch(Yn){case st:return T.a.createElement(Le,{callback:ni,onCancel:bi});case bt:return T.a.createElement(Se.b,{callback:ni,onCancel:bi});case Et:return T.a.createElement(Qe,{callback:ni,onCancel:bi});case ft:return T.a.createElement(Lt,{callback:ni,onCancel:bi});default:return null}},[Yn]);function bi(){vn("")}Object(O.useEffect)(function(){if(wi.current){var Rt=wi.current,zt=!1,Bt=0;function Kt(Jt){zt=!0,Bt=Jt.pageY}function Qt(){zt=!1}function sn(Jt){if(zt){var Cn=Jt.pageY-Bt;Cn<0&&(Cn=0),Cn>300&&(Cn=300);var Nn=Pt+Cn+"px";kn(Nn)}}return Rt.addEventListener("mousedown",Kt),document.addEventListener("mousemove",sn),document.addEventListener("mouseup",Qt),function(){Rt.removeEventListener("mousedown",Kt),document.removeEventListener("mousemove",sn),document.removeEventListener("mouseup",Qt)}}},[he,wi]),Object(O.useEffect)(function(){kn(Pt)},[Pt]);var ki=S(Tt),uo=S(ji),co={width:ki,height:uo},qo=Object(O.useMemo)(function(){if(Fn){var Rt=new Date(Fn),zt=Rt.getHours(),Bt=Rt.getMinutes(),Kt=Rt.getSeconds();return zt=zt<10?"0"+zt:zt,Bt=Bt<10?"0"+Bt:Bt,Kt=Kt<10?"0"+Kt:Kt,"".concat(zt,":").concat(Bt,":").concat(Kt)}return 0},[Fn]);function Qo(){window.sessionStorage.removeItem(Zt),zn(!1),ti(0)}function ho(){zn(!1),ti(0),he.setValue(window.sessionStorage.getItem(Zt))}function Fr(Rt,zt){var Bt=he.getValue();Bt=Bt.replace(Rt,zt),rt(Bt),he==null||he.setValue(Bt)}return T.a.createElement(O.Fragment,null,T.a.createElement("div",{className:"markdown-editor-wrapper",ref:mi},T.a.createElement("div",{className:"markdown-editor-container ".concat(En," ").concat(Ot?"on-preview":""," ").concat(Wt?"mini":""," ").concat(tn?"full-screen":""),style:co},T.a.createElement(de,{insertTemp:vt,watch:Ot,fullScreen:tn,showNullButton:It,onActionCallback:Yi,hidetoolBar:oi,uuid:fn.current,setOpenPhones:function(){_i.current=!0}}),T.a.createElement("div",{className:"markdown-editor-body"},T.a.createElement("div",{className:"codemirror-container"},T.a.createElement("textarea",{ref:Ln,placeholder:u})),Ot?T.a.createElement("div",{ref:Si,className:"preview-container"},Xt==="stex"&&T.a.createElement(v,{value:Me}),Xt!=="stex"&&T.a.createElement(le.a,{edit:!0,value:Me,replaces:Fr})):null))),yt?T.a.createElement("a",{ref:wi,className:"editor-resize"}):null,T.a.createElement(_.a,null,Ct[Yn]?T.a.createElement(ve.a,{centered:!0,title:Ct[Yn],visible:!0,onCancel:bi,footer:null},Ji):null))}},PGNT:function(nt,Ye,y){nt.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(nt,Ye,y){nt.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"}},"RZ/O":function(nt,Ye,y){nt.exports=y.p+"static/bi.9c9b0364.svg"},SJMd:function(nt,Ye){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var y,z,ve,Z=!1,me,ue;window.PR_SHOULD_USE_CONTINUATION=!0;var q,P;(function(){var L=window,R=["break,continue,do,else,for,if,return,while"],F=[R,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],O=[F,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],T=[O,"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"],ee=[O,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],U=[O,"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",V=[O,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],$="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",ie=[R,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],re=[R,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],be=[R,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],je=[T,U,ee,V,$,ie,re,be],fe=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,le="str",v="kwd",pe="com",ne="typ",ye="lit",j="pun",E="pln",K="tag",X="dec",C="src",k="atn",Y="atv",M="nocode",de="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function _(Pe){for(var ze=0,Xe=!1,qe=!1,He=0,Be=Pe.length;He<Be;++He){var Fe=Pe[He];if(Fe.ignoreCase)qe=!0;else if(/[a-z]/i.test(Fe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Xe=!0,qe=!1;break}}var Lt={b:8,t:9,n:10,v:11,f:12,r:13};function ht(ft){var we=ft.charCodeAt(0);if(we!==92)return we;var St=ft.charAt(1);return we=Lt[St],we||("0"<=St&&St<="7"?parseInt(ft.substring(1),8):St==="u"||St==="x"?parseInt(ft.substring(2),16):ft.charCodeAt(1))}function ot(ft){if(ft<32)return(ft<16?"\\x0":"\\x")+ft.toString(16);var we=String.fromCharCode(ft);return we==="\\"||we==="-"||we==="]"||we==="^"?"\\"+we:we}function st(ft){var we=ft.substring(1,ft.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")),St=[],lt=we[0]==="^",ke=["["];lt&&ke.push("^");for(var Re=lt?1:0,D=we.length;Re<D;++Re){var B=we[Re];if(/\\[bdsw]/i.test(B))ke.push(B);else{var I=ht(B),b;Re+2<D&&we[Re+1]==="-"?(b=ht(we[Re+2]),Re+=2):b=I,St.push([I,b]),b<65||I>122||(b<65||I>90||St.push([Math.max(65,I)|32,Math.min(b,90)|32]),b<97||I>122||St.push([Math.max(97,I)&~32,Math.min(b,122)&~32]))}}St.sort(function(ae,ge){return ae[0]-ge[0]||ge[1]-ae[1]});for(var x=[],S=[],Re=0;Re<St.length;++Re){var A=St[Re];A[0]<=S[1]+1?S[1]=Math.max(S[1],A[1]):x.push(S=A)}for(var Re=0;Re<x.length;++Re){var A=x[Re];ke.push(ot(A[0])),A[1]>A[0]&&(A[1]+1>A[0]&&ke.push("-"),ke.push(ot(A[1])))}return ke.push("]"),ke.join("")}function Et(ft){for(var we=ft.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")),St=we.length,lt=[],ke=0,Re=0;ke<St;++ke){var D=we[ke];if(D==="(")++Re;else if(D.charAt(0)==="\\"){var B=+D.substring(1);B&&(B<=Re?lt[B]=-1:we[ke]=ot(B))}}for(var ke=1;ke<lt.length;++ke)lt[ke]===-1&&(lt[ke]=++ze);for(var ke=0,Re=0;ke<St;++ke){var D=we[ke];if(D==="(")++Re,lt[Re]||(we[ke]="(?:");else if(D.charAt(0)==="\\"){var B=+D.substring(1);B&&B<=Re&&(we[ke]="\\"+lt[B])}}for(var ke=0;ke<St;++ke)we[ke]==="^"&&we[ke+1]!=="^"&&(we[ke]="");if(ft.ignoreCase&&Xe)for(var ke=0;ke<St;++ke){var D=we[ke],I=D.charAt(0);D.length>=2&&I==="["?we[ke]=st(D):I!=="\\"&&(we[ke]=D.replace(/[a-zA-Z]/g,function(S){var A=S.charCodeAt(0);return"["+String.fromCharCode(A&~32,A|32)+"]"}))}return we.join("")}for(var bt=[],He=0,Be=Pe.length;He<Be;++He){var Fe=Pe[He];if(Fe.global||Fe.multiline)throw new Error(""+Fe);bt.push("(?:"+Et(Fe)+")")}return new RegExp(bt.join("|"),qe?"gi":"g")}function m(Pe,ze){var Xe=/(?:^|\s)nocode(?:\s|$)/,qe=[],He=0,Be=[],Fe=0;function Lt(ht){var ot=ht.nodeType;if(ot==1){if(Xe.test(ht.className))return;for(var st=ht.firstChild;st;st=st.nextSibling)Lt(st);var Et=ht.nodeName.toLowerCase();(Et==="br"||Et==="li")&&(qe[Fe]=`
`,Be[Fe<<1]=He++,Be[Fe++<<1|1]=ht)}else if(ot==3||ot==4){var bt=ht.nodeValue;bt.length&&(ze?bt=bt.replace(/\r\n?/g,`
`):bt=bt.replace(/[ \t\r\n]+/g," "),qe[Fe]=bt,Be[Fe<<1]=He,He+=bt.length,Be[Fe++<<1|1]=ht)}}return Lt(Pe),{sourceCode:qe.join("").replace(/\n$/,""),spans:Be}}function Q(Pe,ze,Xe,qe,He){if(!Xe)return;var Be={sourceNode:Pe,pre:1,langExtension:null,numberLines:null,sourceCode:Xe,spans:null,basePos:ze,decorations:null};qe(Be),He.push.apply(He,Be.decorations)}var Oe=/\S/;function Ce(Pe){for(var ze=void 0,Xe=Pe.firstChild;Xe;Xe=Xe.nextSibling){var qe=Xe.nodeType;ze=qe===1?ze?Pe:Xe:qe===3&&Oe.test(Xe.nodeValue)?Pe:ze}return ze===Pe?void 0:ze}function Ve(Pe,ze){var Xe={},qe;(function(){for(var Fe=Pe.concat(ze),Lt=[],ht={},ot=0,st=Fe.length;ot<st;++ot){var Et=Fe[ot],bt=Et[3];if(bt)for(var ft=bt.length;--ft>=0;)Xe[bt.charAt(ft)]=Et;var we=Et[1],St=""+we;ht.hasOwnProperty(St)||(Lt.push(we),ht[St]=null)}Lt.push(/[\0-\uffff]/),qe=_(Lt)})();var He=ze.length,Be=function(Fe){for(var Lt=Fe.sourceCode,ht=Fe.basePos,ot=Fe.sourceNode,st=[ht,E],Et=0,bt=Lt.match(qe)||[],ft={},we=0,St=bt.length;we<St;++we){var lt=bt[we],ke=ft[lt],Re=void 0,D;if(typeof ke=="string")D=!1;else{var B=Xe[lt.charAt(0)];if(B)Re=lt.match(B[1]),ke=B[0];else{for(var I=0;I<He;++I)if(B=ze[I],Re=lt.match(B[1]),Re){ke=B[0];break}Re||(ke=E)}D=ke.length>=5&&ke.substring(0,5)==="lang-",D&&!(Re&&typeof Re[1]=="string")&&(D=!1,ke=C),D||(ft[lt]=ke)}var b=Et;if(Et+=lt.length,!D)st.push(ht+b,ke);else{var x=Re[1],S=lt.indexOf(x),A=S+x.length;Re[2]&&(A=lt.length-Re[2].length,S=A-x.length);var ae=ke.substring(5);Q(ot,ht+b,lt.substring(0,S),Be,st),Q(ot,ht+b+S,x,w(ae,x),st),Q(ot,ht+b+A,lt.substring(A),Be,st)}}Fe.decorations=st};return Be}function $e(Pe){var ze=[],Xe=[];Pe.tripleQuotedStrings?ze.push([le,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Pe.multiLineStrings?ze.push([le,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ze.push([le,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Pe.verbatimStrings&&Xe.push([le,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var qe=Pe.hashComments;qe&&(Pe.cStyleComments?(qe>1?ze.push([pe,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ze.push([pe,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Xe.push([le,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ze.push([pe,/^#[^\r\n]*/,null,"#"])),Pe.cStyleComments&&(Xe.push([pe,/^\/\/[^\r\n]*/,null]),Xe.push([pe,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var He=Pe.regexLiterals;if(He){var Be=He>1?"":`
\r`,Fe=Be?".":"[\\S\\s]",Lt="/(?=[^/*"+Be+"])(?:[^/\\x5B\\x5C"+Be+"]|\\x5C"+Fe+"|\\x5B(?:[^\\x5C\\x5D"+Be+"]|\\x5C"+Fe+")*(?:\\x5D|$))+/";Xe.push(["lang-regex",RegExp("^"+de+"("+Lt+")")])}var ht=Pe.types;ht&&Xe.push([ne,ht]);var ot=(""+Pe.keywords).replace(/^ | $/g,"");ot.length&&Xe.push([v,new RegExp("^(?:"+ot.replace(/[\s,]+/g,"|")+")\\b"),null]),ze.push([E,/^\s+/,null,` \r
\xA0`]);var st="^.[^\\s\\w.$@'\"`/\\\\]*";return Pe.regexLiterals&&(st+="(?!s*/)"),Xe.push([ye,/^@[a-z_$][a-z_$@0-9]*/i,null],[ne,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[E,/^[a-z_$][a-z_$@0-9]*/i,null],[ye,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[E,/^\\[\s\S]?/,null],[j,new RegExp(st),null]),Ve(ze,Xe)}var _e=$e({keywords:je,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(Pe,ze,Xe){for(var qe=/(?:^|\s)nocode(?:\s|$)/,He=/\r\n?|\n/,Be=Pe.ownerDocument,Fe=Be.createElement("li");Pe.firstChild;)Fe.appendChild(Pe.firstChild);var Lt=[Fe];function ht(we){var St=we.nodeType;if(St==1&&!qe.test(we.className))if(we.nodeName==="br")ot(we),we.parentNode&&we.parentNode.removeChild(we);else for(var lt=we.firstChild;lt;lt=lt.nextSibling)ht(lt);else if((St==3||St==4)&&Xe){var ke=we.nodeValue,Re=ke.match(He);if(Re){var D=ke.substring(0,Re.index);we.nodeValue=D;var B=ke.substring(Re.index+Re[0].length);if(B){var I=we.parentNode;I.insertBefore(Be.createTextNode(B),we.nextSibling)}ot(we),D||we.parentNode.removeChild(we)}}}function ot(we){for(;!we.nextSibling;)if(we=we.parentNode,!we)return;function St(Re,D){var B=D?Re.cloneNode(!1):Re,I=Re.parentNode;if(I){var b=St(I,1),x=Re.nextSibling;b.appendChild(B);for(var S=x;S;S=x)x=S.nextSibling,b.appendChild(S)}return B}for(var lt=St(we.nextSibling,0),ke;(ke=lt.parentNode)&&ke.nodeType===1;)lt=ke;Lt.push(lt)}for(var st=0;st<Lt.length;++st)ht(Lt[st]);ze===(ze|0)&&Lt[0].setAttribute("value",ze);var Et=Be.createElement("ol");Et.className="linenums";for(var bt=Math.max(0,ze-1|0)||0,st=0,ft=Lt.length;st<ft;++st)Fe=Lt[st],Fe.className="L"+(st+bt)%10,Fe.firstChild||Fe.appendChild(Be.createTextNode("\xA0")),Et.appendChild(Fe);Pe.appendChild(Et)}function Se(Pe){var ze=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ze=ze&&+ze[1]<=8;var Xe=/\n/g,qe=Pe.sourceCode,He=qe.length,Be=0,Fe=Pe.spans,Lt=Fe.length,ht=0,ot=Pe.decorations,st=ot.length,Et=0;ot[st]=He;var bt,ft;for(ft=bt=0;ft<st;)ot[ft]!==ot[ft+2]?(ot[bt++]=ot[ft++],ot[bt++]=ot[ft++]):ft+=2;for(st=bt,ft=bt=0;ft<st;){for(var we=ot[ft],St=ot[ft+1],lt=ft+2;lt+2<=st&&ot[lt+1]===St;)lt+=2;ot[bt++]=we,ot[bt++]=St,ft=lt}st=ot.length=bt;var ke=Pe.sourceNode,Re="";ke&&(Re=ke.style.display,ke.style.display="none");try{for(var D=null;ht<Lt;){var B=Fe[ht],I=Fe[ht+2]||He,b=ot[Et+2]||He,lt=Math.min(I,b),x=Fe[ht+1],S;if(x.nodeType!==1&&(S=qe.substring(Be,lt))){ze&&(S=S.replace(Xe,"\r")),x.nodeValue=S;var A=x.ownerDocument,ae=A.createElement("span");ae.className=ot[Et+1];var ge=x.parentNode;ge.replaceChild(ae,x),ae.appendChild(x),Be<I&&(Fe[ht+1]=x=A.createTextNode(qe.substring(lt,I)),ge.insertBefore(x,ae.nextSibling))}Be=lt,Be>=I&&(ht+=2),Be>=b&&(Et+=2)}}finally{ke&&(ke.style.display=Re)}}var Te={};function te(Pe,ze){for(var Xe=ze.length;--Xe>=0;){var qe=ze[Xe];Te.hasOwnProperty(qe)?L.console&&console.warn("cannot override language handler %s",qe):Te[qe]=Pe}}function w(Pe,ze){return Pe&&Te.hasOwnProperty(Pe)||(Pe=/^\s*</.test(ze)?"default-markup":"default-code"),Te[Pe]}te(_e,["default-code"]),te(Ve([],[[E,/^[^<?]+/],[X,/^<!\w[^>]*(?:>|$)/],[pe,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[j,/^(?:<[%?]|[%?]>)/],["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"]),te(Ve([[E,/^[\s]+/,null,` \r
`],[Y,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[K,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[k,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[j,/^[=<>\/]+/],["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"]),te(Ve([],[[Y,/^[\s\S]+/]]),["uq.val"]),te($e({keywords:T,hashComments:!0,cStyleComments:!0,types:fe}),["c","cc","cpp","cxx","cyc","m"]),te($e({keywords:"null,true,false"}),["json"]),te($e({keywords:U,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:fe}),["cs"]),te($e({keywords:ee,cStyleComments:!0}),["java"]),te($e({keywords:be,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),te($e({keywords:ie,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),te($e({keywords:$,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),te($e({keywords:re,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),te($e({keywords:V,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),te($e({keywords:W,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),te(Ve([],[[le,/^[\s\S]+/]]),["regex"]);function Ie(Pe){var ze=Pe.langExtension;try{var Xe=m(Pe.sourceNode,Pe.pre),qe=Xe.sourceCode;Pe.sourceCode=qe,Pe.spans=Xe.spans,Pe.basePos=0,w(ze,qe)(Pe),Se(Pe)}catch(He){L.console&&console.log(He&&He.stack||He)}}function dt(Pe,ze,Xe){var qe=Xe||!1,He=ze||null,Be=document.createElement("div");Be.innerHTML="<pre>"+Pe+"</pre>",Be=Be.firstChild,qe&&Le(Be,qe,!0);var Fe={langExtension:He,numberLines:qe,sourceNode:Be,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Ie(Fe),Be.innerHTML}function kt(Pe,ze){var Xe=ze||document.body,qe=Xe.ownerDocument||document;function He(B){return Xe.getElementsByTagName(B)}for(var Be=[He("pre"),He("code"),He("xmp")],Fe=[],Lt=0;Lt<Be.length;++Lt)for(var ht=0,ot=Be[Lt].length;ht<ot;++ht)Fe.push(Be[Lt][ht]);Be=null;var st=Date;st.now||(st={now:function(){return+new Date}});var Et=0,bt=/\blang(?:uage)?-([\w.]+)(?!\S)/,ft=/\bprettyprint\b/,we=/\bprettyprinted\b/,St=/pre|xmp/i,lt=/^code$/i,ke=/^(?:pre|code|xmp)$/i,Re={};function D(){for(var B=L.PR_SHOULD_USE_CONTINUATION?st.now()+250:Infinity;Et<Fe.length&&st.now()<B;Et++){for(var I=Fe[Et],b=Re,x=I;x=x.previousSibling;){var S=x.nodeType,A=(S===7||S===8)&&x.nodeValue;if(A?!/^\??prettify\b/.test(A):S!==3||/\S/.test(x.nodeValue))break;if(A){b={},A.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Pt,ut,Wt){b[ut]=Wt});break}}var ae=I.className;if((b!==Re||ft.test(ae))&&!we.test(ae)){for(var ge=!1,xe=I.parentNode;xe;xe=xe.parentNode){var Ct=xe.tagName;if(ke.test(Ct)&&xe.className&&ft.test(xe.className)){ge=!0;break}}if(!ge){I.className+=" prettyprinted";var At=b.lang;if(!At){At=ae.match(bt);var Ee;!At&&(Ee=Ce(I))&&lt.test(Ee.tagName)&&(At=Ee.className.match(bt)),At&&(At=At[1])}var it;if(St.test(I.tagName))it=1;else{var pt=I.currentStyle,Ge=qe.defaultView,Dt=pt?pt.whiteSpace:Ge&&Ge.getComputedStyle?Ge.getComputedStyle(I,null).getPropertyValue("white-space"):0;it=Dt&&Dt.substring(0,3)==="pre"}var Tt=b.linenums;(Tt=Tt==="true"||+Tt)||(Tt=ae.match(/\blinenums\b(?::(\d+))?/),Tt=Tt?Tt[1]&&Tt[1].length?+Tt[1]:!0:!1),Tt&&Le(I,Tt,it);var Ft={langExtension:At,sourceNode:I,numberLines:Tt,pre:it,sourceCode:null,basePos:null,spans:null,decorations:null};Ie(Ft)}}}Et<Fe.length?L.setTimeout(D,250):typeof Pe=="function"&&Pe()}D()}var Qe=L.PR={createSimpleLexer:Ve,registerLangHandler:te,sourceDecorator:$e,PR_ATTRIB_NAME:k,PR_ATTRIB_VALUE:Y,PR_COMMENT:pe,PR_DECLARATION:X,PR_KEYWORD:v,PR_LITERAL:ye,PR_NOCODE:M,PR_PLAIN:E,PR_PUNCTUATION:j,PR_SOURCE:C,PR_STRING:le,PR_TAG:K,PR_TYPE:ne,prettyPrintOne:Z?L.prettyPrintOne=dt:q=dt,prettyPrint:P=Z?L.prettyPrint=kt:P=kt},Je=L.define;typeof Je=="function"&&Je.amd&&Je("google-code-prettify",[],function(){return Qe})})()},"VrN/":function(nt,Ye,y){(function(z,ve){nt.exports=ve()})(this,function(){"use strict";var z=navigator.userAgent,ve=navigator.platform,Z=/gecko\/\d/i.test(z),me=/MSIE \d/.test(z),ue=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(z),q=/Edge\/(\d+)/.exec(z),P=me||ue||q,L=P&&(me?document.documentMode||6:+(q||ue)[1]),R=!q&&/WebKit\//.test(z),F=R&&/Qt\/\d+\.\d+/.test(z),O=!q&&/Chrome\//.test(z),T=/Opera\//.test(z),ee=/Apple Computer/.test(navigator.vendor),U=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(z),W=/PhantomJS/.test(z),V=!q&&/AppleWebKit/.test(z)&&/Mobile\/\w+/.test(z),$=/Android/.test(z),ie=V||$||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(z),re=V||/Mac/.test(ve),be=/\bCrOS\b/.test(z),je=/win/i.test(ve),fe=T&&z.match(/Version\/(\d*\.\d*)/);fe&&(fe=Number(fe[1])),fe&&fe>=15&&(T=!1,R=!0);var le=re&&(F||T&&(fe==null||fe<12.11)),v=Z||P&&L>=9;function pe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ne=function(e,t){var i=e.className,n=pe(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 ye(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function j(e,t){return ye(e).appendChild(t)}function E(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 K(e,t,i,n){var r=E(e,t,i,n);return r.setAttribute("role","presentation"),r}var X;document.createRange?X=function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:X=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 C(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 Y(e,t){var i=e.className;pe(t).test(i)||(e.className+=(i?" ":"")+t)}function M(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!pe(i[n]).test(t)&&(t+=" "+i[n]);return t}var de=function(e){e.select()};V?de=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:P&&(de=function(e){try{e.select()}catch(t){}});function _(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function m(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 Q(e,t,i,n,r){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=n||0,l=r||0;;){var d=e.indexOf(" ",s);if(d<0||d>=t)return l+(t-s);l+=d-s,l+=i-l%i,s=d+1}}var Oe=function(){this.id=null,this.f=null,this.time=0,this.handler=_(this.onTimeout,this)};Oe.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Oe.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 Ce(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Ve=50,$e={toString:function(){return"CodeMirror.Pass"}},_e={scroll:!1},Le={origin:"*mouse"},Se={origin:"+move"};function Te(e,t,i){for(var n=0,r=0;;){var s=e.indexOf(" ",n);s==-1&&(s=e.length);var l=s-n;if(s==e.length||r+l>=t)return n+Math.min(l,t-r);if(r+=s-n,r+=i-r%i,n=s+1,r>=t)return n}}var te=[""];function w(e){for(;te.length<=e;)te.push(Ie(te)+" ");return te[e]}function Ie(e){return e[e.length-1]}function dt(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function kt(e,t,i){for(var n=0,r=i(t);n<e.length&&i(e[n])<=r;)n++;e.splice(n,0,t)}function Qe(){}function Je(e,t){var i;return Object.create?i=Object.create(e):(Qe.prototype=e,i=new Qe),t&&m(t,i),i}var Pe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ze(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Pe.test(e))}function Xe(e,t){return t?t.source.indexOf("\\w")>-1&&ze(e)?!0:t.test(e):ze(e)}function qe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var He=/[\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 Be(e){return e.charCodeAt(0)>=768&&He.test(e)}function Fe(e,t,i){for(;(i<0?t>0:t<e.length)&&Be(e.charAt(t));)t+=i;return t}function Lt(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 ht(e,t,i,n){if(!e)return n(t,i,"ltr",0);for(var r=!1,s=0;s<e.length;++s){var l=e[s];(l.from<i&&l.to>t||t==i&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,i),l.level==1?"rtl":"ltr",s),r=!0)}r||n(t,i,"ltr")}var ot=null;function st(e,t,i){var n;ot=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:ot=r),s.from==t&&(s.from!=s.to&&i!="before"?n=r:ot=r)}return n!=null?n:ot}var Et=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(g){return g<=247?e.charAt(g):1424<=g&&g<=1524?"R":1536<=g&&g<=1785?t.charAt(g-1536):1774<=g&&g<=2220?"r":8192<=g&&g<=8203?"w":g==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,s=/[LRr]/,l=/[Lb1n]/,d=/[1n]/;function f(g,N,H){this.level=g,this.from=N,this.to=H}return function(g,N){var H=N=="ltr"?"L":"R";if(g.length==0||N=="ltr"&&!n.test(g))return!1;for(var ce=g.length,oe=[],Ae=0;Ae<ce;++Ae)oe.push(i(g.charCodeAt(Ae)));for(var Ue=0,Ke=H;Ue<ce;++Ue){var et=oe[Ue];et=="m"?oe[Ue]=Ke:Ke=et}for(var mt=0,tt=H;mt<ce;++mt){var xt=oe[mt];xt=="1"&&tt=="r"?oe[mt]="n":s.test(xt)&&(tt=xt,xt=="r"&&(oe[mt]="R"))}for(var Ut=1,jt=oe[0];Ut<ce-1;++Ut){var Vt=oe[Ut];Vt=="+"&&jt=="1"&&oe[Ut+1]=="1"?oe[Ut]="1":Vt==","&&jt==oe[Ut+1]&&(jt=="1"||jt=="n")&&(oe[Ut]=jt),jt=Vt}for(var pn=0;pn<ce;++pn){var Bn=oe[pn];if(Bn==",")oe[pn]="N";else if(Bn=="%"){var xn=void 0;for(xn=pn+1;xn<ce&&oe[xn]=="%";++xn);for(var ri=pn&&oe[pn-1]=="!"||xn<ce&&oe[xn]=="1"?"1":"N",Qn=pn;Qn<xn;++Qn)oe[Qn]=ri;pn=xn-1}}for(var Rn=0,Zn=H;Rn<ce;++Rn){var Gn=oe[Rn];Zn=="L"&&Gn=="1"?oe[Rn]="L":s.test(Gn)&&(Zn=Gn)}for(var Mn=0;Mn<ce;++Mn)if(r.test(oe[Mn])){var An=void 0;for(An=Mn+1;An<ce&&r.test(oe[An]);++An);for(var _n=(Mn?oe[Mn-1]:H)=="L",ei=(An<ce?oe[An]:H)=="L",dr=_n==ei?_n?"L":"R":H,Di=Mn;Di<An;++Di)oe[Di]=dr;Mn=An-1}for(var Xn=[],yi,Un=0;Un<ce;)if(l.test(oe[Un])){var Yo=Un;for(++Un;Un<ce&&l.test(oe[Un]);++Un);Xn.push(new f(0,Yo,Un))}else{var Ei=Un,Ki=Xn.length,$i=N=="rtl"?1:0;for(++Un;Un<ce&&oe[Un]!="L";++Un);for(var $n=Ei;$n<Un;)if(d.test(oe[$n])){Ei<$n&&(Xn.splice(Ki,0,new f(1,Ei,$n)),Ki+=$i);var fr=$n;for(++$n;$n<Un&&d.test(oe[$n]);++$n);Xn.splice(Ki,0,new f(2,fr,$n)),Ki+=$i,Ei=$n}else++$n;Ei<Un&&Xn.splice(Ki,0,new f(1,Ei,Un))}return N=="ltr"&&(Xn[0].level==1&&(yi=g.match(/^\s+/))&&(Xn[0].from=yi[0].length,Xn.unshift(new f(0,0,yi[0].length))),Ie(Xn).level==1&&(yi=g.match(/\s+$/))&&(Ie(Xn).to-=yi[0].length,Xn.push(new f(0,ce-yi[0].length,ce)))),N=="rtl"?Xn.reverse():Xn}}();function bt(e,t){var i=e.order;return i==null&&(i=e.order=Et(e.text,t)),i}var ft=[],we=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]||ft).concat(i)}};function St(e,t){return e._handlers&&e._handlers[t]||ft}function lt(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=Ce(r,i);s>-1&&(n[t]=r.slice(0,s).concat(r.slice(s+1)))}}}function ke(e,t){var i=St(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 Re(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,i||t.type,e,t),S(t)||t.codemirrorIgnore}function D(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)Ce(i,t[n])==-1&&i.push(t[n])}function B(e,t){return St(e,t).length>0}function I(e){e.prototype.on=function(t,i){we(this,t,i)},e.prototype.off=function(t,i){lt(this,t,i)}}function b(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function x(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function S(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function A(e){b(e),x(e)}function ae(e){return e.target||e.srcElement}function ge(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),re&&e.ctrlKey&&t==1&&(t=3),t}var xe=function(){if(P&&L<9)return!1;var e=E("div");return"draggable"in e||"dragDrop"in e}(),Ct;function At(e){if(Ct==null){var t=E("span","\u200B");j(e,E("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ct=t.offsetWidth<=1&&t.offsetHeight>2&&!(P&&L<8))}var i=Ct?E("span","\u200B"):E("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Ee;function it(e){if(Ee!=null)return Ee;var t=j(e,document.createTextNode("A\u062EA")),i=X(t,0,1).getBoundingClientRect(),n=X(t,1,2).getBoundingClientRect();return ye(e),!i||i.left==i.right?!1:Ee=n.right-i.right<3}var pt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf(`
`,t);r==-1&&(r=e.length);var s=e.slice(t,e.charAt(r-1)=="\r"?r-1:r),l=s.indexOf("\r");l!=-1?(i.push(s.slice(0,l)),t+=l+1):(i.push(s),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Ge=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(i){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Dt=function(){var e=E("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Tt=null;function Ft(e){if(Tt!=null)return Tt;var t=j(e,E("span","x")),i=t.getBoundingClientRect(),n=X(t,0,1).getBoundingClientRect();return Tt=Math.abs(i.left-n.left)>1}var Pt={},ut={};function Wt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pt[e]=t}function Nt(e,t){ut[e]=t}function We(e){if(typeof e=="string"&&ut.hasOwnProperty(e))e=ut[e];else if(e&&typeof e.name=="string"&&ut.hasOwnProperty(e.name)){var t=ut[e.name];typeof t=="string"&&(t={name:t}),e=Je(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return We("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return We("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function gt(e,t){t=We(t);var i=Pt[t.name];if(!i)return gt(e,"text/plain");var n=i(e,t);if(vt.hasOwnProperty(t.name)){var r=vt[t.name];for(var s in r){if(!r.hasOwnProperty(s))continue;n.hasOwnProperty(s)&&(n["_"+s]=n[s]),n[s]=r[s]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var vt={};function _t(e,t){var i=vt.hasOwnProperty(e)?vt[e]:vt[e]={};m(t,i)}function Xt(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 Gt(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 Zt(e,t,i){return e.startState?e.startState(t,i):!0}var Ht=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};Ht.prototype.eol=function(){return this.pos>=this.string.length},Ht.prototype.sol=function(){return this.pos==this.lineStart},Ht.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ht.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ht.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},Ht.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ht.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ht.prototype.skipToEnd=function(){this.pos=this.string.length},Ht.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ht.prototype.backUp=function(e){this.pos-=e},Ht.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Q(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Q(this.string,this.lineStart,this.tabSize):0)},Ht.prototype.indentation=function(){return Q(this.string,null,this.tabSize)-(this.lineStart?Q(this.string,this.lineStart,this.tabSize):0)},Ht.prototype.match=function(e,t,i){if(typeof e=="string"){var n=function(l){return i?l.toLowerCase():l},r=this.string.substr(this.pos,e.length);if(n(r)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}},Ht.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ht.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ht.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ht.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function yt(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 Yt(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(s){var l=s.text;r==i.line&&(l=l.slice(0,i.ch)),r==t.line&&(l=l.slice(t.ch)),n.push(l),++r}),n}function Mt(e,t,i){var n=[];return e.iter(t,i,function(r){n.push(r.text)}),n}function qt(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function It(e){if(e.parent==null)return null;for(var t=e.parent,i=Ce(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 bn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],s=r.height;if(t<s){e=r;continue e}t-=s,i+=r.chunkSize()}return i}while(!e.lines);for(var l=0;l<e.lines.length;++l){var d=e.lines[l],f=d.height;if(t<f)break;t-=f}return i+l}function oi(e,t){return t>=e.first&&t<e.first+e.size}function li(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function De(e,t,i){if(i===void 0&&(i=null),!(this instanceof De))return new De(e,t,i);this.line=e,this.ch=t,this.sticky=i}function Ze(e,t){return e.line-t.line||e.ch-t.ch}function on(e,t){return e.sticky==t.sticky&&Ze(e,t)==0}function hn(e){return De(e.line,e.ch)}function gn(e,t){return Ze(e,t)<0?t:e}function En(e,t){return Ze(e,t)<0?e:t}function h(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 De(e.first,0);var i=e.first+e.size-1;return t.line>i?De(i,yt(e,i).text.length):a(t,yt(e,t.line).text.length)}function a(e,t){var i=e.ch;return i==null||i>t?De(e.line,t):i<0?De(e.line,0):e}function u(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=o(e,t[n]);return i}var p=function(e,t){this.state=e,this.lookAhead=t},c=function(e,t,i,n){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};c.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},c.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},c.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},c.fromSaved=function(e,t,i){return t instanceof p?new c(e,Xt(e.mode,t.state),i,t.lookAhead):new c(e,Xt(e.mode,t),i)},c.prototype.save=function(e){var t=e!==!1?Xt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new p(t,this.maxLookAhead):t};function G(e,t,i,n){var r=[e.state.modeGen],s={};at(e,t.text,e.doc.mode,i,function(g,N){return r.push(g,N)},s,n);for(var l=i.state,d=function(g){i.baseTokens=r;var N=e.state.overlays[g],H=1,ce=0;i.state=!0,at(e,t.text,N.mode,i,function(oe,Ae){for(var Ue=H;ce<oe;){var Ke=r[H];Ke>oe&&r.splice(H,1,oe,r[H+1],Ke),H+=2,ce=Math.min(oe,Ke)}if(!Ae)return;if(N.opaque)r.splice(Ue,H-Ue,oe,"overlay "+Ae),H=Ue+2;else for(;Ue<H;Ue+=2){var et=r[Ue+1];r[Ue+1]=(et?et+" ":"")+"overlay "+Ae}},s),i.state=l,i.baseTokens=null,i.baseTokenPos=1},f=0;f<e.state.overlays.length;++f)d(f);return{styles:r,classes:s.bgClass||s.textClass?s:null}}function Ne(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=he(e,It(t)),r=t.text.length>e.options.maxHighlightLength&&Xt(e.doc.mode,n.state),s=G(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 he(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return new c(n,!0,t);var s=Ot(e,t,i),l=s>n.first&&yt(n,s-1).stateAfter,d=l?c.fromSaved(n,l,s):new c(n,Zt(n.mode),s);return n.iter(s,t,function(f){wt(e,f.text,d);var g=d.line;f.stateAfter=g==t-1||g%5==0||g>=r.viewFrom&&g<r.viewTo?d.save():null,d.nextLine()}),i&&(n.modeFrontier=d.line),d}function wt(e,t,i,n){var r=e.doc.mode,s=new Ht(t,e.options.tabSize,i);for(s.start=s.pos=n||0,t==""&&se(r,i.state);!s.eol();)J(r,s,i.state),s.start=s.pos}function se(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var i=Gt(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}function J(e,t,i,n){for(var r=0;r<10;r++){n&&(n[0]=Gt(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 Me=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function rt(e,t,i,n){var r=e.doc,s=r.mode,l;t=o(r,t);var d=yt(r,t.line),f=he(e,t.line,i),g=new Ht(d.text,e.options.tabSize,f),N;for(n&&(N=[]);(n||g.pos<t.ch)&&!g.eol();)g.start=g.pos,l=J(s,g,f.state),n&&N.push(new Me(g,l,Xt(r.mode,f.state)));return n?N:new Me(g,l,f.state)}function ct(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 at(e,t,i,n,r,s,l){var d=i.flattenSpans;d==null&&(d=e.options.flattenSpans);var f=0,g=null,N=new Ht(t,e.options.tabSize,n),H,ce=e.options.addModeClass&&[null];for(t==""&&ct(se(i,n.state),s);!N.eol();){if(N.pos>e.options.maxHighlightLength?(d=!1,l&&wt(e,t,n,N.pos),N.pos=t.length,H=null):H=ct(J(i,N,n.state,ce),s),ce){var oe=ce[0].name;oe&&(H="m-"+(H?oe+" "+H:oe))}if(!d||g!=H){for(;f<N.start;)f=Math.min(N.start,f+5e3),r(f,g);g=H}N.start=N.pos}for(;f<N.pos;){var Ae=Math.min(N.pos,f+5e3);r(Ae,g),f=Ae}}function Ot(e,t,i){for(var n,r,s=e.doc,l=i?-1:t-(e.doc.mode.innerMode?1e3:100),d=t;d>l;--d){if(d<=s.first)return s.first;var f=yt(s,d-1),g=f.stateAfter;if(g&&(!i||d+(g instanceof p?g.lookAhead:0)<=s.modeFrontier))return d;var N=Q(f.text,null,e.options.tabSize);(r==null||n>N)&&(r=d-1,n=N)}return r}function en(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=yt(e,n).stateAfter;if(r&&(!(r instanceof p)||n+r.lookAhead<t)){i=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}var mn=!1,ln=!1;function tn(){mn=!0}function wn(){ln=!0}function Sn(e,t,i){this.marker=e,this.from=t,this.to=i}function Pn(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function Yn(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function vn(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Dn(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,d=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);if(d||s.from==t&&l.type=="bookmark"&&(!i||!s.marker.insertLeft)){var f=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);(n||(n=[])).push(new Sn(l,s.from,f?null:s.to))}}return n}function pi(e,t,i){var n;if(e)for(var r=0;r<e.length;++r){var s=e[r],l=s.marker,d=s.to==null||(l.inclusiveRight?s.to>=t:s.to>t);if(d||s.from==t&&l.type=="bookmark"&&(!i||s.marker.insertLeft)){var f=s.from==null||(l.inclusiveLeft?s.from<=t:s.from<t);(n||(n=[])).push(new Sn(l,f?null:s.from-t,s.to==null?null:s.to-t))}}return n}function Fn(e,t){if(t.full)return null;var i=oi(e,t.from.line)&&yt(e,t.from.line).markedSpans,n=oi(e,t.to.line)&&yt(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,s=t.to.ch,l=Ze(t.from,t.to)==0,d=Dn(i,r,l),f=pi(n,s,l),g=t.text.length==1,N=Ie(t.text).length+(g?r:0);if(d)for(var H=0;H<d.length;++H){var ce=d[H];if(ce.to==null){var oe=Pn(f,ce.marker);oe?g&&(ce.to=oe.to==null?null:oe.to+N):ce.to=r}}if(f)for(var Ae=0;Ae<f.length;++Ae){var Ue=f[Ae];if(Ue.to!=null&&(Ue.to+=N),Ue.from==null){var Ke=Pn(d,Ue.marker);Ke||(Ue.from=N,g&&(d||(d=[])).push(Ue))}else Ue.from+=N,g&&(d||(d=[])).push(Ue)}d&&(d=ti(d)),f&&f!=d&&(f=ti(f));var et=[d];if(!g){var mt=t.text.length-2,tt;if(mt>0&&d)for(var xt=0;xt<d.length;++xt)d[xt].to==null&&(tt||(tt=[])).push(new Sn(d[xt].marker,null,null));for(var Ut=0;Ut<mt;++Ut)et.push(tt);et.push(f)}return et}function ti(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 Ni(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(oe){if(oe.markedSpans)for(var Ae=0;Ae<oe.markedSpans.length;++Ae){var Ue=oe.markedSpans[Ae].marker;Ue.readOnly&&(!n||Ce(n,Ue)==-1)&&(n||(n=[])).push(Ue)}}),!n)return null;for(var r=[{from:t,to:i}],s=0;s<n.length;++s)for(var l=n[s],d=l.find(0),f=0;f<r.length;++f){var g=r[f];if(Ze(g.to,d.from)<0||Ze(g.from,d.to)>0)continue;var N=[f,1],H=Ze(g.from,d.from),ce=Ze(g.to,d.to);(H<0||!l.inclusiveLeft&&!H)&&N.push({from:g.from,to:d.from}),(ce>0||!l.inclusiveRight&&!ce)&&N.push({from:d.to,to:g.to}),r.splice.apply(r,N),f+=N.length-3}return r}function Ii(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 ji(e,t){if(!t)return;for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}function kn(e){return e.inclusiveLeft?-1:0}function nn(e){return e.inclusiveRight?1:0}function Wn(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var n=e.find(),r=t.find(),s=Ze(n.from,r.from)||kn(e)-kn(t);if(s)return-s;var l=Ze(n.to,r.to)||nn(e)-nn(t);return l||t.id-e.id}function rn(e,t){var i=ln&&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||Wn(n,r.marker)<0)&&(n=r.marker);return n}function zn(e){return rn(e,!0)}function fn(e){return rn(e,!1)}function _i(e,t){var i=ln&&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||Wn(n,s.marker)<0)&&(n=s.marker)}return n}function On(e,t,i,n,r){var s=yt(e,t),l=ln&&s.markedSpans;if(l)for(var d=0;d<l.length;++d){var f=l[d];if(!f.marker.collapsed)continue;var g=f.marker.find(0),N=Ze(g.from,i)||kn(f.marker)-kn(r),H=Ze(g.to,n)||nn(f.marker)-nn(r);if(N>=0&&H<=0||N<=0&&H>=0)continue;if(N<=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?Ze(g.to,i)>=0:Ze(g.to,i)>0)||N>=0&&(f.marker.inclusiveRight&&r.inclusiveLeft?Ze(g.from,n)<=0:Ze(g.from,n)<0))return!0}}function Ln(e){for(var t;t=zn(e);)e=t.find(-1,!0).line;return e}function mi(e){for(var t;t=fn(e);)e=t.find(1,!0).line;return e}function wi(e){for(var t,i;t=fn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Si(e,t){var i=yt(e,t),n=Ln(i);return i==n?t:It(n)}function Ur(e,t){if(t>e.lastLine())return t;var i=yt(e,t),n;if(!ci(e,i))return t;for(;n=fn(i);)i=n.find(1,!0).line;return It(i)+1}function ci(e,t){var i=ln&&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&&Yi(e,t,n))return!0}}function Yi(e,t,i){if(i.to==null){var n=i.marker.find(1,!0);return Yi(e,n.line,Pn(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)&&Yi(e,t,r))return!0}function ni(e){e=Ln(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var s=i.parent;s;i=s,s=i.parent)for(var l=0;l<s.children.length;++l){var d=s.children[l];if(d==i)break;t+=d.height}return t}function Ji(e){if(e.height==0)return 0;for(var t=e.text.length,i,n=e;i=zn(n);){var r=i.find(0,!0);n=r.from.line,t+=r.from.ch-r.to.ch}for(n=e;i=fn(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 bi(e){var t=e.display,i=e.doc;t.maxLine=yt(i,i.first),t.maxLineLength=Ji(t.maxLine),t.maxLineChanged=!0,i.iter(function(n){var r=Ji(n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}var ki=function(e,t,i){this.text=e,ji(this,t),this.height=i?i(this):1};ki.prototype.lineNo=function(){return It(this)},I(ki);function uo(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ii(e),ji(e,i);var r=n?n(e):1;r!=e.height&&qt(e,r)}function co(e){e.parent=null,Ii(e)}var qo={},Qo={};function ho(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qo:qo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Fr(e,t){var i=K("span",null,null,R?"padding-right: .1px":null),n={pre:K("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var s=r?t.rest[r-1]:t.line,l=void 0;n.pos=0,n.addToken=zt,it(e.display.measure)&&(l=bt(s,e.doc.direction))&&(n.addToken=Kt(n.addToken,l)),n.map=[];var d=t!=e.display.externalMeasured&&It(s);sn(s,n,Ne(e,s,d)),s.styleClasses&&(s.styleClasses.bgClass&&(n.bgClass=M(s.styleClasses.bgClass,n.bgClass||"")),s.styleClasses.textClass&&(n.textClass=M(s.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(At(e.display.measure))),r==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(R){var f=n.content.lastChild;(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=M(n.pre.className,n.textClass||"")),n}function Rt(e){var t=E("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function zt(e,t,i,n,r,s,l){if(!t)return;var d=e.splitSpaces?Bt(t,e.trailingSpace):t,f=e.cm.state.specialChars,g=!1,N;if(!f.test(t))e.col+=t.length,N=document.createTextNode(d),e.map.push(e.pos,e.pos+t.length,N),P&&L<9&&(g=!0),e.pos+=t.length;else{N=document.createDocumentFragment();for(var H=0;;){f.lastIndex=H;var ce=f.exec(t),oe=ce?ce.index-H:t.length-H;if(oe){var Ae=document.createTextNode(d.slice(H,H+oe));P&&L<9?N.appendChild(E("span",[Ae])):N.appendChild(Ae),e.map.push(e.pos,e.pos+oe,Ae),e.col+=oe,e.pos+=oe}if(!ce)break;H+=oe+1;var Ue=void 0;if(ce[0]==" "){var Ke=e.cm.options.tabSize,et=Ke-e.col%Ke;Ue=N.appendChild(E("span",w(et),"cm-tab")),Ue.setAttribute("role","presentation"),Ue.setAttribute("cm-text"," "),e.col+=et}else ce[0]=="\r"||ce[0]==`
`?(Ue=N.appendChild(E("span",ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ue.setAttribute("cm-text",ce[0]),e.col+=1):(Ue=e.cm.options.specialCharPlaceholder(ce[0]),Ue.setAttribute("cm-text",ce[0]),P&&L<9?N.appendChild(E("span",[Ue])):N.appendChild(Ue),e.col+=1);e.map.push(e.pos,e.pos+1,Ue),e.pos++}}if(e.trailingSpace=d.charCodeAt(t.length-1)==32,i||n||r||g||s||l){var mt=i||"";n&&(mt+=n),r&&(mt+=r);var tt=E("span",[N],mt,s);if(l)for(var xt in l)l.hasOwnProperty(xt)&&xt!="style"&&xt!="class"&&tt.setAttribute(xt,l[xt]);return e.content.appendChild(tt)}e.content.appendChild(N)}function Bt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,n="",r=0;r<e.length;r++){var s=e.charAt(r);s==" "&&i&&(r==e.length-1||e.charCodeAt(r+1)==32)&&(s="\xA0"),n+=s,i=s==" "}return n}function Kt(e,t){return function(i,n,r,s,l,d,f){r=r?r+" cm-force-border":"cm-force-border";for(var g=i.pos,N=g+n.length;;){for(var H=void 0,ce=0;ce<t.length&&!(H=t[ce],H.to>g&&H.from<=g);ce++);if(H.to>=N)return e(i,n,r,s,l,d,f);e(i,n.slice(0,H.to-g),r,s,null,d,f),s=null,n=n.slice(H.to-g),g=H.to}}}function Qt(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 sn(e,t,i){var n=e.markedSpans,r=e.text,s=0;if(!n){for(var l=1;l<i.length;l+=2)t.addToken(t,r.slice(s,s=i[l]),ho(i[l+1],t.cm.options));return}for(var d=r.length,f=0,g=1,N="",H,ce,oe=0,Ae,Ue,Ke,et,mt;;){if(oe==f){Ae=Ue=Ke=ce="",mt=null,et=null,oe=Infinity;for(var tt=[],xt=void 0,Ut=0;Ut<n.length;++Ut){var jt=n[Ut],Vt=jt.marker;if(Vt.type=="bookmark"&&jt.from==f&&Vt.widgetNode)tt.push(Vt);else if(jt.from<=f&&(jt.to==null||jt.to>f||Vt.collapsed&&jt.to==f&&jt.from==f)){if(jt.to!=null&&jt.to!=f&&oe>jt.to&&(oe=jt.to,Ue=""),Vt.className&&(Ae+=" "+Vt.className),Vt.css&&(ce=(ce?ce+";":"")+Vt.css),Vt.startStyle&&jt.from==f&&(Ke+=" "+Vt.startStyle),Vt.endStyle&&jt.to==oe&&(xt||(xt=[])).push(Vt.endStyle,jt.to),Vt.title&&((mt||(mt={})).title=Vt.title),Vt.attributes)for(var pn in Vt.attributes)(mt||(mt={}))[pn]=Vt.attributes[pn];Vt.collapsed&&(!et||Wn(et.marker,Vt)<0)&&(et=jt)}else jt.from>f&&oe>jt.from&&(oe=jt.from)}if(xt)for(var Bn=0;Bn<xt.length;Bn+=2)xt[Bn+1]==oe&&(Ue+=" "+xt[Bn]);if(!et||et.from==f)for(var xn=0;xn<tt.length;++xn)Qt(t,0,tt[xn]);if(et&&(et.from||0)==f){if(Qt(t,(et.to==null?d+1:et.to)-f,et.marker,et.from==null),et.to==null)return;et.to==f&&(et=!1)}}if(f>=d)break;for(var ri=Math.min(d,oe);;){if(N){var Qn=f+N.length;if(!et){var Rn=Qn>ri?N.slice(0,ri-f):N;t.addToken(t,Rn,H?H+Ae:Ae,Ke,f+Rn.length==oe?Ue:"",ce,mt)}if(Qn>=ri){N=N.slice(ri-f),f=ri;break}f=Qn,Ke=""}N=r.slice(s,s=i[g++]),H=ho(i[g++],t.cm.options)}}}function Jt(e,t,i){this.line=t,this.rest=wi(t),this.size=this.rest?It(Ie(this.rest))-i+1:1,this.node=this.text=null,this.hidden=ci(e,t)}function Cn(e,t,i){for(var n=[],r,s=t;s<i;s=r){var l=new Jt(e.doc,yt(e.doc,s),s);r=s+l.size,n.push(l)}return n}var Nn=null;function $t(e){Nn?Nn.ops.push(e):e.ownsGroup=Nn={ops:[e],delayedCallbacks:[]}}function Bi(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 un(e,t){var i=e.ownsGroup;if(!i)return;try{Bi(i)}finally{Nn=null,t(i)}}var Hn=null;function dn(e,t){var i=St(e,t);if(!i.length)return;var n=Array.prototype.slice.call(arguments,2),r;Nn?r=Nn.delayedCallbacks:Hn?r=Hn:(r=Hn=[],setTimeout(ui,0));for(var s=function(d){r.push(function(){return i[d].apply(null,n)})},l=0;l<i.length;++l)s(l)}function ui(){var e=Hn;Hn=null;for(var t=0;t<e.length;++t)e[t]()}function pr(e,t,i,n){for(var r=0;r<t.changes.length;r++){var s=t.changes[r];s=="text"?Ds(e,t):s=="gutter"?ea(e,t,i,n):s=="class"?fo(e,t):s=="widget"&&Ns(e,t,n)}t.changes=null}function mr(e){return e.node==e.text&&(e.node=E("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),P&&L<8&&(e.node.style.zIndex=2)),e.node}function Ms(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(E("div",null,i),n.firstChild),e.display.input.setUneditable(t.background)}}function Zo(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Fr(e,t)}function Ds(e,t){var i=t.text.className,n=Zo(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,fo(e,t)):i&&(t.text.className=i)}function fo(e,t){Ms(e,t),t.line.wrapClass?mr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ea(e,t,i,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var r=mr(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),r.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var l=mr(t),d=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(d),l.insertBefore(d,t.text),t.line.gutterClass&&(d.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=d.appendChild(E("div",li(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var f=0;f<e.display.gutterSpecs.length;++f){var g=e.display.gutterSpecs[f].className,N=s.hasOwnProperty(g)&&s[g];N&&d.appendChild(E("div",[N],"CodeMirror-gutter-elt","left: "+n.gutterLeft[g]+"px; width: "+n.gutterWidth[g]+"px"))}}}function Ns(e,t,i){t.alignable&&(t.alignable=null);for(var n=pe("CodeMirror-linewidget"),r=t.node.firstChild,s=void 0;r;r=s)s=r.nextSibling,n.test(r.className)&&t.node.removeChild(r);ta(e,t,i)}function Is(e,t,i,n){var r=Zo(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),fo(e,t),ea(e,t,i,n),ta(e,t,n),t.node}function ta(e,t,i){if(na(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)na(e,t.rest[n],t,i,!1)}function na(e,t,i,n,r){if(!t.widgets)return;for(var s=mr(i),l=0,d=t.widgets;l<d.length;++l){var f=d[l],g=E("div",[f.node],"CodeMirror-linewidget"+(f.className?" "+f.className:""));f.handleMouseEvents||g.setAttribute("cm-ignore-events","true"),js(f,g,i,n),e.display.input.setUneditable(g),r&&f.above?s.insertBefore(g,i.gutter||i.text):s.appendChild(g),dn(f,"redraw")}}function js(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!C(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;"),j(t.display.measure,E("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Ci(e,t){for(var i=ae(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Wr(e){return e.lineSpace.offsetTop}function po(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ia(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=j(e.measure,E("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 gi(e){return Ve-e.display.nativeBarWidth}function Ui(e){return e.display.scroller.clientWidth-gi(e)-e.display.barWidth}function mo(e){return e.display.scroller.clientHeight-gi(e)-e.display.barHeight}function Bs(e,t,i){var n=e.options.lineWrapping,r=n&&Ui(e);if(!t.measure.heights||n&&t.measure.width!=r){var s=t.measure.heights=[];if(n){t.measure.width=r;for(var l=t.text.firstChild.getClientRects(),d=0;d<l.length-1;d++){var f=l[d],g=l[d+1];Math.abs(f.bottom-g.bottom)>2&&s.push((f.bottom+g.top)/2-i.top)}}s.push(i.bottom-i.top)}}function ra(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var r=0;r<e.rest.length;r++)if(It(e.rest[r])>i)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Us(e,t){t=Ln(t);var i=It(t),n=e.display.externalMeasured=new Jt(e.doc,t,i);n.lineN=i;var r=n.built=Fr(e,n);return n.text=r.pre,j(e.display.lineMeasure,r.pre),n}function oa(e,t,i,n){return vi(e,qi(e,t),i,n)}function go(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[zi(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function qi(e,t){var i=It(t),n=go(e,i);n&&!n.text?n=null:n&&n.changes&&(pr(e,n,i,Eo(e)),e.curOp.forceUpdate=!0),n||(n=Us(e,t));var r=ra(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function vi(e,t,i,n,r){t.before&&(i=-1);var s=i+(n||""),l;return t.cache.hasOwnProperty(s)?l=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Bs(e,t.view,t.rect),t.hasHeights=!0),l=Ws(e,t,i,n),l.bogus||(t.cache[s]=l)),{left:l.left,right:l.right,top:r?l.rtop:l.top,bottom:r?l.rbottom:l.bottom}}var aa={left:0,right:0,top:0,bottom:0};function sa(e,t,i){for(var n,r,s,l,d,f,g=0;g<e.length;g+=3)if(d=e[g],f=e[g+1],t<d?(r=0,s=1,l="left"):t<f?(r=t-d,s=r+1):(g==e.length-3||t==f&&e[g+3]>t)&&(s=f-d,r=s-1,t>=f&&(l="right")),r!=null){if(n=e[g+2],d==f&&i==(n.insertLeft?"left":"right")&&(l=i),i=="left"&&r==0)for(;g&&e[g-2]==e[g-3]&&e[g-1].insertLeft;)n=e[(g-=3)+2],l="left";if(i=="right"&&r==f-d)for(;g<e.length-3&&e[g+3]==e[g+4]&&!e[g+5].insertLeft;)n=e[(g+=3)+2],l="right";break}return{node:n,start:r,end:s,collapse:l,coverStart:d,coverEnd:f}}function Fs(e,t){var i=aa;if(t=="left")for(var n=0;n<e.length&&!((i=e[n]).left!=i.right);n++);else for(var r=e.length-1;r>=0&&!((i=e[r]).left!=i.right);r--);return i}function Ws(e,t,i,n){var r=sa(t.map,i,n),s=r.node,l=r.start,d=r.end,f=r.collapse,g;if(s.nodeType==3){for(var N=0;N<4;N++){for(;l&&Be(t.line.text.charAt(r.coverStart+l));)--l;for(;r.coverStart+d<r.coverEnd&&Be(t.line.text.charAt(r.coverStart+d));)++d;if(P&&L<9&&l==0&&d==r.coverEnd-r.coverStart?g=s.parentNode.getBoundingClientRect():g=Fs(X(s,l,d).getClientRects(),n),g.left||g.right||l==0)break;d=l,l=l-1,f="right"}P&&L<11&&(g=zs(e.display.measure,g))}else{l>0&&(f=n="right");var H;e.options.lineWrapping&&(H=s.getClientRects()).length>1?g=H[n=="right"?H.length-1:0]:g=s.getBoundingClientRect()}if(P&&L<9&&!l&&(!g||!g.left&&!g.right)){var ce=s.parentNode.getClientRects()[0];ce?g={left:ce.left,right:ce.left+Zi(e.display),top:ce.top,bottom:ce.bottom}:g=aa}for(var oe=g.top-t.rect.top,Ae=g.bottom-t.rect.top,Ue=(oe+Ae)/2,Ke=t.view.measure.heights,et=0;et<Ke.length-1&&!(Ue<Ke[et]);et++);var mt=et?Ke[et-1]:0,tt=Ke[et],xt={left:(f=="right"?g.right:g.left)-t.rect.left,right:(f=="left"?g.left:g.right)-t.rect.left,top:mt,bottom:tt};return!g.left&&!g.right&&(xt.bogus=!0),e.options.singleCursorHeightPerLine||(xt.rtop=oe,xt.rbottom=Ae),xt}function zs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ft(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function la(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function ua(e){e.display.externalMeasure=null,ye(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)la(e.display.view[t])}function vr(e){ua(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ca(){return O&&$?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ha(){return O&&$?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function vo(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=gr(e.widgets[i]));return t}function zr(e,t,i,n,r){if(!r){var s=vo(t);i.top+=s,i.bottom+=s}if(n=="line")return i;n||(n="local");var l=ni(t);if(n=="local"?l+=Wr(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var d=e.display.lineSpace.getBoundingClientRect();l+=d.top+(n=="window"?0:ha());var f=d.left+(n=="window"?0:ca());i.left+=f,i.right+=f}return i.top+=l,i.bottom+=l,i}function da(e,t,i){if(i=="div")return t;var n=t.left,r=t.top;if(i=="page")n-=ca(),r-=ha();else if(i=="local"||!i){var s=e.display.sizer.getBoundingClientRect();n+=s.left,r+=s.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:r-l.top}}function yo(e,t,i,n,r){return n||(n=yt(e.doc,t.line)),zr(e,n,oa(e,n,t.ch,r),i)}function hi(e,t,i,n,r,s){n=n||yt(e.doc,t.line),r||(r=qi(e,n));function l(Ae,Ue){var Ke=vi(e,r,Ae,Ue?"right":"left",s);return Ue?Ke.left=Ke.right:Ke.right=Ke.left,zr(e,n,Ke,i)}var d=bt(n,e.doc.direction),f=t.ch,g=t.sticky;if(f>=n.text.length?(f=n.text.length,g="before"):f<=0&&(f=0,g="after"),!d)return l(g=="before"?f-1:f,g=="before");function N(Ae,Ue,Ke){var et=d[Ue],mt=et.level==1;return l(Ke?Ae-1:Ae,mt!=Ke)}var H=st(d,f,g),ce=ot,oe=N(f,H,g=="before");return ce!=null&&(oe.other=N(f,ce,g!="before")),oe}function fa(e,t){var i=0;t=o(e.doc,t),e.options.lineWrapping||(i=Zi(e.display)*t.ch);var n=yt(e.doc,t.line),r=ni(n)+Wr(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function bo(e,t,i,n,r){var s=De(e,t,i);return s.xRel=r,n&&(s.outside=n),s}function Co(e,t,i){var n=e.doc;if(i+=e.display.viewOffset,i<0)return bo(n.first,0,null,-1,-1);var r=bn(n,i),s=n.first+n.size-1;if(r>s)return bo(n.first+n.size-1,yt(n,s).text.length,null,1,1);t<0&&(t=0);for(var l=yt(n,r);;){var d=Hs(e,l,r,t,i),f=_i(l,d.ch+(d.xRel>0||d.outside>0?1:0));if(!f)return d;var g=f.find(1);if(g.line==r)return g;l=yt(n,r=g.line)}}function pa(e,t,i,n){n-=vo(t);var r=t.text.length,s=Lt(function(l){return vi(e,i,l-1).bottom<=n},r,0);return r=Lt(function(l){return vi(e,i,l).top>n},s,r),{begin:s,end:r}}function ma(e,t,i,n){i||(i=qi(e,t));var r=zr(e,t,vi(e,i,n),"line").top;return pa(e,t,i,r)}function xo(e,t,i,n){return e.bottom<=i?!1:e.top>i?!0:(n?e.left:e.right)>t}function Hs(e,t,i,n,r){r-=ni(t);var s=qi(e,t),l=vo(t),d=0,f=t.text.length,g=!0,N=bt(t,e.doc.direction);if(N){var H=(e.options.lineWrapping?Vs:Gs)(e,t,i,s,N,n,r);g=H.level!=1,d=g?H.from:H.to-1,f=g?H.to:H.from-1}var ce=null,oe=null,Ae=Lt(function(Ut){var jt=vi(e,s,Ut);return jt.top+=l,jt.bottom+=l,xo(jt,n,r,!1)?(jt.top<=r&&jt.left<=n&&(ce=Ut,oe=jt),!0):!1},d,f),Ue,Ke,et=!1;if(oe){var mt=n-oe.left<oe.right-n,tt=mt==g;Ae=ce+(tt?0:1),Ke=tt?"after":"before",Ue=mt?oe.left:oe.right}else{!g&&(Ae==f||Ae==d)&&Ae++,Ke=Ae==0?"after":Ae==t.text.length?"before":vi(e,s,Ae-(g?1:0)).bottom+l<=r==g?"after":"before";var xt=hi(e,De(i,Ae,Ke),"line",t,s);Ue=xt.left,et=r<xt.top?-1:r>=xt.bottom?1:0}return Ae=Fe(t.text,Ae,1),bo(i,Ae,Ke,et,n-Ue)}function Gs(e,t,i,n,r,s,l){var d=Lt(function(H){var ce=r[H],oe=ce.level!=1;return xo(hi(e,De(i,oe?ce.to:ce.from,oe?"before":"after"),"line",t,n),s,l,!0)},0,r.length-1),f=r[d];if(d>0){var g=f.level!=1,N=hi(e,De(i,g?f.from:f.to,g?"after":"before"),"line",t,n);xo(N,s,l,!0)&&N.top>l&&(f=r[d-1])}return f}function Vs(e,t,i,n,r,s,l){var d=pa(e,t,n,l),f=d.begin,g=d.end;/\s/.test(t.text.charAt(g-1))&&g--;for(var N=null,H=null,ce=0;ce<r.length;ce++){var oe=r[ce];if(oe.from>=g||oe.to<=f)continue;var Ae=oe.level!=1,Ue=vi(e,n,Ae?Math.min(g,oe.to)-1:Math.max(f,oe.from)).right,Ke=Ue<s?s-Ue+1e9:Ue-s;(!N||H>Ke)&&(N=oe,H=Ke)}return N||(N=r[r.length-1]),N.from<f&&(N={from:f,to:N.to,level:N.level}),N.to>g&&(N={from:N.from,to:g,level:N.level}),N}var Fi;function Qi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Fi==null){Fi=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Fi.appendChild(document.createTextNode("x")),Fi.appendChild(E("br"));Fi.appendChild(document.createTextNode("x"))}j(e.measure,Fi);var i=Fi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ye(e.measure),i||1}function Zi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=E("span","xxxxxxxxxx"),i=E("pre",[t],"CodeMirror-line-like");j(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Eo(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,s=t.gutters.firstChild,l=0;s;s=s.nextSibling,++l){var d=e.display.gutterSpecs[l].className;i[d]=s.offsetLeft+s.clientLeft+r,n[d]=s.clientWidth}return{fixedPos:_o(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _o(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ga(e){var t=Qi(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/Zi(e.display)-3);return function(r){if(ci(e.doc,r))return 0;var s=0;if(r.widgets)for(var l=0;l<r.widgets.length;l++)r.widgets[l].height&&(s+=r.widgets[l].height);return i?s+(Math.ceil(r.text.length/n)||1)*t:s+t}}function wo(e){var t=e.doc,i=ga(e);t.iter(function(n){var r=i(n);r!=n.height&&qt(n,r)})}function Wi(e,t,i,n){var r=e.display;if(!i&&ae(t).getAttribute("cm-not-content")=="true")return null;var s,l,d=r.lineSpace.getBoundingClientRect();try{s=t.clientX-d.left,l=t.clientY-d.top}catch(H){return null}var f=Co(e,s,l),g;if(n&&f.xRel>0&&(g=yt(e.doc,f.line).text).length==f.ch){var N=Q(g,g.length,e.options.tabSize)-g.length;f=De(f.line,Math.max(0,Math.round((s-ia(e.display).left)/Zi(e.display))-N))}return f}function zi(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 Jn(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)ln&&Si(e.doc,t)<r.viewTo&&Ri(e);else if(i<=r.viewFrom)ln&&Ur(e.doc,i+n)>r.viewFrom?Ri(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Ri(e);else if(t<=r.viewFrom){var s=Hr(e,i,i+n,1);s?(r.view=r.view.slice(s.index),r.viewFrom=s.lineN,r.viewTo+=n):Ri(e)}else if(i>=r.viewTo){var l=Hr(e,t,t,-1);l?(r.view=r.view.slice(0,l.index),r.viewTo=l.lineN):Ri(e)}else{var d=Hr(e,t,t,-1),f=Hr(e,i,i+n,1);d&&f?(r.view=r.view.slice(0,d.index).concat(Cn(e,d.lineN,f.lineN)).concat(r.view.slice(f.index)),r.viewTo+=n):Ri(e)}var g=r.externalMeasured;g&&(i<g.lineN?g.lineN+=n:t<g.lineN+g.size&&(r.externalMeasured=null))}function Ti(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[zi(e,t)];if(s.node==null)return;var l=s.changes||(s.changes=[]);Ce(l,i)==-1&&l.push(i)}function Ri(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Hr(e,t,i,n){var r=zi(e,t),s,l=e.display.view;if(!ln||i==e.doc.first+e.doc.size)return{index:r,lineN:i};for(var d=e.display.viewFrom,f=0;f<r;f++)d+=l[f].size;if(d!=t){if(n>0){if(r==l.length-1)return null;s=d+l[r].size-t,r++}else s=d-t;t+=s,i+=s}for(;Si(e.doc,i)!=i;){if(r==(n<0?0:l.length-1))return null;i+=n*l[r-(n<0?1:0)].size,r+=n}return{index:r,lineN:i}}function Xs(e,t,i){var n=e.display,r=n.view;r.length==0||t>=n.viewTo||i<=n.viewFrom?(n.view=Cn(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Cn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(zi(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Cn(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,zi(e,i)))),n.viewTo=i}function va(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];!r.hidden&&(!r.node||r.changes)&&++i}return i}function yr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ya(e,t){t===void 0&&(t=!0);for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),s=n.selection=document.createDocumentFragment(),l=0;l<i.sel.ranges.length;l++){if(!t&&l==i.sel.primIndex)continue;var d=i.sel.ranges[l];if(d.from().line>=e.display.viewTo||d.to().line<e.display.viewFrom)continue;var f=d.empty();(f||e.options.showCursorWhenSelecting)&&ba(e,d.head,r),f||Ks(e,d,s)}return n}function ba(e,t,i){var n=hi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(E("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(E("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Gr(e,t){return e.top-t.top||e.left-t.left}function Ks(e,t,i){var n=e.display,r=e.doc,s=document.createDocumentFragment(),l=ia(e.display),d=l.left,f=Math.max(n.sizerWidth,Ui(e)-n.sizer.offsetLeft)-l.right,g=r.direction=="ltr";function N(tt,xt,Ut,jt){xt<0&&(xt=0),xt=Math.round(xt),jt=Math.round(jt),s.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+tt+`px;
top: `+xt+"px; width: "+(Ut==null?f-tt:Ut)+`px;
height: `+(jt-xt)+"px"))}function H(tt,xt,Ut){var jt=yt(r,tt),Vt=jt.text.length,pn,Bn;function xn(Rn,Zn){return yo(e,De(tt,Rn),"div",jt,Zn)}function ri(Rn,Zn,Gn){var Mn=ma(e,jt,null,Rn),An=Zn=="ltr"==(Gn=="after")?"left":"right",_n=Gn=="after"?Mn.begin:Mn.end-(/\s/.test(jt.text.charAt(Mn.end-1))?2:1);return xn(_n,An)[An]}var Qn=bt(jt,r.direction);return ht(Qn,xt||0,Ut==null?Vt:Ut,function(Rn,Zn,Gn,Mn){var An=Gn=="ltr",_n=xn(Rn,An?"left":"right"),ei=xn(Zn-1,An?"right":"left"),dr=xt==null&&Rn==0,Di=Ut==null&&Zn==Vt,Xn=Mn==0,yi=!Qn||Mn==Qn.length-1;if(ei.top-_n.top<=3){var Un=(g?dr:Di)&&Xn,Yo=(g?Di:dr)&&yi,Ei=Un?d:(An?_n:ei).left,Ki=Yo?f:(An?ei:_n).right;N(Ei,_n.top,Ki-Ei,_n.bottom)}else{var $i,$n,fr,Jo;An?($i=g&&dr&&Xn?d:_n.left,$n=g?f:ri(Rn,Gn,"before"),fr=g?d:ri(Zn,Gn,"after"),Jo=g&&Di&&yi?f:ei.right):($i=g?ri(Rn,Gn,"before"):d,$n=!g&&dr&&Xn?f:_n.right,fr=!g&&Di&&yi?d:ei.left,Jo=g?ri(Zn,Gn,"after"):f),N($i,_n.top,$n-$i,_n.bottom),_n.bottom<ei.top&&N(d,_n.bottom,null,ei.top),N(fr,ei.top,Jo-fr,ei.bottom)}(!pn||Gr(_n,pn)<0)&&(pn=_n),Gr(ei,pn)<0&&(pn=ei),(!Bn||Gr(_n,Bn)<0)&&(Bn=_n),Gr(ei,Bn)<0&&(Bn=ei)}),{start:pn,end:Bn}}var ce=t.from(),oe=t.to();if(ce.line==oe.line)H(ce.line,ce.ch,oe.ch);else{var Ae=yt(r,ce.line),Ue=yt(r,oe.line),Ke=Ln(Ae)==Ln(Ue),et=H(ce.line,ce.ch,Ke?Ae.text.length+1:null).end,mt=H(oe.line,Ke?0:null,oe.ch).start;Ke&&(et.top<mt.top-2?(N(et.right,et.top,null,et.bottom),N(d,mt.top,mt.left,mt.bottom)):N(et.right,et.top,mt.left-et.right,et.bottom)),et.bottom<mt.top&&N(d,et.bottom,null,mt.top)}i.appendChild(s)}function So(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||er(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function Ca(e){e.state.focused||(e.display.input.focus(),ko(e))}function xa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,er(e))},100)}function ko(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,Y(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),R&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),So(e)}function er(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,ne(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Vr(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r=t.view[n],s=e.options.lineWrapping,l=void 0,d=0;if(r.hidden)continue;if(P&&L<8){var f=r.node.offsetTop+r.node.offsetHeight;l=f-i,i=f}else{var g=r.node.getBoundingClientRect();l=g.bottom-g.top,!s&&r.text.firstChild&&(d=r.text.firstChild.getBoundingClientRect().right-g.left-1)}var N=r.line.height-l;if((N>.005||N<-.005)&&(qt(r.line,l),Ea(r.line),r.rest))for(var H=0;H<r.rest.length;H++)Ea(r.rest[H]);if(d>e.display.sizerWidth){var ce=Math.ceil(d/Zi(e.display));ce>e.display.maxLineLength&&(e.display.maxLineLength=ce,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}function Ea(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],n=i.node.parentNode;n&&(i.height=n.offsetHeight)}}function Xr(e,t,i){var n=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Wr(e));var r=i&&i.bottom!=null?i.bottom:n+e.wrapper.clientHeight,s=bn(t,n),l=bn(t,r);if(i&&i.ensure){var d=i.ensure.from.line,f=i.ensure.to.line;d<s?(s=d,l=bn(t,ni(yt(t,d))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(s=bn(t,ni(yt(t,f))-e.wrapper.clientHeight),l=f)}return{from:s,to:Math.max(l,s+1)}}function $s(e,t){if(Re(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=E("div","\u200B",null,`position: absolute;
top: `+(t.top-i.viewOffset-Wr(e.display))+`px;
height: `+(t.bottom-t.top+gi(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?De(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,i=t.sticky=="before"?De(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var l=!1,d=hi(e,t),f=!i||i==t?d:hi(e,i);r={left:Math.min(d.left,f.left),top:Math.min(d.top,f.top)-n,right:Math.max(d.left,f.left),bottom:Math.max(d.bottom,f.bottom)+n};var g=To(e,r),N=e.doc.scrollTop,H=e.doc.scrollLeft;if(g.scrollTop!=null&&(Cr(e,g.scrollTop),Math.abs(e.doc.scrollTop-N)>1&&(l=!0)),g.scrollLeft!=null&&(Hi(e,g.scrollLeft),Math.abs(e.doc.scrollLeft-H)>1&&(l=!0)),!l)break}return r}function Js(e,t){var i=To(e,t);i.scrollTop!=null&&Cr(e,i.scrollTop),i.scrollLeft!=null&&Hi(e,i.scrollLeft)}function To(e,t){var i=e.display,n=Qi(e.display);t.top<0&&(t.top=0);var r=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,s=mo(e),l={};t.bottom-t.top>s&&(t.bottom=t.top+s);var d=e.doc.height+po(i),f=t.top<n,g=t.bottom>d-n;if(t.top<r)l.scrollTop=f?0:t.top;else if(t.bottom>r+s){var N=Math.min(t.top,(g?d:t.bottom)-s);N!=r&&(l.scrollTop=N)}var H=e.options.fixedGutter?0:i.gutters.offsetWidth,ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-H,oe=Ui(e)-i.gutters.offsetWidth,Ae=t.right-t.left>oe;return Ae&&(t.right=t.left+oe),t.left<10?l.scrollLeft=0:t.left<ce?l.scrollLeft=Math.max(0,t.left+H-(Ae?0:10)):t.right>oe+ce-3&&(l.scrollLeft=t.right+(Ae?0:10)-oe),l}function Ro(e,t){if(t==null)return;Kr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function tr(e){Kr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function br(e,t,i){(t!=null||i!=null)&&Kr(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function qs(e,t){Kr(e),e.curOp.scrollToPos=t}function Kr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=fa(e,t.from),n=fa(e,t.to);_a(e,i,n,t.margin)}}function _a(e,t,i,n){var r=To(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-n,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+n});br(e,r.scrollLeft,r.scrollTop)}function Cr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;Z||Po(e,{top:t}),wa(e,t,!0),Z&&Po(e),_r(e,100)}function wa(e,t,i){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!i)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Hi(e,t,i,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Aa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xr(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+po(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+gi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Gi=function(e,t,i){this.cm=i;var n=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=r.tabIndex=-1,e(n),e(r),we(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),we(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,P&&L<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Gi.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}},Gi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Gi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Gi.prototype.zeroWidthHack=function(){var e=re&&!U?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Oe,this.disableVert=new Oe},Gi.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)},Gi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Er=function(){};Er.prototype.update=function(){return{bottom:0,right:0}},Er.prototype.setScrollLeft=function(){},Er.prototype.setScrollTop=function(){},Er.prototype.clear=function(){};function nr(e,t){t||(t=xr(e));var i=e.display.barWidth,n=e.display.barHeight;Sa(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&Vr(e),Sa(e,xr(e)),i=e.display.barWidth,n=e.display.barHeight}function Sa(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",i.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var ka={native:Gi,null:Er};function Ta(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ne(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ka[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),we(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"?Hi(e,t):Cr(e,t)},e),e.display.scrollbars.addClass&&Y(e.display.wrapper,e.display.scrollbars.addClass)}var Qs=0;function Vi(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},$t(e.curOp)}function Xi(e){var t=e.curOp;t&&un(t,function(i){for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;Zs(i)})}function Zs(e){for(var t=e.ops,i=0;i<t.length;i++)el(t[i]);for(var n=0;n<t.length;n++)tl(t[n]);for(var r=0;r<t.length;r++)nl(t[r]);for(var s=0;s<t.length;s++)il(t[s]);for(var l=0;l<t.length;l++)rl(t[l])}function el(e){var t=e.cm,i=t.display;al(t),e.updateMaxLine&&bi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ao(e.cm,e.update)}function nl(e){var t=e.cm,i=t.display;e.updatedDisplay&&Vr(t),e.barMeasure=xr(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=oa(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+gi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ui(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&&Hi(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)&&nr(t,e.barMeasure),e.updatedDisplay&&Lo(t,e.barMeasure),e.selectionChanged&&So(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Ca(e.cm)}function rl(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&Ra(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&wa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Hi(t,e.scrollLeft,!0,!0),e.scrollToPos){var r=Ys(t,o(n,e.scrollToPos.from),o(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,r)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var d=0;d<s.length;++d)s[d].lines.length||ke(s[d],"hide");if(l)for(var f=0;f<l.length;++f)l[f].lines.length&&ke(l[f],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ii(e,t){if(e.curOp)return t();Vi(e);try{return t()}finally{Xi(e)}}function In(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vi(e);try{return t.apply(e,arguments)}finally{Xi(e)}}}function Kn(e){return function(){if(this.curOp)return e.apply(this,arguments);Vi(this);try{return e.apply(this,arguments)}finally{Xi(this)}}}function jn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Vi(t);try{return e.apply(this,arguments)}finally{Xi(t)}}}function _r(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,_(ol,e))}function ol(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var i=+new Date+e.options.workTime,n=he(e,t.highlightFrontier),r=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(n.line>=e.display.viewFrom){var l=s.styles,d=s.text.length>e.options.maxHighlightLength?Xt(t.mode,n.state):null,f=G(e,s,n,!0);d&&(n.state=d),s.styles=f.styles;var g=s.styleClasses,N=f.classes;N?s.styleClasses=N:g&&(s.styleClasses=null);for(var H=!l||l.length!=s.styles.length||g!=N&&(!g||!N||g.bgClass!=N.bgClass||g.textClass!=N.textClass),ce=0;!H&&ce<l.length;++ce)H=l[ce]!=s.styles[ce];H&&r.push(n.line),s.stateAfter=n.save(),n.nextLine()}else s.text.length<=e.options.maxHighlightLength&&wt(e,s.text,n),s.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>i)return _r(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),r.length&&ii(e,function(){for(var s=0;s<r.length;s++)Ti(e,r[s],"text")})}var $r=function(e,t,i){var n=e.display;this.viewport=t,this.visible=Xr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ui(e),this.force=i,this.dims=Eo(e),this.events=[]};$r.prototype.signal=function(e,t){B(e,t)&&this.events.push(arguments)},$r.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.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=gi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=gi(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=k();if(!t||!C(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&C(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&&C(document.body,e.anchorNode)&&C(document.body,e.focusNode)){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}function Ao(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Ri(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&va(e)==0)return!1;Pa(e)&&(Ri(e),t.dims=Eo(e));var r=n.first+n.size,s=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(n.first,i.viewFrom)),i.viewTo>l&&i.viewTo-l<20&&(l=Math.min(r,i.viewTo)),ln&&(s=Si(e.doc,s),l=Ur(e.doc,l));var d=s!=i.viewFrom||l!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Xs(e,s,l),i.viewOffset=ni(yt(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var f=va(e);if(!d&&f==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var g=sl(e);return f>4&&(i.lineDiv.style.display="none"),ul(e,i.updateLineNumbers,t.dims),f>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,ll(g),ye(i.cursorDiv),ye(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,d&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,_r(e,400)),i.updateLineNumbers=null,!0}function Ra(e,t){for(var i=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Ui(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+po(e.display)-mo(e),i.top)}),t.visible=Xr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Xr(e.display,e.doc,i));if(!Ao(e,t))break;Vr(e);var r=xr(e);yr(e),nr(e,r),Lo(e,r),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Po(e,t){var i=new $r(e,t);if(Ao(e,i)){Vr(e),Ra(e,i);var n=xr(e);yr(e),nr(e,n),Lo(e,n),i.finish()}}function ul(e,t,i){var n=e.display,r=e.options.lineNumbers,s=n.lineDiv,l=s.firstChild;function d(Ae){var Ue=Ae.nextSibling;return R&&re&&e.display.currentWheelTarget==Ae?Ae.style.display="none":Ae.parentNode.removeChild(Ae),Ue}for(var f=n.view,g=n.viewFrom,N=0;N<f.length;N++){var H=f[N];if(!H.hidden)if(!H.node||H.node.parentNode!=s){var ce=Is(e,H,g,i);s.insertBefore(ce,l)}else{for(;l!=H.node;)l=d(l);var oe=r&&t!=null&&t<=g&&H.lineNumber;H.changes&&(Ce(H.changes,"gutter")>-1&&(oe=!1),pr(e,H,g,i)),oe&&(ye(H.lineNumber),H.lineNumber.appendChild(document.createTextNode(li(e.options,g)))),l=H.node.nextSibling}g+=H.size}for(;l;)l=d(l)}function Oo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function Lo(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+gi(e)+"px"}function Aa(e){var t=e.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_o(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,s=n+"px",l=0;l<i.length;l++)if(!i[l].hidden){e.options.fixedGutter&&(i[l].gutter&&(i[l].gutter.style.left=s),i[l].gutterBackground&&(i[l].gutterBackground.style.left=s));var d=i[l].alignable;if(d)for(var f=0;f<d.length;f++)d[f].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}function Pa(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=li(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(E("div",[E("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=r.firstChild.offsetWidth,l=r.offsetWidth-s;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(s,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",Oo(e.display),!0}return!1}function Mo(e,t){for(var i=[],n=!1,r=0;r<e.length;r++){var s=e[r],l=null;if(typeof s!="string"&&(l=s.style,s=s.className),s=="CodeMirror-linenumbers")if(t)n=!0;else continue;i.push({className:s,style:l})}return t&&!n&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Oa(e){var t=e.gutters,i=e.gutterSpecs;ye(t),e.lineGutter=null;for(var n=0;n<i.length;++n){var r=i[n],s=r.className,l=r.style,d=t.appendChild(E("div",null,"CodeMirror-gutter "+s));l&&(d.style.cssText=l),s=="CodeMirror-linenumbers"&&(e.lineGutter=d,d.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",Oo(e)}function wr(e){Oa(e.display),Jn(e),Aa(e)}function cl(e,t,i,n){var r=this;this.input=i,r.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=E("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=K("div",null,"CodeMirror-code"),r.selectionDiv=E("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=E("div",null,"CodeMirror-cursors"),r.measure=E("div",null,"CodeMirror-measure"),r.lineMeasure=E("div",null,"CodeMirror-measure"),r.lineSpace=K("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none");var s=K("div",[r.lineSpace],"CodeMirror-lines");r.mover=E("div",[s],null,"position: relative"),r.sizer=E("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=E("div",null,null,"position: absolute; height: "+Ve+"px; width: 1px;"),r.gutters=E("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=E("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=E("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),P&&L<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),!R&&!(Z&&ie)&&(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=Mo(n.gutters,n.lineNumbers),Oa(r),i.init(r)}var Yr=0,ai=null;P?ai=-.53:Z?ai=15:O?ai=-.7:ee&&(ai=-1/3);function La(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 hl(e){var t=La(e);return t.x*=ai,t.y*=ai,t}function Ma(e,t){var i=La(t),n=i.x,r=i.y,s=e.display,l=s.scroller,d=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight;if(!(n&&d||r&&f))return;if(r&&re&&R){e:for(var g=t.target,N=s.view;g!=l;g=g.parentNode)for(var H=0;H<N.length;H++)if(N[H].node==g){e.display.currentWheelTarget=g;break e}}if(n&&!Z&&!T&&ai!=null){r&&f&&Cr(e,Math.max(0,l.scrollTop+r*ai)),Hi(e,Math.max(0,l.scrollLeft+n*ai)),(!r||r&&f)&&b(t),s.wheelStartX=null;return}if(r&&ai!=null){var ce=r*ai,oe=e.doc.scrollTop,Ae=oe+s.wrapper.clientHeight;ce<0?oe=Math.max(0,oe+ce-50):Ae=Math.min(e.doc.height,Ae+ce+50),Po(e,{top:oe,bottom:Ae})}Yr<20&&(s.wheelStartX==null?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=n,s.wheelDY=r,setTimeout(function(){if(s.wheelStartX==null)return;var Ue=l.scrollLeft-s.wheelStartX,Ke=l.scrollTop-s.wheelStartY,et=Ke&&s.wheelDY&&Ke/s.wheelDY||Ue&&s.wheelDX&&Ue/s.wheelDX;if(s.wheelStartX=s.wheelStartY=null,!et)return;ai=(ai*Yr+et)/(Yr+1),++Yr},200)):(s.wheelDX+=n,s.wheelDY+=r))}var si=function(e,t){this.ranges=e,this.primIndex=t};si.prototype.primary=function(){return this.ranges[this.primIndex]},si.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(!on(i.anchor,n.anchor)||!on(i.head,n.head))return!1}return!0},si.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new an(hn(this.ranges[t].anchor),hn(this.ranges[t].head));return new si(e,this.primIndex)},si.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},si.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Ze(t,n.from())>=0&&Ze(e,n.to())<=0)return i}return-1};var an=function(e,t){this.anchor=e,this.head=t};an.prototype.from=function(){return En(this.anchor,this.head)},an.prototype.to=function(){return gn(this.anchor,this.head)},an.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function di(e,t,i){var n=e&&e.options.selectionsMayTouch,r=t[i];t.sort(function(ce,oe){return Ze(ce.from(),oe.from())}),i=Ce(t,r);for(var s=1;s<t.length;s++){var l=t[s],d=t[s-1],f=Ze(d.to(),l.from());if(n&&!l.empty()?f>0:f>=0){var g=En(d.from(),l.from()),N=gn(d.to(),l.to()),H=d.empty()?l.from()==l.head:d.from()==d.head;s<=i&&--i,t.splice(--s,2,new an(H?N:g,H?g:N))}}return new si(t,i)}function Ai(e,t){return new si([new an(e,t||e)],0)}function Pi(e){return e.text?De(e.from.line+e.text.length-1,Ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Da(e,t){if(Ze(e,t.from)<0)return e;if(Ze(e,t.to)<=0)return Pi(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+=Pi(t).ch-t.to.ch),De(i,n)}function Do(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new an(Da(r.anchor,t),Da(r.head,t)))}return di(e.cm,i,e.sel.primIndex)}function Na(e,t,i){return e.line==t.line?De(i.line,e.ch-t.ch+i.ch):De(i.line+(e.line-t.line),e.ch)}function dl(e,t,i){for(var n=[],r=De(e.first,0),s=r,l=0;l<t.length;l++){var d=t[l],f=Na(d.from,r,s),g=Na(Pi(d),r,s);if(r=d.to,s=g,i=="around"){var N=e.sel.ranges[l],H=Ze(N.head,N.anchor)<0;n[l]=new an(H?g:f,H?f:g)}else n[l]=new an(f,f)}return new si(n,e.sel.primIndex)}function No(e){e.doc.mode=gt(e.options,e.doc.modeOption),Sr(e)}function Sr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,_r(e,100),e.state.modeGen++,e.curOp&&Jn(e)}function Ia(e,t){return t.from.ch==0&&t.to.ch==0&&Ie(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Io(e,t,i,n){function r(mt){return i?i[mt]:null}function s(mt,tt,xt){uo(mt,tt,xt,n),dn(mt,"change",mt,t)}function l(mt,tt){for(var xt=[],Ut=mt;Ut<tt;++Ut)xt.push(new ki(g[Ut],r(Ut),n));return xt}var d=t.from,f=t.to,g=t.text,N=yt(e,d.line),H=yt(e,f.line),ce=Ie(g),oe=r(g.length-1),Ae=f.line-d.line;if(t.full)e.insert(0,l(0,g.length)),e.remove(g.length,e.size-g.length);else if(Ia(e,t)){var Ue=l(0,g.length-1);s(H,H.text,oe),Ae&&e.remove(d.line,Ae),Ue.length&&e.insert(d.line,Ue)}else if(N==H)if(g.length==1)s(N,N.text.slice(0,d.ch)+ce+N.text.slice(f.ch),oe);else{var Ke=l(1,g.length-1);Ke.push(new ki(ce+N.text.slice(f.ch),oe,n)),s(N,N.text.slice(0,d.ch)+g[0],r(0)),e.insert(d.line+1,Ke)}else if(g.length==1)s(N,N.text.slice(0,d.ch)+g[0]+H.text.slice(f.ch),r(0)),e.remove(d.line+1,Ae);else{s(N,N.text.slice(0,d.ch)+g[0],r(0)),s(H,ce+H.text.slice(f.ch),oe);var et=l(1,g.length-1);Ae>1&&e.remove(d.line+1,Ae-1),e.insert(d.line+1,et)}dn(e,"change",e,t)}function Oi(e,t,i){function n(r,s,l){if(r.linked)for(var d=0;d<r.linked.length;++d){var f=r.linked[d];if(f.doc==s)continue;var g=l&&f.sharedHist;if(i&&!g)continue;t(f.doc,g),n(f.doc,r,g)}}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,wo(e),No(e),Ba(e),e.options.lineWrapping||bi(e),e.options.mode=t.modeOption,Jn(e)}function Ba(e){(e.doc.direction=="rtl"?Y:ne)(e.display.lineDiv,"CodeMirror-rtl")}function fl(e){ii(e,function(){Ba(e),Jn(e)})}function Jr(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function jo(e,t){var i={from:hn(t.from),to:Pi(t),text:Yt(e,t.from,t.to)};return Wa(e,i,t.from.line,t.to.line+1),Oi(e,function(n){return Wa(n,i,t.from.line,t.to.line+1)},!0),i}function Ua(e){for(;e.length;){var t=Ie(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Ua(e.done),Ie(e.done);if(e.done.length&&!Ie(e.done).ranges)return Ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ie(e.done)}function Fa(e,t,i,n){var r=e.history;r.undone.length=0;var s=+new Date,l,d;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=pl(r,r.lastOp==n)))d=Ie(l.changes),Ze(t.from,t.to)==0&&Ze(t.from,d.to)==0?d.to=Pi(t):l.changes.push(jo(e,t));else{var f=Ie(r.done);for((!f||!f.ranges)&&qr(e.sel,r.done),l={changes:[jo(e,t)],generation:r.generation},r.done.push(l);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,d||ke(e,"historyAdded")}function ml(e,t,i,n){var r=t.charAt(0);return r=="*"||r=="+"&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,i,n){var r=e.history,s=n&&n.origin;i==r.lastSelOp||s&&r.lastSelOrigin==s&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==s||ml(e,s,Ie(r.done),t))?r.done[r.done.length-1]=t:qr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=s,r.lastSelOp=i,n&&n.clearRedo!==!1&&Ua(r.undone)}function qr(e,t){var i=Ie(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Wa(e,t,i,n){var r=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((r||(r=t["spans_"+e.id]={}))[s]=l.markedSpans),++s})}function vl(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function yl(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=[],r=0;r<t.text.length;++r)n.push(vl(i[r]));return n}function za(e,t){var i=yl(e,t),n=Fn(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var s=i[r],l=n[r];if(s&&l){e:for(var d=0;d<l.length;++d){for(var f=l[d],g=0;g<s.length;++g)if(s[g].marker==f.marker)continue e;s.push(f)}}else l&&(i[r]=l)}return i}function ir(e,t,i){for(var n=[],r=0;r<e.length;++r){var s=e[r];if(s.ranges){n.push(i?si.prototype.deepCopy.call(s):s);continue}var l=s.changes,d=[];n.push({changes:d});for(var f=0;f<l.length;++f){var g=l[f],N=void 0;if(d.push({from:g.from,to:g.to,text:g.text}),t)for(var H in g)(N=H.match(/^spans_(\d+)$/))&&(Ce(t,Number(N[1]))>-1&&(Ie(d)[H]=g[H],delete g[H]))}}return n}function Bo(e,t,i,n){if(n){var r=e.anchor;if(i){var s=Ze(t,r)<0;s!=Ze(i,r)<0?(r=t,t=i):s!=Ze(t,i)<0&&(t=i)}return new an(r,t)}else return new an(i||t,t)}function Qr(e,t,i,n,r){r==null&&(r=e.cm&&(e.cm.display.shift||e.extend)),Vn(e,new si([Bo(e.sel.primary(),t,i,r)],0),n)}function Ha(e,t,i){for(var n=[],r=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)n[s]=Bo(e.sel.ranges[s],t[s],null,r);var l=di(e.cm,n,e.sel.primIndex);Vn(e,l,i)}function Uo(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Vn(e,di(e.cm,r,e.sel.primIndex),n)}function Ga(e,t,i,n){Vn(e,Ai(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 an(o(e,r[s].anchor),o(e,r[s].head))},origin:i&&i.origin};return ke(e,"beforeSelectionChange",e,n),e.cm&&ke(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?di(e.cm,n.ranges,n.ranges.length-1):t}function Va(e,t,i){var n=e.history.done,r=Ie(n);r&&r.ranges?(n[n.length-1]=t,Zr(e,t,i)):Vn(e,t,i)}function Vn(e,t,i){Zr(e,t,i),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Zr(e,t,i){(B(e,"beforeSelectionChange")||e.cm&&B(e.cm,"beforeSelectionChange"))&&(t=bl(e,t,i));var n=i&&i.bias||(Ze(t.primary().head,e.sel.primary().head)<0?-1:1);Xa(e,$a(e,t,n,!0)),!(i&&i.scroll===!1)&&e.cm&&tr(e.cm)}function Xa(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,D(e.cm)),dn(e,"cursorActivity",e)}function Ka(e){Xa(e,$a(e,e.sel,null,!1))}function $a(e,t,i,n){for(var r,s=0;s<t.ranges.length;s++){var l=t.ranges[s],d=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],f=eo(e,l.anchor,d&&d.anchor,i,n),g=eo(e,l.head,d&&d.head,i,n);(r||f!=l.anchor||g!=l.head)&&(r||(r=t.ranges.slice(0,s)),r[s]=new an(f,g))}return r?di(e.cm,r,t.primIndex):t}function rr(e,t,i,n,r){var s=yt(e,t.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var d=s.markedSpans[l],f=d.marker,g="selectLeft"in f?!f.selectLeft:f.inclusiveLeft,N="selectRight"in f?!f.selectRight:f.inclusiveRight;if((d.from==null||(g?d.from<=t.ch:d.from<t.ch))&&(d.to==null||(N?d.to>=t.ch:d.to>t.ch))){if(r&&(ke(f,"beforeCursorEnter"),f.explicitlyCleared))if(s.markedSpans){--l;continue}else break;if(!f.atomic)continue;if(i){var H=f.find(n<0?1:-1),ce=void 0;if((n<0?N:g)&&(H=Ya(e,H,-n,H&&H.line==t.line?s:null)),H&&H.line==t.line&&(ce=Ze(H,i))&&(n<0?ce<0:ce>0))return rr(e,H,t,n,r)}var oe=f.find(n<0?-1:1);return(n<0?g:N)&&(oe=Ya(e,oe,n,oe.line==t.line?s:null)),oe?rr(e,oe,t,n,r):null}}return t}function eo(e,t,i,n,r){var s=n||1,l=rr(e,t,i,s,r)||!r&&rr(e,t,i,s,!0)||rr(e,t,i,-s,r)||!r&&rr(e,t,i,-s,!0);return l||(e.cantEdit=!0,De(e.first,0))}function Ya(e,t,i,n){return i<0&&t.ch==0?t.line>e.first?o(e,De(t.line-1)):null:i>0&&t.ch==(n||yt(e,t.line)).text.length?t.line<e.first+e.size-1?De(t.line+1,0):null:new De(t.line,t.ch+i)}function Ja(e){e.setSelection(De(e.firstLine(),0),De(e.lastLine()),_e)}function qa(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return i&&(n.update=function(r,s,l,d){r&&(n.from=o(e,r)),s&&(n.to=o(e,s)),l&&(n.text=l),d!==void 0&&(n.origin=d)}),ke(e,"beforeChange",e,n),e.cm&&ke(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 or(e,t,i){if(e.cm){if(!e.cm.curOp)return In(e.cm,or)(e,t,i);if(e.cm.state.suppressEdits)return}if((B(e,"beforeChange")||e.cm&&B(e.cm,"beforeChange"))&&(t=qa(e,t,!0),!t))return;var n=mn&&!i&&Ni(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)Qa(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text,origin:t.origin});else Qa(e,t)}function Qa(e,t){if(t.text.length==1&&t.text[0]==""&&Ze(t.from,t.to)==0)return;var i=Do(e,t);Fa(e,t,i,e.cm?e.cm.curOp.id:NaN),kr(e,t,i,Fn(e,t));var n=[];Oi(e,function(r,s){!s&&Ce(n,r.history)==-1&&(ns(r.history,t),n.push(r.history)),kr(r,t,null,Fn(r,t))})}function to(e,t,i){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!i)return;for(var r=e.history,s,l=e.sel,d=t=="undo"?r.done:r.undone,f=t=="undo"?r.undone:r.done,g=0;g<d.length&&!(s=d[g],i?s.ranges&&!s.equals(e.sel):!s.ranges);g++);if(g==d.length)return;for(r.lastOrigin=r.lastSelOrigin=null;;)if(s=d.pop(),s.ranges){if(qr(s,f),i&&!s.equals(e.sel)){Vn(e,s,{clearRedo:!1});return}l=s}else if(n){d.push(s);return}else break;var N=[];qr(l,f),f.push({changes:N,generation:r.generation}),r.generation=s.generation||++r.maxGeneration;for(var H=B(e,"beforeChange")||e.cm&&B(e.cm,"beforeChange"),ce=function(Ue){var Ke=s.changes[Ue];if(Ke.origin=t,H&&!qa(e,Ke,!1))return d.length=0,{};N.push(jo(e,Ke));var et=Ue?Do(e,Ke):Ie(d);kr(e,Ke,et,za(e,Ke)),!Ue&&e.cm&&e.cm.scrollIntoView({from:Ke.from,to:Pi(Ke)});var mt=[];Oi(e,function(tt,xt){!xt&&Ce(mt,tt.history)==-1&&(ns(tt.history,Ke),mt.push(tt.history)),kr(tt,Ke,null,za(tt,Ke))})},oe=s.changes.length-1;oe>=0;--oe){var Ae=ce(oe);if(Ae)return Ae.v}}function Za(e,t){if(t==0)return;if(e.first+=t,e.sel=new si(dt(e.sel.ranges,function(r){return new an(De(r.anchor.line+t,r.anchor.ch),De(r.head.line+t,r.head.ch))}),e.sel.primIndex),e.cm){Jn(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Ti(e.cm,n,"gutter")}}function kr(e,t,i,n){if(e.cm&&!e.cm.curOp)return In(e.cm,kr)(e,t,i,n);if(t.to.line<e.first){Za(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);Za(e,r),t={from:De(e.first,0),to:De(t.to.line+r,t.to.ch),text:[Ie(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:De(s,yt(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Yt(e,t.from,t.to),i||(i=Do(e,t)),e.cm?Cl(e.cm,t,n):Io(e,t,n),Zr(e,i,_e),e.cantEdit&&eo(e,De(e.firstLine(),0))&&(e.cantEdit=!1)}function Cl(e,t,i){var n=e.doc,r=e.display,s=t.from,l=t.to,d=!1,f=s.line;e.options.lineWrapping||(f=It(Ln(yt(n,s.line))),n.iter(f,l.line+1,function(oe){if(oe==r.maxLine)return d=!0,!0})),n.sel.contains(t.from,t.to)>-1&&D(e),Io(n,t,i,ga(e)),e.options.lineWrapping||(n.iter(f,s.line+t.text.length,function(oe){var Ae=Ji(oe);Ae>r.maxLineLength&&(r.maxLine=oe,r.maxLineLength=Ae,r.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),en(n,s.line),_r(e,400);var g=t.text.length-(l.line-s.line)-1;t.full?Jn(e):s.line==l.line&&t.text.length==1&&!Ia(e.doc,t)?Ti(e,s.line,"text"):Jn(e,s.line,l.line+1,g);var N=B(e,"changes"),H=B(e,"change");if(H||N){var ce={from:s,to:l,text:t.text,removed:t.removed,origin:t.origin};H&&dn(e,"change",e,ce),N&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(ce)}e.display.selForContextMenu=null}function ar(e,t,i,n,r){var s;n||(n=i),Ze(n,i)<0&&(s=[n,i],i=s[0],n=s[1]),typeof t=="string"&&(t=e.splitLines(t)),or(e,{from:i,to:n,text:t,origin:r})}function es(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ts(e,t,i,n){for(var r=0;r<e.length;++r){var s=e[r],l=!0;if(s.ranges){s.copied||(s=e[r]=s.deepCopy(),s.copied=!0);for(var d=0;d<s.ranges.length;d++)es(s.ranges[d].anchor,t,i,n),es(s.ranges[d].head,t,i,n);continue}for(var f=0;f<s.changes.length;++f){var g=s.changes[f];if(i<g.from.line)g.from=De(g.from.line+n,g.from.ch),g.to=De(g.to.line+n,g.to.ch);else if(t<=g.to.line){l=!1;break}}l||(e.splice(0,r+1),r=0)}}function ns(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;ts(e.done,i,n,r),ts(e.undone,i,n,r)}function Tr(e,t,i,n){var r=t,s=t;return typeof t=="number"?s=yt(e,h(e,t)):r=It(t),r==null?null:(n(s,r)&&e.cm&&Ti(e.cm,r,i),s)}function Rr(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}Rr.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,co(r),dn(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 Ar(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}Ar.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var s=Math.min(t,r-e),l=n.height;if(n.removeInner(e,s),this.height-=l-n.height,r==s&&(this.children.splice(i--,1),n.parent=null),(t-=s)==0)break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Rr))){var d=[];this.collapse(d),this.children=[new Rr(d)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<=s){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(var l=r.lines.length%25+25,d=l;d<r.lines.length;){var f=new Rr(r.lines.slice(d,d+=25));r.height-=f.height,this.children.splice(++n,0,f),f.parent=this}r.lines=r.lines.slice(0,l),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Ar(t);if(e.parent){e.size-=i.size,e.height-=i.height;var r=Ce(e.parent.children,e);e.parent.children.splice(r+1,0,i)}else{var n=new Ar(e.children);n.parent=e,e.children=[n,i],e=n}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var r=this.children[n],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e);if(r.iterN(e,l,i))return!0;if((t-=l)==0)break;e=0}else e-=s}}};var Pr=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.doc=e,this.node=t};Pr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,n=It(i);if(n==null||!t)return;for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var s=gr(this);qt(i,Math.max(0,i.height-s)),e&&(ii(e,function(){is(e,i,-s),Ti(e,n,"widget")}),dn(e,"lineWidgetCleared",e,this,n))},Pr.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,n=this.line;this.height=null;var r=gr(this)-t;if(!r)return;ci(this.doc,n)||qt(n,n.height+r),i&&ii(i,function(){i.curOp.forceUpdate=!0,is(i,n,r),dn(i,"lineWidgetChanged",i,e,It(n))})},I(Pr);function is(e,t,i){ni(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ro(e,i)}function xl(e,t,i,n){var r=new Pr(e,i,n),s=e.cm;return s&&r.noHScroll&&(s.display.alignWidgets=!0),Tr(e,t,"widget",function(l){var d=l.widgets||(l.widgets=[]);if(r.insertAt==null?d.push(r):d.splice(Math.min(d.length-1,Math.max(0,r.insertAt)),0,r),r.line=l,s&&!ci(e,l)){var f=ni(l)<e.scrollTop;qt(l,l.height+gr(r)),f&&Ro(s,r.height),s.curOp.forceUpdate=!0}return!0}),s&&dn(s,"lineWidgetAdded",s,r,typeof t=="number"?t:It(t)),r}var rs=0,Li=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++rs};Li.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vi(e),B(this,"clear")){var i=this.find();i&&dn(this,"clear",i.from,i.to)}for(var n=null,r=null,s=0;s<this.lines.length;++s){var l=this.lines[s],d=Pn(l.markedSpans,this);e&&!this.collapsed?Ti(e,It(l),"text"):e&&(d.to!=null&&(r=It(l)),d.from!=null&&(n=It(l))),l.markedSpans=Yn(l.markedSpans,d),d.from==null&&this.collapsed&&!ci(this.doc,l)&&e&&qt(l,Qi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var g=Ln(this.lines[f]),N=Ji(g);N>e.display.maxLineLength&&(e.display.maxLine=g,e.display.maxLineLength=N,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Jn(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ka(e.doc)),e&&dn(e,"markerCleared",e,this,n,r),t&&Xi(e),this.parent&&this.parent.clear()},Li.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var s=this.lines[r],l=Pn(s.markedSpans,this);if(l.from!=null&&(i=De(t?s:It(s),l.from),e==-1))return i;if(l.to!=null&&(n=De(t?s:It(s),l.to),e==1))return n}return i&&{from:i,to:n}},Li.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,n=this.doc.cm;if(!t||!n)return;ii(n,function(){var r=t.line,s=It(t.line),l=go(n,s);if(l&&(la(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ci(i.doc,r)&&i.height!=null){var d=i.height;i.height=null;var f=gr(i)-d;f&&qt(r,r.height+f)}dn(n,"markerChanged",n,e)})},Li.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ce(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Li.prototype.detachLine=function(e){if(this.lines.splice(Ce(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},I(Li);function sr(e,t,i,n,r){if(n&&n.shared)return El(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return In(e.cm,sr)(e,t,i,n,r);var s=new Li(e,r),l=Ze(t,i);if(n&&m(n,s,!1),l>0||l==0&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=K("span",[s.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(On(e,t.line,t,i,s)||t.line!=i.line&&On(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");wn()}s.addToHistory&&Fa(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var d=t.line,f=e.cm,g;if(e.iter(d,i.line+1,function(H){f&&s.collapsed&&!f.options.lineWrapping&&Ln(H)==f.display.maxLine&&(g=!0),s.collapsed&&d!=t.line&&qt(H,0),vn(H,new Sn(s,d==t.line?t.ch:null,d==i.line?i.ch:null)),++d}),s.collapsed&&e.iter(t.line,i.line+1,function(H){ci(e,H)&&qt(H,0)}),s.clearOnEnter&&we(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(tn(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++rs,s.atomic=!0),f){if(g&&(f.curOp.updateMaxLine=!0),s.collapsed)Jn(f,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var N=t.line;N<=i.line;N++)Ti(f,N,"text");s.atomic&&Ka(f.doc),dn(f,"markerAdded",f,s)}return s}var Or=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Or.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();dn(this,"clear")},Or.prototype.find=function(e,t){return this.primary.find(e,t)},I(Or);function El(e,t,i,n,r){n=m(n),n.shared=!1;var s=[sr(e,t,i,n,r)],l=s[0],d=n.widgetNode;return Oi(e,function(f){d&&(n.widgetNode=d.cloneNode(!0)),s.push(sr(f,o(f,t),o(f,i),n,r));for(var g=0;g<f.linked.length;++g)if(f.linked[g].isParent)return;l=Ie(s)}),new Or(s,l)}function os(e){return e.findMarks(De(e.first,0),e.clipPos(De(e.lastLine())),function(t){return t.parent})}function _l(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),s=e.clipPos(r.from),l=e.clipPos(r.to);if(Ze(s,l)){var d=sr(e,s,l,n.primary,n.primary.type);n.markers.push(d),d.parent=n}}}function wl(e){for(var t=function(n){var r=e[n],s=[r.primary.doc];Oi(r.primary.doc,function(f){return s.push(f)});for(var l=0;l<r.markers.length;l++){var d=r.markers[l];Ce(s,d.doc)==-1&&(d.parent=null,r.markers.splice(l--,1))}},i=0;i<e.length;i++)t(i)}var Sl=0,qn=function(e,t,i,n,r){if(!(this instanceof qn))return new qn(e,t,i,n,r);i==null&&(i=0),Ar.call(this,[new Rr([new ki("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=De(i,0);this.sel=Ai(s),this.history=new Jr(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=r=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Io(this,{from:s,to:s,text:e}),Vn(this,Ai(s),_e)};qn.prototype=Je(Ar.prototype,{constructor:qn,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=Mt(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:jn(function(e){var t=De(this.first,0),i=this.first+this.size-1;or(this,{from:t,to:De(i,yt(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&br(this.cm,0,0),Vn(this,Ai(t),_e)}),replaceRange:function(e,t,i,n){t=o(this,t),i=i?o(this,i):t,ar(this,e,t,i,n)},getRange:function(e,t,i){var n=Yt(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(oi(this,e))return yt(this,e)},getLineNumber:function(e){return It(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=yt(this,e)),Ln(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:jn(function(e,t,i){Ga(this,o(this,typeof e=="number"?De(e,t||0):e),null,i)}),setSelection:jn(function(e,t,i){Ga(this,o(this,e),o(this,t||e),i)}),extendSelection:jn(function(e,t,i){Qr(this,o(this,e),t&&o(this,t),i)}),extendSelections:jn(function(e,t){Ha(this,u(this,e),t)}),extendSelectionsBy:jn(function(e,t){var i=dt(this.sel.ranges,e);Ha(this,u(this,i),t)}),setSelections:jn(function(e,t,i){if(!e.length)return;for(var n=[],r=0;r<e.length;r++)n[r]=new an(o(this,e[r].anchor),o(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Vn(this,di(this.cm,n,t),i)}),addSelection:jn(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new an(o(this,e),o(this,t||e))),Vn(this,di(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=Yt(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=Yt(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:jn(function(e,t,i){for(var n=[],r=this.sel,s=0;s<r.ranges.length;s++){var l=r.ranges[s];n[s]={from:l.from(),to:l.to(),text:this.splitLines(e[s]),origin:i}}for(var d=t&&t!="end"&&dl(this,n,t),f=n.length-1;f>=0;f--)or(this,n[f]);d?Va(this,d):this.cm&&tr(this.cm)}),undo:jn(function(){to(this,"undo")}),redo:jn(function(){to(this,"redo")}),undoSelection:jn(function(){to(this,"undo",!0)}),redoSelection:jn(function(){to(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Jr(this.history.maxGeneration),Oi(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:ir(this.history.done),undone:ir(this.history.undone)}},setHistory:function(e){var t=this.history=new Jr(this.history.maxGeneration);t.done=ir(e.done.slice(0),null,!0),t.undone=ir(e.undone.slice(0),null,!0)},setGutterMarker:jn(function(e,t,i){return Tr(this,e,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&qe(r)&&(n.gutterMarkers=null),!0})}),clearGutter:jn(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Tr(t,i,"gutter",function(){return i.gutterMarkers[e]=null,qe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!oi(this,e))return null;if(t=e,e=yt(this,e),!e)return null}else if(t=It(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:jn(function(e,t,i){return Tr(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[r])n[r]=i;else{if(pe(i).test(n[r]))return!1;n[r]+=" "+i}return!0})}),removeLineClass:jn(function(e,t,i){return Tr(this,e,t=="gutter"?"gutter":"class",function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",s=n[r];if(s)if(i==null)n[r]=null;else{var l=s.match(pe(i));if(!l)return!1;var d=l.index+l[0].length;n[r]=s.slice(0,l.index)+(!l.index||d==s.length?"":" ")+s.slice(d)||null}else return!1;return!0})}),addLineWidget:jn(function(e,t,i){return xl(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return sr(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),sr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=o(this,e);var t=[],i=yt(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(r.from==null||r.from<=e.ch)&&(r.to==null||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=o(this,e),t=o(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(s){var l=s.markedSpans;if(l)for(var d=0;d<l.length;d++){var f=l[d];!(f.to!=null&&r==e.line&&e.ch>=f.to||f.from==null&&r!=e.line||f.from!=null&&r==t.line&&f.from>=t.ch)&&(!i||i(f.marker))&&n.push(f.marker.parent||f.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)i[n].from!=null&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first,n=this.lineSeparator().length;return this.iter(function(r){var s=r.text.length+n;if(s>e)return t=e,!0;e-=s,++i}),o(this,De(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 qn(Mt(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 qn(Mt(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}],_l(n,os(this)),n},unlinkDoc:function(e){if(e instanceof yn&&(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(os(this));break}if(e.history==this.history){var n=[e.id];Oi(e,function(r){return n.push(r.id)},!0),e.history=new Jr(null),e.history.done=ir(this.history.done,n),e.history.undone=ir(this.history.undone,n)}},iterLinkedDocs:function(e){Oi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):pt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:jn(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)})}),qn.prototype.eachLine=qn.prototype.iter;var as=0;function kl(e){var t=this;if(ss(t),Re(t,e)||Ci(t.display,e))return;b(e),P&&(as=+new Date);var i=Wi(t,e,!0),n=e.dataTransfer.files;if(!i||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,s=Array(r),l=0,d=function(){++l==r&&In(t,function(){i=o(t.doc,i);var oe={from:i,to:i,text:t.doc.splitLines(s.filter(function(Ae){return Ae!=null}).join(t.doc.lineSeparator())),origin:"paste"};or(t.doc,oe),Va(t.doc,Ai(o(t.doc,i),o(t.doc,Pi(oe))))})()},f=function(oe,Ae){if(t.options.allowDropFileTypes&&Ce(t.options.allowDropFileTypes,oe.type)==-1){d();return}var Ue=new FileReader;Ue.onerror=function(){return d()},Ue.onload=function(){var Ke=Ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Ke)){d();return}s[Ae]=Ke,d()},Ue.readAsText(oe)},g=0;g<n.length;g++)f(n[g],g);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 N=e.dataTransfer.getData("Text");if(N){var H;if(t.state.draggingText&&!t.state.draggingText.copy&&(H=t.listSelections()),Zr(t.doc,Ai(i,i)),H)for(var ce=0;ce<H.length;++ce)ar(t.doc,"",H[ce].anchor,H[ce].head,"drag");t.replaceSelection(N,"around","paste"),t.display.input.focus()}}catch(oe){}}}function Tl(e,t){if(P&&(!e.state.draggingText||+new Date-as<100)){A(t);return}if(Re(e,t)||Ci(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ee){var i=E("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),T&&i.parentNode.removeChild(i)}}function Rl(e,t){var i=Wi(e,t);if(!i)return;var n=document.createDocumentFragment();ba(e,i,n),e.display.dragCursor||(e.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),j(e.display.dragCursor,n)}function ss(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ls(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),i=[],n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&i.push(r)}i.length&&i[0].operation(function(){for(var s=0;s<i.length;s++)e(i[s])})}var us=!1;function Al(){if(us)return;Pl(),us=!0}function Pl(){var e;we(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ls(Ol)},100))}),we(window,"blur",function(){return ls(er)})}function Ol(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Mi={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"},Lr=0;Lr<10;Lr++)Mi[Lr+48]=Mi[Lr+96]=String(Lr);for(var no=65;no<=90;no++)Mi[no]=String.fromCharCode(no);for(var Mr=1;Mr<=12;Mr++)Mi[Mr+111]=Mi[Mr+63235]="F"+Mr;var xi={};xi.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"},xi.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"},xi.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"},xi.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"]},xi.default=re?xi.macDefault:xi.pcDefault;function Ll(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,n,r,s,l=0;l<t.length-1;l++){var d=t[l];if(/^(cmd|meta|m)$/i.test(d))s=!0;else if(/^a(lt)?$/i.test(d))i=!0;else if(/^(c|ctrl|control)$/i.test(d))n=!0;else if(/^s(hift)?$/i.test(d))r=!0;else throw new Error("Unrecognized modifier name: "+d)}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=dt(i.split(" "),Ll),s=0;s<r.length;s++){var l=void 0,d=void 0;s==r.length-1?(d=r.join(" "),l=n):(d=r.slice(0,s+1).join(" "),l="...");var f=t[d];if(!f)t[d]=l;else if(f!=l)throw new Error("Inconsistent bindings for "+d)}delete e[i]}for(var g in t)e[g]=t[g];return e}function lr(e,t,i,n){t=io(t);var r=t.call?t.call(e,n):t[e];if(r===!1)return"nothing";if(r==="...")return"multi";if(r!=null&&i(r))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return lr(e,t.fallthrough,i,n);for(var s=0;s<t.fallthrough.length;s++){var l=lr(e,t.fallthrough[s],i,n);if(l)return l}}}function cs(e){var t=typeof e=="string"?e:Mi[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function hs(e,t,i){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(le?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(le?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function ds(e,t){if(T&&e.keyCode==34&&e.char)return!1;var i=Mi[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),hs(i,e,t))}function io(e){return typeof e=="string"?xi[e]:e}function ur(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var s=t(i[r]);n.length&&Ze(s.from,Ie(n).to)<=0;){var l=n.pop();if(Ze(l.from,s.from)<0){s.from=l.from;break}}n.push(s)}ii(e,function(){for(var d=n.length-1;d>=0;d--)ar(e.doc,"",n[d].from,n[d].to,"+delete");tr(e)})}function Fo(e,t,i){var n=Fe(e.text,t+i,i);return n<0||n>e.text.length?null:n}function Wo(e,t,i){var n=Fo(e,t.ch,i);return n==null?null:new De(t.line,n,i<0?"after":"before")}function zo(e,t,i,n,r){if(e){t.doc.direction=="rtl"&&(r=-r);var s=bt(i,t.doc.direction);if(s){var l=r<0?Ie(s):s[0],d=r<0==(l.level==1),f=d?"after":"before",g;if(l.level>0||t.doc.direction=="rtl"){var N=qi(t,i);g=r<0?i.text.length-1:0;var H=vi(t,N,g).top;g=Lt(function(ce){return vi(t,N,ce).top==H},r<0==(l.level==1)?l.from:l.to-1,g),f=="before"&&(g=Fo(i,g,1))}else g=r<0?l.to:l.from;return new De(n,g,f)}}return new De(n,r<0?i.text.length:0,r<0?"before":"after")}function Dl(e,t,i,n){var r=bt(t,e.doc.direction);if(!r)return Wo(t,i,n);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=st(r,i.ch,i.sticky),l=r[s];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>i.ch:l.from<i.ch))return Wo(t,i,n);var d=function(et,mt){return Fo(t,et instanceof De?et.ch:et,mt)},f,g=function(et){return e.options.lineWrapping?(f=f||qi(e,t),ma(e,t,f,et)):{begin:0,end:t.text.length}},N=g(i.sticky=="before"?d(i,-1):i.ch);if(e.doc.direction=="rtl"||l.level==1){var H=l.level==1==n<0,ce=d(i,H?1:-1);if(ce!=null&&(H?ce<=l.to&&ce<=N.end:ce>=l.from&&ce>=N.begin)){var oe=H?"before":"after";return new De(i.line,ce,oe)}}var Ae=function(et,mt,tt){for(var xt=function(pn,Bn){return Bn?new De(i.line,d(pn,1),"before"):new De(i.line,pn,"after")};et>=0&&et<r.length;et+=mt){var Ut=r[et],jt=mt>0==(Ut.level!=1),Vt=jt?tt.begin:d(tt.end,-1);if(Ut.from<=Vt&&Vt<Ut.to)return xt(Vt,jt);if(Vt=jt?Ut.from:d(Ut.to,-1),tt.begin<=Vt&&Vt<tt.end)return xt(Vt,jt)}},Ue=Ae(s+n,n,N);if(Ue)return Ue;var Ke=n>0?N.end:d(N.begin,-1);return Ke!=null&&!(n>0&&Ke==t.text.length)&&(Ue=Ae(n>0?0:r.length-1,n,g(Ke)),Ue)?Ue:null}var Dr={selectAll:Ja,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),_e)},killLine:function(e){return ur(e,function(t){if(t.empty()){var i=yt(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:De(t.head.line+1,0)}:{from:t.head,to:De(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return ur(e,function(t){return{from:De(t.from().line,0),to:o(e.doc,De(t.to().line+1,0))}})},delLineLeft:function(e){return ur(e,function(t){return{from:De(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return ur(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 ur(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(De(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(De(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return fs(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ps(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Se)},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")},Se)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ps(e,t.head):n},Se)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var s=i[r].from(),l=Q(e.getLine(s.line),s.ch,n);t.push(w(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ii(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=yt(e.doc,r.line).text;if(s){if(r.ch==s.length&&(r=new De(r.line,r.ch-1)),r.ch>0)r=new De(r.line,r.ch+1),e.replaceRange(s.charAt(r.ch-1)+s.charAt(r.ch-2),De(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var l=yt(e.doc,r.line-1).text;l&&(r=new De(r.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),De(r.line-1,l.length-1),r,"+transpose"))}}i.push(new an(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){return ii(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);tr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function fs(e,t){var i=yt(e.doc,t),n=Ln(i);return n!=i&&(t=It(n)),zo(!0,e,n,t,1)}function Nl(e,t){var i=yt(e.doc,t),n=mi(i);return n!=i&&(t=It(n)),zo(!0,e,i,t,-1)}function ps(e,t){var i=fs(e,t.line),n=yt(e.doc,i.line),r=bt(n,e.doc.direction);if(!r||r[0].level==0){var s=Math.max(i.ch,n.text.search(/\S/)),l=t.line==i.line&&t.ch<=s&&t.ch;return De(i.line,l?0:s,i.sticky)}return i}function ro(e,t,i){if(typeof t=="string"&&(t=Dr[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)!=$e}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function Il(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=lr(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&lr(t,e.options.extraKeys,i,e)||lr(t,e.options.keyMap,i,e)}var jl=new Oe;function Nr(e,t,i,n){var r=e.state.keySeq;if(r){if(cs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),ms(e,r+" "+t,i,n))return!0}return ms(e,t,i,n)}function ms(e,t,i,n){var r=Il(e,t,n);return r=="multi"&&(e.state.keySeq=t),r=="handled"&&dn(e,"keyHandled",e,t,i),(r=="handled"||r=="multi")&&(b(i),So(e)),!!r}function gs(e,t){var i=ds(t,!0);return i?t.shiftKey&&!e.state.keySeq?Nr(e,"Shift-"+i,t,function(n){return ro(e,n,!0)})||Nr(e,i,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return ro(e,n)}):Nr(e,i,t,function(n){return ro(e,n)}):!1}function Bl(e,t,i){return Nr(e,"'"+i+"'",t,function(n){return ro(e,n,!0)})}var Ho=null;function vs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=k(),Re(t,e))return;P&&L<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var n=gs(t,e);T&&(Ho=n?i:null,!n&&i==88&&!Dt&&(re?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),Z&&!re&&!n&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ul(t)}function Ul(e){var t=e.display.lineDiv;Y(t,"CodeMirror-crosshair");function i(n){(n.keyCode==18||!n.altKey)&&(ne(t,"CodeMirror-crosshair"),lt(document,"keyup",i),lt(document,"mouseover",i))}we(document,"keyup",i),we(document,"mouseover",i)}function ys(e){e.keyCode==16&&(this.doc.sel.shift=!1),Re(this,e)}function bs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ci(t.display,e)||Re(t,e)||e.ctrlKey&&!e.altKey||re&&e.metaKey)return;var i=e.keyCode,n=e.charCode;if(T&&i==Ho){Ho=null,b(e);return}if(T&&(!e.which||e.which<10)&&gs(t,e))return;var r=String.fromCharCode(n==null?i:n);if(r=="\b")return;if(Bl(t,e,r))return;t.display.input.onKeyPress(e)}var Fl=400,Go=function(e,t,i){this.time=e,this.pos=t,this.button=i};Go.prototype.compare=function(e,t,i){return this.time+Fl>e&&Ze(t,this.pos)==0&&i==this.button};var Ir,jr;function Wl(e,t){var i=+new Date;return jr&&jr.compare(i,e,t)?(Ir=jr=null,"triple"):Ir&&Ir.compare(i,e,t)?(jr=new Go(i,e,t),Ir=null,"double"):(Ir=new Go(i,e,t),jr=null,"single")}function Cs(e){var t=this,i=t.display;if(Re(t,e)||i.activeTouch&&i.input.supportsTouch())return;if(i.input.ensurePolled(),i.shift=e.shiftKey,Ci(i,e)){R||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(Vo(t,e))return;var n=Wi(t,e),r=ge(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?Gl(t,n,s,e):ae(e)==i.scroller&&b(e):r==2?(n&&Qr(t.doc,n),setTimeout(function(){return i.input.focus()},20)):r==3&&(v?t.display.input.onContextMenu(e):xa(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,Nr(e,hs(s,r),r,function(l){if(typeof l=="string"&&(l=Dr[l]),!l)return!1;var d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d=l(e,i)!=$e}finally{e.state.suppressEdits=!1}return d})}function Hl(e,t,i){var n=e.getOption("configureMouse"),r=n?n(e,t,i):{};if(r.unit==null){var s=be?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=re?i.metaKey:i.ctrlKey),r.moveOnDrag==null&&(r.moveOnDrag=!(re?i.altKey:i.ctrlKey)),r}function Gl(e,t,i,n){P?setTimeout(_(Ca,e),0):e.curOp.focus=k();var r=Hl(e,i,n),s=e.doc.sel,l;e.options.dragDrop&&xe&&!e.isReadOnly()&&i=="single"&&(l=s.contains(t))>-1&&(Ze((l=s.ranges[l]).from(),t)<0||t.xRel>0)&&(Ze(l.to(),t)>0||t.xRel<0)?Vl(e,n,t,r):Xl(e,n,t,r)}function Vl(e,t,i,n){var r=e.display,s=!1,l=In(e,function(g){R&&(r.scroller.draggable=!1),e.state.draggingText=!1,lt(r.wrapper.ownerDocument,"mouseup",l),lt(r.wrapper.ownerDocument,"mousemove",d),lt(r.scroller,"dragstart",f),lt(r.scroller,"drop",l),s||(b(g),n.addNew||Qr(e.doc,i,null,null,n.extend),R&&!ee||P&&L==9?setTimeout(function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()},20):r.input.focus())}),d=function(g){s=s||Math.abs(t.clientX-g.clientX)+Math.abs(t.clientY-g.clientY)>=10},f=function(){return s=!0};R&&(r.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),we(r.wrapper.ownerDocument,"mouseup",l),we(r.wrapper.ownerDocument,"mousemove",d),we(r.scroller,"dragstart",f),we(r.scroller,"drop",l),xa(e),setTimeout(function(){return r.input.focus()},20)}function xs(e,t,i){if(i=="char")return new an(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new an(De(t.line,0),o(e.doc,De(t.line+1,0)));var n=i(e,t);return new an(n.from,n.to)}function Xl(e,t,i,n){var r=e.display,s=e.doc;b(t);var l,d,f=s.sel,g=f.ranges;if(n.addNew&&!n.extend?(d=s.sel.contains(i),d>-1?l=g[d]:l=new an(i,i)):(l=s.sel.primary(),d=s.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new an(i,i)),i=Wi(e,t,!0,!0),d=-1;else{var N=xs(e,i,n.unit);n.extend?l=Bo(l,N.anchor,N.head,n.extend):l=N}n.addNew?d==-1?(d=g.length,Vn(s,di(e,g.concat([l]),d),{scroll:!1,origin:"*mouse"})):g.length>1&&g[d].empty()&&n.unit=="char"&&!n.extend?(Vn(s,di(e,g.slice(0,d).concat(g.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),f=s.sel):Uo(s,d,l,Le):(d=0,Vn(s,new si([l],0),Le),f=s.sel);var H=i;function ce(tt){if(Ze(H,tt)==0)return;if(H=tt,n.unit=="rectangle"){for(var xt=[],Ut=e.options.tabSize,jt=Q(yt(s,i.line).text,i.ch,Ut),Vt=Q(yt(s,tt.line).text,tt.ch,Ut),pn=Math.min(jt,Vt),Bn=Math.max(jt,Vt),xn=Math.min(i.line,tt.line),ri=Math.min(e.lastLine(),Math.max(i.line,tt.line));xn<=ri;xn++){var Qn=yt(s,xn).text,Rn=Te(Qn,pn,Ut);pn==Bn?xt.push(new an(De(xn,Rn),De(xn,Rn))):Qn.length>Rn&&xt.push(new an(De(xn,Rn),De(xn,Te(Qn,Bn,Ut))))}xt.length||xt.push(new an(i,i)),Vn(s,di(e,f.ranges.slice(0,d).concat(xt),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(tt)}else{var Zn=l,Gn=xs(e,tt,n.unit),Mn=Zn.anchor,An;Ze(Gn.anchor,Mn)>0?(An=Gn.head,Mn=En(Zn.from(),Gn.anchor)):(An=Gn.anchor,Mn=gn(Zn.to(),Gn.head));var _n=f.ranges.slice(0);_n[d]=Kl(e,new an(o(s,Mn),An)),Vn(s,di(e,_n,d),Le)}}var oe=r.wrapper.getBoundingClientRect(),Ae=0;function Ue(tt){var xt=++Ae,Ut=Wi(e,tt,!0,n.unit=="rectangle");if(!Ut)return;if(Ze(Ut,H)!=0){e.curOp.focus=k(),ce(Ut);var jt=Xr(r,s);(Ut.line>=jt.to||Ut.line<jt.from)&&setTimeout(In(e,function(){Ae==xt&&Ue(tt)}),150)}else{var Vt=tt.clientY<oe.top?-20:tt.clientY>oe.bottom?20:0;Vt&&setTimeout(In(e,function(){if(Ae!=xt)return;r.scroller.scrollTop+=Vt,Ue(tt)}),50)}}function Ke(tt){e.state.selectingText=!1,Ae=Infinity,tt&&(b(tt),r.input.focus()),lt(r.wrapper.ownerDocument,"mousemove",et),lt(r.wrapper.ownerDocument,"mouseup",mt),s.history.lastSelOrigin=null}var et=In(e,function(tt){tt.buttons===0||!ge(tt)?Ke(tt):Ue(tt)}),mt=In(e,Ke);e.state.selectingText=mt,we(r.wrapper.ownerDocument,"mousemove",et),we(r.wrapper.ownerDocument,"mouseup",mt)}function Kl(e,t){var i=t.anchor,n=t.head,r=yt(e.doc,i.line);if(Ze(i,n)==0&&i.sticky==n.sticky)return t;var s=bt(r);if(!s)return t;var l=st(s,i.ch,i.sticky),d=s[l];if(d.from!=i.ch&&d.to!=i.ch)return t;var f=l+(d.from==i.ch==(d.level!=1)?0:1);if(f==0||f==s.length)return t;var g;if(n.line!=i.line)g=(n.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var N=st(s,n.ch,n.sticky),H=N-l||(n.ch-i.ch)*(d.level==1?-1:1);N==f-1||N==f?g=H<0:g=H>0}var ce=s[f+(g?-1:0)],oe=g==(ce.level==1),Ae=oe?ce.from:ce.to,Ue=oe?"after":"before";return i.ch==Ae&&i.sticky==Ue?t:new an(new De(i.line,Ae,Ue),n)}function Es(e,t,i,n){var r,s;if(t.touches)r=t.touches[0].clientX,s=t.touches[0].clientY;else try{r=t.clientX,s=t.clientY}catch(ce){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&b(t);var l=e.display,d=l.lineDiv.getBoundingClientRect();if(s>d.bottom||!B(e,i))return S(t);s-=d.top-l.viewOffset;for(var f=0;f<e.display.gutterSpecs.length;++f){var g=l.gutters.childNodes[f];if(g&&g.getBoundingClientRect().right>=r){var N=bn(e.doc,s),H=e.display.gutterSpecs[f];return ke(e,i,e,N,H.className,t),S(t)}}}function Vo(e,t){return Es(e,t,"gutterClick",!0)}function _s(e,t){if(Ci(e.display,t)||$l(e,t))return;if(Re(e,t,"contextmenu"))return;v||e.display.input.onContextMenu(t)}function $l(e,t){return B(e,"gutterContextMenu")?Es(e,t,"gutterContextMenu",!1):!1}function ws(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vr(e)}var cr={toString:function(){return"CodeMirror.Init"}},Ss={},oo={};function Yl(e){var t=e.optionHandlers;function i(n,r,s,l){e.defaults[n]=r,s&&(t[n]=l?function(d,f,g){g!=cr&&s(d,f,g)}:s)}e.defineOption=i,e.Init=cr,i("value","",function(n,r){return n.setValue(r)},!0),i("mode",null,function(n,r){n.doc.modeOption=r,No(n)},!0),i("indentUnit",2,No,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(n){Sr(n),vr(n),Jn(n)},!0),i("lineSeparator",null,function(n,r){if(n.doc.lineSep=r,!r)return;var s=[],l=n.doc.first;n.doc.iter(function(f){for(var g=0;;){var N=f.text.indexOf(r,g);if(N==-1)break;g=N+r.length,s.push(De(l,N))}l++});for(var d=s.length-1;d>=0;d--)ar(n.doc,r,s[d],De(s[d].line,s[d].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!=cr&&n.refresh()}),i("specialCharPlaceholder",Rt,function(n){return n.refresh()},!0),i("electricChars",!0),i("inputStyle",ie?"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",!je),i("wholeLineUpdateBefore",!0),i("theme","default",function(n){ws(n),wr(n)},!0),i("keyMap","default",function(n,r,s){var l=io(r),d=s!=cr&&io(s);d&&d.detach&&d.detach(n,l),l.attach&&l.attach(n,d||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,ql,!0),i("gutters",[],function(n,r){n.display.gutterSpecs=Mo(r,n.options.lineNumbers),wr(n)},!0),i("fixedGutter",!0,function(n,r){n.display.gutters.style.left=r?_o(n.display)+"px":"0",n.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(n){return nr(n)},!0),i("scrollbarStyle","native",function(n){Ta(n),nr(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=Mo(n.options.gutters,r),wr(n)},!0),i("firstLineNumber",1,wr,!0),i("lineNumberFormatter",function(n){return n},wr,!0),i("showCursorWhenSelecting",!1,yr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(n,r){r=="nocursor"&&(er(n),n.display.input.blur()),n.display.input.readOnlyChanged(r)}),i("screenReaderLabel",null,function(n,r){r=r===""?null:r,n.display.input.screenReaderLabelChanged(r)}),i("disableInput",!1,function(n,r){r||n.display.input.reset()},!0),i("dragDrop",!0,Jl),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yr,!0),i("singleCursorHeightPerLine",!0,yr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Sr,!0),i("addModeClass",!1,Sr,!0),i("pollInterval",100),i("undoDepth",200,function(n,r){return n.doc.history.undoDepth=r}),i("historyEventDelay",1250),i("viewportMargin",10,function(n){return n.refresh()},!0),i("maxHighlightLength",1e4,Sr,!0),i("moveInputWithCursor",!0,function(n,r){r||n.display.input.resetPosition()}),i("tabindex",null,function(n,r){return n.display.input.getField().tabIndex=r||""}),i("autofocus",null),i("direction","ltr",function(n,r){return n.doc.setDirection(r)},!0),i("phrases",null)}function Jl(e,t,i){var n=i&&i!=cr;if(!t!=!n){var r=e.display.dragFunctions,s=t?we:lt;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 ql(e){e.options.lineWrapping?(Y(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ne(e.display.wrapper,"CodeMirror-wrap"),bi(e)),wo(e),Jn(e),vr(e),setTimeout(function(){return nr(e)},100)}function yn(e,t){var i=this;if(!(this instanceof yn))return new yn(e,t);this.options=t=t?m(t):{},m(Ss,t,!1);var n=t.value;typeof n=="string"?n=new qn(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var r=new yn.inputStyles[t.inputStyle](this),s=this.display=new cl(e,n,r,t);s.wrapper.CodeMirror=this,ws(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ta(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Oe,keySeq:null,specialChars:null},t.autofocus&&!ie&&s.input.focus(),P&&L<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Ql(this),Al(),Vi(this),this.curOp.forceUpdate=!0,ja(this,n),t.autofocus&&!ie||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ko(i)},20):er(this);for(var l in oo)oo.hasOwnProperty(l)&&oo[l](this,t[l],cr);Pa(this),t.finishInit&&t.finishInit(this);for(var d=0;d<Xo.length;++d)Xo[d](this);Xi(this),R&&t.lineWrapping&&getComputedStyle(s.lineDiv).textRendering=="optimizelegibility"&&(s.lineDiv.style.textRendering="auto")}yn.defaults=Ss,yn.optionHandlers=oo;function Ql(e){var t=e.display;we(t.scroller,"mousedown",In(e,Cs)),P&&L<11?we(t.scroller,"dblclick",In(e,function(f){if(Re(e,f))return;var g=Wi(e,f);if(!g||Vo(e,f)||Ci(e.display,f))return;b(f);var N=e.findWordAt(g);Qr(e.doc,N.anchor,N.head)})):we(t.scroller,"dblclick",function(f){return Re(e,f)||b(f)}),we(t.scroller,"contextmenu",function(f){return _s(e,f)}),we(t.input.getField(),"contextmenu",function(f){t.scroller.contains(f.target)||_s(e,f)});var i,n={end:0};function r(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function s(f){if(f.touches.length!=1)return!1;var g=f.touches[0];return g.radiusX<=1&&g.radiusY<=1}function l(f,g){if(g.left==null)return!0;var N=g.left-f.left,H=g.top-f.top;return N*N+H*H>20*20}we(t.scroller,"touchstart",function(f){if(!Re(e,f)&&!s(f)&&!Vo(e,f)){t.input.ensurePolled(),clearTimeout(i);var g=+new Date;t.activeTouch={start:g,moved:!1,prev:g-n.end<=300?n:null},f.touches.length==1&&(t.activeTouch.left=f.touches[0].pageX,t.activeTouch.top=f.touches[0].pageY)}}),we(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),we(t.scroller,"touchend",function(f){var g=t.activeTouch;if(g&&!Ci(t,f)&&g.left!=null&&!g.moved&&new Date-g.start<300){var N=e.coordsChar(t.activeTouch,"page"),H;!g.prev||l(g,g.prev)?H=new an(N,N):!g.prev.prev||l(g,g.prev.prev)?H=e.findWordAt(N):H=new an(De(N.line,0),o(e.doc,De(N.line+1,0))),e.setSelection(H.anchor,H.head),e.focus(),b(f)}r()}),we(t.scroller,"touchcancel",r),we(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Cr(e,t.scroller.scrollTop),Hi(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),we(t.scroller,"mousewheel",function(f){return Ma(e,f)}),we(t.scroller,"DOMMouseScroll",function(f){return Ma(e,f)}),we(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(f){Re(e,f)||A(f)},over:function(f){Re(e,f)||(Rl(e,f),A(f))},start:function(f){return Tl(e,f)},drop:In(e,kl),leave:function(f){Re(e,f)||ss(e)}};var d=t.input.getField();we(d,"keyup",function(f){return ys.call(e,f)}),we(d,"keydown",In(e,vs)),we(d,"keypress",In(e,bs)),we(d,"focus",function(f){return ko(e,f)}),we(d,"blur",function(f){return er(e,f)})}var Xo=[];yn.defineInitHook=function(e){return Xo.push(e)};function Br(e,t,i,n){var r=e.doc,s;i==null&&(i="add"),i=="smart"&&(r.mode.indent?s=he(e,t).state:i="prev");var l=e.options.tabSize,d=yt(r,t),f=Q(d.text,null,l);d.stateAfter&&(d.stateAfter=null);var g=d.text.match(/^\s*/)[0],N;if(!n&&!/\S/.test(d.text))N=0,i="not";else if(i=="smart"&&(N=r.mode.indent(s,d.text.slice(g.length),d.text),N==$e||N>150)){if(!n)return;i="prev"}i=="prev"?t>r.first?N=Q(yt(r,t-1).text,null,l):N=0:i=="add"?N=f+e.options.indentUnit:i=="subtract"?N=f-e.options.indentUnit:typeof i=="number"&&(N=f+i),N=Math.max(0,N);var H="",ce=0;if(e.options.indentWithTabs)for(var oe=Math.floor(N/l);oe;--oe)ce+=l,H+=" ";if(ce<N&&(H+=w(N-ce)),H!=g)return ar(r,H,De(t,0),De(t,g.length),"+input"),d.stateAfter=null,!0;for(var Ae=0;Ae<r.sel.ranges.length;Ae++){var Ue=r.sel.ranges[Ae];if(Ue.head.line==t&&Ue.head.ch<g.length){var Ke=De(t,g.length);Uo(r,Ae,new an(Ke,Ke));break}}}var fi=null;function ao(e){fi=e}function Ko(e,t,i,n,r){var s=e.doc;e.display.shift=!1,n||(n=s.sel);var l=+new Date-200,d=r=="paste"||e.state.pasteIncoming>l,f=pt(t),g=null;if(d&&n.ranges.length>1)if(fi&&fi.text.join(`
`)==t){if(n.ranges.length%fi.text.length==0){g=[];for(var N=0;N<fi.text.length;N++)g.push(s.splitLines(fi.text[N]))}}else f.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(g=dt(f,function(et){return[et]}));for(var H=e.curOp.updateInput,ce=n.ranges.length-1;ce>=0;ce--){var oe=n.ranges[ce],Ae=oe.from(),Ue=oe.to();oe.empty()&&(i&&i>0?Ae=De(Ae.line,Ae.ch-i):e.state.overwrite&&!d?Ue=De(Ue.line,Math.min(yt(s,Ue.line).text.length,Ue.ch+Ie(f).length)):d&&fi&&fi.lineWise&&fi.text.join(`
`)==f.join(`
`)&&(Ae=Ue=De(Ae.line,0)));var Ke={from:Ae,to:Ue,text:g?g[ce%g.length]:f,origin:r||(d?"paste":e.state.cutIncoming>l?"cut":"+input")};or(e.doc,Ke),dn(e,"inputRead",e,Ke)}t&&!d&&Ts(e,t),tr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=H),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ks(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&ii(t,function(){return Ko(t,i,0,null,"paste")}),!0}function Ts(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var i=e.doc.sel,n=i.ranges.length-1;n>=0;n--){var r=i.ranges[n];if(r.head.ch>100||n&&i.ranges[n-1].head.line==r.head.line)continue;var s=e.getModeAt(r.head),l=!1;if(s.electricChars){for(var d=0;d<s.electricChars.length;d++)if(t.indexOf(s.electricChars.charAt(d))>-1){l=Br(e,r.head.line,"smart");break}}else s.electricInput&&(s.electricInput.test(yt(e.doc,r.head.line).text.slice(0,r.head.ch))&&(l=Br(e,r.head.line,"smart")));l&&dn(e,"electricInput",e,r.head.line)}}function Rs(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:De(r,0),head:De(r+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function As(e,t,i,n){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Ps(){var e=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=E("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return R?e.style.width="1000px":e.setAttribute("wrap","off"),V&&(e.style.border="1px solid black"),As(e),t}function Zl(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,r){var s=this.options,l=s[n];if(s[n]==r&&n!="mode")return;s[n]=r,t.hasOwnProperty(n)&&In(this,t[n])(this,r,l),ke(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,r){this.state.keyMaps[r?"push":"unshift"](io(n))},removeKeyMap:function(n){for(var r=this.state.keyMaps,s=0;s<r.length;++s)if(r[s]==n||r[s].name==n)return r.splice(s,1),!0},addOverlay:Kn(function(n,r){var s=n.token?n:e.getMode(this.options,n);if(s.startState)throw new Error("Overlays may not be stateful.");kt(this.state.overlays,{mode:s,modeSpec:n,opaque:r&&r.opaque,priority:r&&r.priority||0},function(l){return l.priority}),this.state.modeGen++,Jn(this)}),removeOverlay:Kn(function(n){for(var r=this.state.overlays,s=0;s<r.length;++s){var l=r[s].modeSpec;if(l==n||typeof n=="string"&&l.name==n){r.splice(s,1),this.state.modeGen++,Jn(this);return}}}),indentLine:Kn(function(n,r,s){typeof r!="string"&&typeof r!="number"&&(r==null?r=this.options.smartIndent?"smart":"prev":r=r?"add":"subtract"),oi(this.doc,n)&&Br(this,n,r,s)}),indentSelection:Kn(function(n){for(var r=this.doc.sel.ranges,s=-1,l=0;l<r.length;l++){var d=r[l];if(d.empty())d.head.line>s&&(Br(this,d.head.line,n,!0),s=d.head.line,l==this.doc.sel.primIndex&&tr(this));else{var f=d.from(),g=d.to(),N=Math.max(s,f.line);s=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var H=N;H<s;++H)Br(this,H,n);var ce=this.doc.sel.ranges;f.ch==0&&r.length==ce.length&&ce[l].from().ch>0&&Uo(this.doc,l,new an(f,ce[l].to()),_e)}}}),getTokenAt:function(n,r){return rt(this,n,r)},getLineTokens:function(n,r){return rt(this,De(n),r,!0)},getTokenTypeAt:function(n){n=o(this.doc,n);var r=Ne(this,yt(this.doc,n.line)),s=0,l=(r.length-1)/2,d=n.ch,f;if(d==0)f=r[2];else for(;;){var g=s+l>>1;if((g?r[g*2-1]:0)>=d)l=g;else if(r[g*2+1]<d)s=g+1;else{f=r[g*2+2];break}}var N=f?f.indexOf("overlay "):-1;return N<0?f:N==0?null:f.slice(0,N-1)},getModeAt:function(n){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(n).state).mode:r},getHelper:function(n,r){return this.getHelpers(n,r)[0]},getHelpers:function(n,r){var s=[];if(!i.hasOwnProperty(r))return s;var l=i[r],d=this.getModeAt(n);if(typeof d[r]=="string")l[d[r]]&&s.push(l[d[r]]);else if(d[r])for(var f=0;f<d[r].length;f++){var g=l[d[r][f]];g&&s.push(g)}else d.helperType&&l[d.helperType]?s.push(l[d.helperType]):l[d.name]&&s.push(l[d.name]);for(var N=0;N<l._global.length;N++){var H=l._global[N];H.pred(d,this)&&Ce(s,H.val)==-1&&s.push(H.val)}return s},getStateAfter:function(n,r){var s=this.doc;return n=h(s,n==null?s.first+s.size-1:n),he(this,n+1,r).state},cursorCoords:function(n,r){var s,l=this.doc.sel.primary();return n==null?s=l.head:typeof n=="object"?s=o(this.doc,n):s=n?l.from():l.to(),hi(this,s,r||"page")},charCoords:function(n,r){return yo(this,o(this.doc,n),r||"page")},coordsChar:function(n,r){return n=da(this,n,r||"page"),Co(this,n.left,n.top)},lineAtHeight:function(n,r){return n=da(this,{top:n,left:0},r||"page").top,bn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,r,s){var l=!1,d;if(typeof n=="number"){var f=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>f&&(n=f,l=!0),d=yt(this.doc,n)}else d=n;return zr(this,d,{top:0,left:0},r||"page",s||l).top+(l?this.doc.height-ni(d):0)},defaultTextHeight:function(){return Qi(this.display)},defaultCharWidth:function(){return Zi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,r,s,l,d){var f=this.display;n=hi(this,o(this.doc,n));var g=n.bottom,N=n.left;if(r.style.position="absolute",r.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(r),f.sizer.appendChild(r),l=="over")g=n.top;else if(l=="above"||l=="near"){var H=Math.max(f.wrapper.clientHeight,this.doc.height),ce=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);(l=="above"||n.bottom+r.offsetHeight>H)&&n.top>r.offsetHeight?g=n.top-r.offsetHeight:n.bottom+r.offsetHeight<=H&&(g=n.bottom),N+r.offsetWidth>ce&&(N=ce-r.offsetWidth)}r.style.top=g+"px",r.style.left=r.style.right="",d=="right"?(N=f.sizer.clientWidth-r.offsetWidth,r.style.right="0px"):(d=="left"?N=0:d=="middle"&&(N=(f.sizer.clientWidth-r.offsetWidth)/2),r.style.left=N+"px"),s&&Js(this,{left:N,top:g,right:N+r.offsetWidth,bottom:g+r.offsetHeight})},triggerOnKeyDown:Kn(vs),triggerOnKeyPress:Kn(bs),triggerOnKeyUp:ys,triggerOnMouseDown:Kn(Cs),execCommand:function(n){if(Dr.hasOwnProperty(n))return Dr[n].call(null,this)},triggerElectric:Kn(function(n){Ts(this,n)}),findPosH:function(n,r,s,l){var d=1;r<0&&(d=-1,r=-r);for(var f=o(this.doc,n),g=0;g<r&&!(f=$o(this.doc,f,d,s,l),f.hitSide);++g);return f},moveH:Kn(function(n,r){var s=this;this.extendSelectionsBy(function(l){return s.display.shift||s.doc.extend||l.empty()?$o(s.doc,l.head,n,r,s.options.rtlMoveVisually):n<0?l.from():l.to()},Se)}),deleteH:Kn(function(n,r){var s=this.doc.sel,l=this.doc;s.somethingSelected()?l.replaceSelection("",null,"+delete"):ur(this,function(d){var f=$o(l,d.head,n,r,!1);return n<0?{from:f,to:d.head}:{from:d.head,to:f}})}),findPosV:function(n,r,s,l){var d=1,f=l;r<0&&(d=-1,r=-r);for(var g=o(this.doc,n),N=0;N<r;++N){var H=hi(this,g,"div");if(f==null?f=H.left:H.left=f,g=Os(this,H,d,s),g.hitSide)break}return g},moveV:Kn(function(n,r){var s=this,l=this.doc,d=[],f=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(N){if(f)return n<0?N.from():N.to();var H=hi(s,N.head,"div");N.goalColumn!=null&&(H.left=N.goalColumn),d.push(H.left);var ce=Os(s,H,n,r);return r=="page"&&N==l.sel.primary()&&Ro(s,yo(s,ce,"div").top-H.top),ce},Se),d.length)for(var g=0;g<l.sel.ranges.length;g++)l.sel.ranges[g].goalColumn=d[g]}),findWordAt:function(n){var r=this.doc,s=yt(r,n.line).text,l=n.ch,d=n.ch;if(s){var f=this.getHelper(n,"wordChars");(n.sticky=="before"||d==s.length)&&l?--l:++d;for(var g=s.charAt(l),N=Xe(g,f)?function(H){return Xe(H,f)}:/\s/.test(g)?function(H){return/\s/.test(H)}:function(H){return!/\s/.test(H)&&!Xe(H)};l>0&&N(s.charAt(l-1));)--l;for(;d<s.length&&N(s.charAt(d));)++d}return new an(De(n.line,l),De(n.line,d))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?Y(this.display.cursorDiv,"CodeMirror-overwrite"):ne(this.display.cursorDiv,"CodeMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==k()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Kn(function(n,r){br(this,n,r)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-gi(this)-this.display.barHeight,width:n.scrollWidth-gi(this)-this.display.barWidth,clientHeight:mo(this),clientWidth:Ui(this)}},scrollIntoView:Kn(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:De(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?qs(this,n):_a(this,n.from,n.to,n.margin)}),setSize:Kn(function(n,r){var s=this,l=function(f){return typeof f=="number"||/^\d+$/.test(String(f))?f+"px":f};n!=null&&(this.display.wrapper.style.width=l(n)),r!=null&&(this.display.wrapper.style.height=l(r)),this.options.lineWrapping&&ua(this);var d=this.display.viewFrom;this.doc.iter(d,this.display.viewTo,function(f){if(f.widgets){for(var g=0;g<f.widgets.length;g++)if(f.widgets[g].noHScroll){Ti(s,d,"widget");break}}++d}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(n){return ii(this,n)},startOperation:function(){return Vi(this)},endOperation:function(){return Xi(this)},refresh:Kn(function(){var n=this.display.cachedTextHeight;Jn(this),this.curOp.forceUpdate=!0,vr(this),br(this,this.doc.scrollLeft,this.doc.scrollTop),Oo(this.display),(n==null||Math.abs(n-Qi(this.display))>.5||this.options.lineWrapping)&&wo(this),ke(this,"refresh",this)}),swapDoc:Kn(function(n){var r=this.doc;return r.cm=null,this.state.selectingText&&this.state.selectingText(),ja(this,n),vr(this),this.display.input.reset(),br(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,dn(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}},I(e),e.registerHelper=function(n,r,s){i.hasOwnProperty(n)||(i[n]=e[n]={_global:[]}),i[n][r]=s},e.registerGlobalHelper=function(n,r,s,l){e.registerHelper(n,r,l),i[n]._global.push({pred:s,val:l})}}function $o(e,t,i,n,r){var s=t,l=i,d=yt(e,t.line),f=r&&e.direction=="rtl"?-i:i;function g(){var mt=t.line+f;return mt<e.first||mt>=e.first+e.size?!1:(t=new De(mt,t.ch,t.sticky),d=yt(e,mt))}function N(mt){var tt;if(n=="codepoint"){var xt=d.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(xt)?tt=null:tt=new De(t.line,Math.max(0,Math.min(d.text.length,t.ch+i*(xt>=55296&&xt<56320?2:1))),-i)}else r?tt=Dl(e.cm,d,t,i):tt=Wo(d,t,i);if(tt==null)if(!mt&&g())t=zo(r,e.cm,d,t.line,f);else return!1;else t=tt;return!0}if(n=="char"||n=="codepoint")N();else if(n=="column")N(!0);else if(n=="word"||n=="group")for(var H=null,ce=n=="group",oe=e.cm&&e.cm.getHelper(t,"wordChars"),Ae=!0;!(i<0&&!N(!Ae));Ae=!1){var Ue=d.text.charAt(t.ch)||`
`,Ke=Xe(Ue,oe)?"w":ce&&Ue==`
`?"n":!ce||/\s/.test(Ue)?null:"p";if(ce&&!Ae&&!Ke&&(Ke="s"),H&&H!=Ke){i<0&&(i=1,N(),t.sticky="after");break}if(Ke&&(H=Ke),i>0&&!N(!Ae))break}var et=eo(e,t,s,l,!0);return on(s,et)&&(et.hitSide=!0),et}function Os(e,t,i,n){var r=e.doc,s=t.left,l;if(n=="page"){var d=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),f=Math.max(d-.5*Qi(e.display),3);l=(i>0?t.bottom:t.top)+i*f}else n=="line"&&(l=i>0?t.bottom+3:t.top-3);for(var g;!(g=Co(e,s,l),!g.outside);){if(i<0?l<=0:l>=r.height){g.hitSide=!0;break}l+=i*5}return g}var cn=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Oe,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};cn.prototype.init=function(e){var t=this,i=this,n=i.cm,r=i.div=e.lineDiv;As(r,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function s(d){for(var f=d.target;f;f=f.parentNode){if(f==r)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(f.className))break}return!1}we(r,"paste",function(d){if(!s(d)||Re(n,d)||ks(d,n))return;L<=11&&setTimeout(In(n,function(){return t.updateFromDOM()}),20)}),we(r,"compositionstart",function(d){t.composing={data:d.data,done:!1}}),we(r,"compositionupdate",function(d){t.composing||(t.composing={data:d.data,done:!1})}),we(r,"compositionend",function(d){t.composing&&(d.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),we(r,"touchstart",function(){return i.forceCompositionEnd()}),we(r,"input",function(){t.composing||t.readFromDOMSoon()});function l(d){if(!s(d)||Re(n,d))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()}),d.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var f=Rs(n);ao({lineWise:!0,text:f.text}),d.type=="cut"&&n.operation(function(){n.setSelections(f.ranges,0,_e),n.replaceSelection("",null,"cut")})}else return;if(d.clipboardData){d.clipboardData.clearData();var g=fi.text.join(`
`);if(d.clipboardData.setData("Text",g),d.clipboardData.getData("Text")==g){d.preventDefault();return}}var N=Ps(),H=N.firstChild;n.display.lineSpace.insertBefore(N,n.display.lineSpace.firstChild),H.value=fi.text.join(`
`);var ce=document.activeElement;de(H),setTimeout(function(){n.display.lineSpace.removeChild(N),ce.focus(),ce==r&&i.showPrimarySelection()},50)}we(r,"copy",l),we(r,"cut",l)},cn.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},cn.prototype.prepareSelection=function(){var e=ya(this.cm,!1);return e.focus=document.activeElement==this.div,e},cn.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},cn.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},cn.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),r=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||r.line<t.display.viewFrom){e.removeAllRanges();return}var s=so(t,e.anchorNode,e.anchorOffset),l=so(t,e.focusNode,e.focusOffset);if(s&&!s.bad&&l&&!l.bad&&Ze(En(s,l),n)==0&&Ze(gn(s,l),r)==0)return;var d=t.display.view,f=n.line>=t.display.viewFrom&&Ls(t,n)||{node:d[0].measure.map[2],offset:0},g=r.line<t.display.viewTo&&Ls(t,r);if(!g){var N=d[d.length-1].measure,H=N.maps?N.maps[N.maps.length-1]:N.map;g={node:H[H.length-1],offset:H[H.length-2]-H[H.length-3]}}if(!f||!g){e.removeAllRanges();return}var ce=e.rangeCount&&e.getRangeAt(0),oe;try{oe=X(f.node,f.offset,g.offset,g.node)}catch(Ae){}oe&&(!Z&&t.state.focused?(e.collapse(f.node,f.offset),oe.collapsed||(e.removeAllRanges(),e.addRange(oe))):(e.removeAllRanges(),e.addRange(oe)),ce&&e.anchorNode==null?e.addRange(ce):Z&&this.startGracePeriod()),this.rememberSelection()},cn.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)},cn.prototype.showMultipleSelections=function(e){j(this.cm.display.cursorDiv,e.cursors),j(this.cm.display.selectionDiv,e.selection)},cn.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},cn.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return C(this.div,t)},cn.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},cn.prototype.blur=function(){this.div.blur()},cn.prototype.getField=function(){return this.div},cn.prototype.supportsTouch=function(){return!0},cn.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ii(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)},cn.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},cn.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if($&&O&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var i=so(t,e.anchorNode,e.anchorOffset),n=so(t,e.focusNode,e.focusOffset);i&&n&&ii(t,function(){Vn(t.doc,Ai(i,n),_e),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},cn.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=De(n.line-1,yt(e.doc,n.line-1).length)),r.ch==yt(e.doc,r.line).text.length&&r.line<e.lastLine()&&(r=De(r.line+1,0)),n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var s,l,d;n.line==t.viewFrom||(s=zi(e,n.line))==0?(l=It(t.view[0].line),d=t.view[0].node):(l=It(t.view[s].line),d=t.view[s-1].node.nextSibling);var f=zi(e,r.line),g,N;if(f==t.view.length-1?(g=t.viewTo-1,N=t.lineDiv.lastChild):(g=It(t.view[f+1].line)-1,N=t.view[f+1].node.previousSibling),!d)return!1;for(var H=e.doc.splitLines(tu(e,d,N,l,g)),ce=Yt(e.doc,De(l,0),De(g,yt(e.doc,g).text.length));H.length>1&&ce.length>1;)if(Ie(H)==Ie(ce))H.pop(),ce.pop(),g--;else if(H[0]==ce[0])H.shift(),ce.shift(),l++;else break;for(var oe=0,Ae=0,Ue=H[0],Ke=ce[0],et=Math.min(Ue.length,Ke.length);oe<et&&Ue.charCodeAt(oe)==Ke.charCodeAt(oe);)++oe;for(var mt=Ie(H),tt=Ie(ce),xt=Math.min(mt.length-(H.length==1?oe:0),tt.length-(ce.length==1?oe:0));Ae<xt&&mt.charCodeAt(mt.length-Ae-1)==tt.charCodeAt(tt.length-Ae-1);)++Ae;if(H.length==1&&ce.length==1&&l==n.line)for(;oe&&oe>n.ch&&mt.charCodeAt(mt.length-Ae-1)==tt.charCodeAt(tt.length-Ae-1);)oe--,Ae++;H[H.length-1]=mt.slice(0,mt.length-Ae).replace(/^\u200b+/,""),H[0]=H[0].slice(oe).replace(/\u200b+$/,"");var Ut=De(l,oe),jt=De(g,ce.length?Ie(ce).length-Ae:0);if(H.length>1||H[0]||Ze(Ut,jt))return ar(e.doc,H,Ut,jt,"+input"),!0},cn.prototype.ensurePolled=function(){this.forceCompositionEnd()},cn.prototype.reset=function(){this.forceCompositionEnd()},cn.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},cn.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)},cn.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ii(this.cm,function(){return Jn(e.cm)})},cn.prototype.setUneditable=function(e){e.contentEditable="false"},cn.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||In(this.cm,Ko)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},cn.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},cn.prototype.onContextMenu=function(){},cn.prototype.resetPosition=function(){},cn.prototype.needsContentAttribute=!0;function Ls(e,t){var i=go(e,t.line);if(!i||i.hidden)return null;var n=yt(e.doc,t.line),r=ra(i,n,t.line),s=bt(n,e.doc.direction),l="left";if(s){var d=st(s,t.ch);l=d%2?"right":"left"}var f=sa(r.map,t.ch,l);return f.offset=f.collapse=="right"?f.end:f.start,f}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function hr(e,t){return t&&(e.bad=!0),e}function tu(e,t,i,n,r){var s="",l=!1,d=e.doc.lineSeparator(),f=!1;function g(oe){return function(Ae){return Ae.id==oe}}function N(){l&&(s+=d,f&&(s+=d),l=f=!1)}function H(oe){oe&&(N(),s+=oe)}function ce(oe){if(oe.nodeType==1){var Ae=oe.getAttribute("cm-text");if(Ae){H(Ae);return}var Ue=oe.getAttribute("cm-marker"),Ke;if(Ue){var et=e.findMarks(De(n,0),De(r+1,0),g(+Ue));et.length&&(Ke=et[0].find(0))&&H(Yt(e.doc,Ke.from,Ke.to).join(d));return}if(oe.getAttribute("contenteditable")=="false")return;var mt=/^(pre|div|p|li|table|br)$/i.test(oe.nodeName);if(!/^br$/i.test(oe.nodeName)&&oe.textContent.length==0)return;mt&&N();for(var tt=0;tt<oe.childNodes.length;tt++)ce(oe.childNodes[tt]);/^(pre|p)$/i.test(oe.nodeName)&&(f=!0),mt&&(l=!0)}else oe.nodeType==3&&H(oe.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(ce(t),t==i);)t=t.nextSibling,f=!1;return s}function so(e,t,i){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[i],!n)return hr(e.clipPos(De(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||!C(n,t))return hr(De(It(e.line),0),!0);if(t==n&&(r=!0,t=n.childNodes[i],i=0,!t)){var s=e.rest?Ie(e.rest):e.line;return hr(De(It(s),s.text.length),r)}var l=t.nodeType==3?t:null,d=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,i&&(i=l.nodeValue.length));d.parentNode!=n;)d=d.parentNode;var f=e.measure,g=f.maps;function N(Ke,et,mt){for(var tt=-1;tt<(g?g.length:0);tt++)for(var xt=tt<0?f.map:g[tt],Ut=0;Ut<xt.length;Ut+=3){var jt=xt[Ut+2];if(jt==Ke||jt==et){var Vt=It(tt<0?e.line:e.rest[tt]),pn=xt[Ut]+mt;return(mt<0||jt!=Ke)&&(pn=xt[Ut+(mt?1:0)]),De(Vt,pn)}}}var H=N(l,d,i);if(H)return hr(H,r);for(var ce=d.nextSibling,oe=l?l.nodeValue.length-i:0;ce;ce=ce.nextSibling){if(H=N(ce,ce.firstChild,0),H)return hr(De(H.line,H.ch-oe),r);oe+=ce.textContent.length}for(var Ae=d.previousSibling,Ue=i;Ae;Ae=Ae.previousSibling){if(H=N(Ae,Ae.firstChild,-1),H)return hr(De(H.line,H.ch+Ue),r);Ue+=Ae.textContent.length}}var Tn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Oe,this.hasSelection=!1,this.composing=null};Tn.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),V&&(r.style.width="0px"),we(r,"input",function(){P&&L>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),we(r,"paste",function(l){if(Re(n,l)||ks(l,n))return;n.state.pasteIncoming=+new Date,i.fastPoll()});function s(l){if(Re(n,l))return;if(n.somethingSelected())ao({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var d=Rs(n);ao({lineWise:!0,text:d.text}),l.type=="cut"?n.setSelections(d.ranges,null,_e):(i.prevInput="",r.value=d.text.join(`
`),de(r))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}we(r,"cut",s),we(r,"copy",s),we(e.scroller,"paste",function(l){if(Ci(e,l)||Re(n,l))return;if(!r.dispatchEvent){n.state.pasteIncoming=+new Date,i.focus();return}var d=new Event("paste");d.clipboardData=l.clipboardData,r.dispatchEvent(d)}),we(e.lineSpace,"selectstart",function(l){Ci(e,l)||b(l)}),we(r,"compositionstart",function(){var l=n.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),we(r,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Tn.prototype.createField=function(e){this.wrapper=Ps(),this.textarea=this.wrapper.firstChild},Tn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Tn.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,n=ya(e);if(e.options.moveInputWithCursor){var r=hi(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+l.top-s.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+l.left-s.left))}return n},Tn.prototype.showSelection=function(e){var t=this.cm,i=t.display;j(i.cursorDiv,e.cursors),j(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Tn.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&&de(this.textarea),P&&L>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",P&&L>=9&&(this.hasSelection=null))},Tn.prototype.getField=function(){return this.textarea},Tn.prototype.supportsTouch=function(){return!1},Tn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!ie||k()!=this.textarea))try{this.textarea.focus()}catch(e){}},Tn.prototype.blur=function(){this.textarea.blur()},Tn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Tn.prototype.receivedFocus=function(){this.slowPoll()},Tn.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()})},Tn.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)},Tn.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ge(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(P&&L>=9&&this.hasSelection===r||re&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=r.charCodeAt(0);if(s==8203&&!n&&(n="\u200B"),s==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,d=Math.min(n.length,r.length);l<d&&n.charCodeAt(l)==r.charCodeAt(l);)++l;return ii(t,function(){Ko(t,r.slice(l),n.length-l,null,e.composing?"*compose":null),r.length>1e3||r.indexOf(`
`)>-1?i.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Tn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Tn.prototype.onKeyPress=function(){P&&L>=9&&(this.hasSelection=null),this.fastPoll()},Tn.prototype.onContextMenu=function(e){var t=this,i=t.cm,n=i.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=Wi(i,e),l=n.scroller.scrollTop;if(!s||T)return;var d=i.options.resetSelectionOnContextMenu;d&&i.doc.sel.contains(s)==-1&&In(i,Vn)(i.doc,Ai(s),_e);var f=r.style.cssText,g=t.wrapper.style.cssText,N=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",r.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-N.top-5)+"px; left: "+(e.clientX-N.left-5)+`px;
z-index: 1000; background: `+(P?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var H;R&&(H=window.scrollY),n.input.focus(),R&&window.scrollTo(null,H),n.input.reset(),i.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=oe,n.selForContextMenu=i.doc.sel,clearTimeout(n.detectingSelectAll);function ce(){if(r.selectionStart!=null){var Ue=i.somethingSelected(),Ke="\u200B"+(Ue?r.value:"");r.value="\u21DA",r.value=Ke,t.prevInput=Ue?"":"\u200B",r.selectionStart=1,r.selectionEnd=Ke.length,n.selForContextMenu=i.doc.sel}}function oe(){if(t.contextMenuPending!=oe)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=g,r.style.cssText=f,P&&L<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),r.selectionStart!=null){(!P||P&&L<9)&&ce();var Ue=0,Ke=function(){n.selForContextMenu==i.doc.sel&&r.selectionStart==0&&r.selectionEnd>0&&t.prevInput=="\u200B"?In(i,Ja)(i):Ue++<10?n.detectingSelectAll=setTimeout(Ke,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(Ke,200)}}if(P&&L>=9&&ce(),v){A(e);var Ae=function(){lt(window,"mouseup",Ae),setTimeout(oe,20)};we(window,"mouseup",Ae)}else setTimeout(oe,50)},Tn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Tn.prototype.setUneditable=function(){},Tn.prototype.needsContentAttribute=!1;function iu(e,t){if(t=t?m(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=d.getValue()}var r;if(e.form&&(we(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var s=e.form;r=s.submit;try{var l=s.submit=function(){n(),s.submit=r,s.submit(),s.submit=l}}catch(f){}}t.finishInit=function(f){f.save=n,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,n(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=r))}},e.style.display="none";var d=yn(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return d}function ru(e){e.off=lt,e.on=we,e.wheelEventPixels=hl,e.Doc=qn,e.splitLines=pt,e.countColumn=Q,e.findColumn=Te,e.isWordChar=ze,e.Pass=$e,e.signal=ke,e.Line=ki,e.changeEnd=Pi,e.scrollbarModel=ka,e.Pos=De,e.cmpPos=Ze,e.modes=Pt,e.mimeModes=ut,e.resolveMode=We,e.getMode=gt,e.modeExtensions=vt,e.extendMode=_t,e.copyState=Xt,e.startState=Zt,e.innerMode=Gt,e.commands=Dr,e.keyMap=xi,e.keyName=ds,e.isModifierKey=cs,e.lookupKey=lr,e.normalizeKeyMap=Ml,e.StringStream=Ht,e.SharedTextMarker=Or,e.TextMarker=Li,e.LineWidget=Pr,e.e_preventDefault=b,e.e_stopPropagation=x,e.e_stop=A,e.addClass=Y,e.contains=C,e.rmClass=ne,e.keyNames=Mi}Yl(yn),Zl(yn);var ou="iter insert remove copy getEditor constructor".split(" ");for(var lo in qn.prototype)qn.prototype.hasOwnProperty(lo)&&Ce(ou,lo)<0&&(yn.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(qn.prototype[lo]));return I(qn),yn.inputStyles={textarea:Tn,contenteditable:cn},yn.defineMode=function(e){!yn.defaults.mode&&e!="null"&&(yn.defaults.mode=e),Wt.apply(this,arguments)},yn.defineMIME=Nt,yn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),yn.defineMIME("text/plain","null"),yn.defineExtension=function(e,t){yn.prototype[e]=t},yn.defineDocExtension=function(e,t){qn.prototype[e]=t},yn.fromTextArea=iu,ru(yn),yn.version="5.58.2",yn})},Y1PL:function(nt,Ye,y){"use strict";y.r(Ye),y.d(Ye,"ResizableTextArea",function(){return Ce});var z=y("wx14"),ve=y("1OyB"),Z=y("vuIU"),me=y("Ji7U"),ue=y("LK+K"),q=y("q1tI"),P=y("VTBJ"),L=y("rePB"),R=y("Zm9Q"),F=y("Kwbf"),O=y("c+Xe"),T=y("m+aA"),ee=y("bdgK"),U=new Map;function W(_e){_e.forEach(function(Le){var Se,Te=Le.target;(Se=U.get(Te))===null||Se===void 0||Se.forEach(function(te){return te(Te)})})}var V=new ee.default(W),$=null,ie=null;function re(_e,Le){U.has(_e)||(U.set(_e,new Set),V.observe(_e)),U.get(_e).add(Le)}function be(_e,Le){U.has(_e)&&(U.get(_e).delete(Le),U.get(_e).size||(V.unobserve(_e),U.delete(_e)))}var je=function(_e){Object(me.a)(Se,_e);var Le=Object(ue.a)(Se);function Se(){return Object(ve.a)(this,Se),Le.apply(this,arguments)}return Object(Z.a)(Se,[{key:"render",value:function(){return this.props.children}}]),Se}(q.Component),fe=q.createContext(null);function le(_e){var Le=_e.children,Se=_e.onBatchResize,Te=q.useRef(0),te=q.useRef([]),w=q.useContext(fe),Ie=q.useCallback(function(dt,kt,Qe){Te.current+=1;var Je=Te.current;te.current.push({size:dt,element:kt,data:Qe}),Promise.resolve().then(function(){Je===Te.current&&(Se==null||Se(te.current),te.current=[])}),w==null||w(dt,kt,Qe)},[Se,w]);return q.createElement(fe.Provider,{value:Ie},Le)}function v(_e){var Le=_e.children,Se=_e.disabled,Te=q.useRef(null),te=q.useRef(null),w=q.useContext(fe),Ie=q.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),dt=q.isValidElement(Le)&&Object(O.c)(Le),kt=dt?Le.ref:null,Qe=q.useMemo(function(){return Object(O.a)(kt,Te)},[kt,Te]),Je=q.useRef(_e);Je.current=_e;var Pe=q.useCallback(function(ze){var Xe=Je.current,qe=Xe.onResize,He=Xe.data,Be=ze.getBoundingClientRect(),Fe=Be.width,Lt=Be.height,ht=ze.offsetWidth,ot=ze.offsetHeight,st=Math.floor(Fe),Et=Math.floor(Lt);if(Ie.current.width!==st||Ie.current.height!==Et||Ie.current.offsetWidth!==ht||Ie.current.offsetHeight!==ot){var bt={width:st,height:Et,offsetWidth:ht,offsetHeight:ot};Ie.current=bt;var ft=ht===Math.round(Fe)?Fe:ht,we=ot===Math.round(Lt)?Lt:ot,St=Object(P.a)(Object(P.a)({},bt),{},{offsetWidth:ft,offsetHeight:we});w==null||w(St,ze,He),qe&&Promise.resolve().then(function(){qe(St,ze)})}},[]);return q.useEffect(function(){var ze=Object(T.a)(Te.current)||Object(T.a)(te.current);return ze&&!Se&&re(ze,Pe),function(){return be(ze,Pe)}},[Te.current,Se]),q.createElement(je,{ref:te},dt?q.cloneElement(Le,{ref:Qe}):Le)}var pe="rc-observer-key";function ne(_e){var Le=_e.children,Se=Object(R.a)(Le);return Se.map(function(Te,te){var w=(Te==null?void 0:Te.key)||"".concat(pe,"-").concat(te);return q.createElement(v,Object(z.a)({},_e,{key:w}),Te)})}ne.Collection=le;var ye=ne,j=y("bT9E"),E=y("TSYQ"),K=y.n(E),X=`
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
`,C=["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={},Y;function M(_e){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=_e.getAttribute("id")||_e.getAttribute("data-reactid")||_e.getAttribute("name");if(Le&&k[Se])return k[Se];var Te=window.getComputedStyle(_e),te=Te.getPropertyValue("box-sizing")||Te.getPropertyValue("-moz-box-sizing")||Te.getPropertyValue("-webkit-box-sizing"),w=parseFloat(Te.getPropertyValue("padding-bottom"))+parseFloat(Te.getPropertyValue("padding-top")),Ie=parseFloat(Te.getPropertyValue("border-bottom-width"))+parseFloat(Te.getPropertyValue("border-top-width")),dt=C.map(function(Qe){return"".concat(Qe,":").concat(Te.getPropertyValue(Qe))}).join(";"),kt={sizingStyle:dt,paddingSize:w,borderSize:Ie,boxSizing:te};return Le&&Se&&(k[Se]=kt),kt}function de(_e){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Se=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Te=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Y||(Y=document.createElement("textarea"),Y.setAttribute("tab-index","-1"),Y.setAttribute("aria-hidden","true"),document.body.appendChild(Y)),_e.getAttribute("wrap")?Y.setAttribute("wrap",_e.getAttribute("wrap")):Y.removeAttribute("wrap");var te=M(_e,Le),w=te.paddingSize,Ie=te.borderSize,dt=te.boxSizing,kt=te.sizingStyle;Y.setAttribute("style","".concat(kt,";").concat(X)),Y.value=_e.value||_e.placeholder||"";var Qe=Number.MIN_SAFE_INTEGER,Je=Number.MAX_SAFE_INTEGER,Pe=Y.scrollHeight,ze;if(dt==="border-box"?Pe+=Ie:dt==="content-box"&&(Pe-=w),Se!==null||Te!==null){Y.value=" ";var Xe=Y.scrollHeight-w;Se!==null&&(Qe=Xe*Se,dt==="border-box"&&(Qe=Qe+w+Ie),Pe=Math.max(Qe,Pe)),Te!==null&&(Je=Xe*Te,dt==="border-box"&&(Je=Je+w+Ie),ze=Pe>Je?"":"hidden",Pe=Math.min(Je,Pe))}return{height:Pe,minHeight:Qe,maxHeight:Je,overflowY:ze,resize:"none"}}var _=y("Gytx"),m=y.n(_),Q;(function(_e){_e[_e.NONE=0]="NONE",_e[_e.RESIZING=1]="RESIZING",_e[_e.RESIZED=2]="RESIZED"})(Q||(Q={}));var Oe=function(_e){Object(me.a)(Se,_e);var Le=Object(ue.a)(Se);function Se(Te){var te;return Object(ve.a)(this,Se),te=Le.call(this,Te),te.nextFrameActionId=void 0,te.resizeFrameId=void 0,te.textArea=void 0,te.saveTextArea=function(w){te.textArea=w},te.handleResize=function(w){var Ie=te.state.resizeStatus,dt=te.props,kt=dt.autoSize,Qe=dt.onResize;if(Ie!==Q.NONE)return;typeof Qe=="function"&&Qe(w),kt&&te.resizeOnNextFrame()},te.resizeOnNextFrame=function(){cancelAnimationFrame(te.nextFrameActionId),te.nextFrameActionId=requestAnimationFrame(te.resizeTextarea)},te.resizeTextarea=function(){var w=te.props.autoSize;if(!w||!te.textArea)return;var Ie=w.minRows,dt=w.maxRows,kt=de(te.textArea,!1,Ie,dt);te.setState({textareaStyles:kt,resizeStatus:Q.RESIZING},function(){cancelAnimationFrame(te.resizeFrameId),te.resizeFrameId=requestAnimationFrame(function(){te.setState({resizeStatus:Q.RESIZED},function(){te.resizeFrameId=requestAnimationFrame(function(){te.setState({resizeStatus:Q.NONE}),te.fixFirefoxAutoScroll()})})})})},te.renderTextArea=function(){var w=te.props,Ie=w.prefixCls,dt=Ie===void 0?"rc-textarea":Ie,kt=w.autoSize,Qe=w.onResize,Je=w.className,Pe=w.disabled,ze=te.state,Xe=ze.textareaStyles,qe=ze.resizeStatus,He=Object(j.a)(te.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Be=K()(dt,Je,Object(L.a)({},"".concat(dt,"-disabled"),Pe));"value"in He&&(He.value=He.value||"");var Fe=Object(P.a)(Object(P.a)(Object(P.a)({},te.props.style),Xe),qe===Q.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return q.createElement(ye,{onResize:te.handleResize,disabled:!(kt||Qe)},q.createElement("textarea",Object(z.a)({},He,{className:Be,style:Fe,ref:te.saveTextArea})))},te.state={textareaStyles:{},resizeStatus:Q.NONE},te}return Object(Z.a)(Se,[{key:"componentDidUpdate",value:function(te){(te.value!==this.props.value||!m()(te.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 te=this.textArea.selectionStart,w=this.textArea.selectionEnd;this.textArea.setSelectionRange(te,w)}}catch(Ie){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Se}(q.Component),Ce=Oe,Ve=function(_e){Object(me.a)(Se,_e);var Le=Object(ue.a)(Se);function Se(Te){var te;Object(ve.a)(this,Se),te=Le.call(this,Te),te.resizableTextArea=void 0,te.focus=function(){te.resizableTextArea.textArea.focus()},te.saveTextArea=function(Ie){te.resizableTextArea=Ie},te.handleChange=function(Ie){var dt=te.props.onChange;te.setValue(Ie.target.value,function(){te.resizableTextArea.resizeTextarea()}),dt&&dt(Ie)},te.handleKeyDown=function(Ie){var dt=te.props,kt=dt.onPressEnter,Qe=dt.onKeyDown;Ie.keyCode===13&&kt&&kt(Ie),Qe&&Qe(Ie)};var w=typeof Te.value=="undefined"||Te.value===null?Te.defaultValue:Te.value;return te.state={value:w},te}return Object(Z.a)(Se,[{key:"setValue",value:function(te,w){"value"in this.props||this.setState({value:te},w)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return q.createElement(Ce,Object(z.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(te){return"value"in te?{value:te.value}:null}}]),Se}(q.Component),$e=Ye.default=Ve},ZW9T:function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return je});var z=y("k1fw"),ve=y("miYZ"),Z=y("tsqr"),me=y("rAM+"),ue=y("tJVT"),q=y("PpiC"),P=y("q1tI"),L=y.n(P),R=y("bdgK");function F(fe,le,v,pe,ne){var ye=le.getWordUntilPosition(v),j={startLineNumber:v.lineNumber,endLineNumber:v.lineNumber,startColumn:ye.startColumn,endColumn:ye.endColumn},E=pe.map(function(K){return{label:K,kind:fe.languages.CompletionItemKind.Keyword,insertText:K,insertTextRules:fe.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:j}});return ne.map(function(K){E.push(Object(z.a)(Object(z.a)({},K),{},{range:j}))}),E}var O=function(fe){var le={label:"ifelse",kind:fe.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:fe.languages.CompletionItemInsertTextRule.InsertAsSnippet},v=["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"];fe.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(j,E){var K=F(fe,j,E,v,[le]);return{suggestions:K}}});var pe=["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"];fe.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(j,E){var K=[{label:"print",kind:fe.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:fe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],X=F(fe,j,E,pe,K);return{suggestions:X}}});var ne=["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"];fe.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(j,E){var K=[le,{label:"main",kind:fe.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:fe.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:fe.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:fe.languages.CompletionItemInsertTextRule.InsertAsSnippet}],X=F(fe,j,E,ne,K);return{suggestions:X}}})},T="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",ee=y("LvDl");function U(fe){return/^\d+$/.test(fe)?"".concat(fe,"px"):fe}function W(){}var V=!1,$={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function ie(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],le=fe;if(Array.isArray(fe)){for(var v=0;v<fe.length;v++){var pe=$[fe[v]];if(pe)return pe}return le[0]}return $[le]||le}var re=null,be=Ye.b=function(fe){var le=fe.width,v=le===void 0?"100%":le,pe=fe.height,ne=pe===void 0?"100%":pe,ye=fe.value,j=fe.language,E=j===void 0?"javascript":j,K=fe.style,X=K===void 0?{}:K,C=fe.options,k=C===void 0?{}:C,Y=fe.overrideServices,M=Y===void 0?{}:Y,de=fe.theme,_=de===void 0?"vs-dark":de,m=fe.onEditBlur,Q=fe.onSave,Oe=fe.autoHeight,Ce=Oe===void 0?!1:Oe,Ve=fe.forbidCopy,$e=Ve===void 0?!1:Ve,_e=fe.onChange,Le=_e===void 0?W:_e,Se=fe.editorDidMount,Te=Se===void 0?W:Se,te=fe.onFocus,w=te===void 0?W:te,Ie=fe.filename,dt=Ie===void 0?"educoder.txt":Ie,kt=Object(q.a)(fe,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Qe=Object(P.useRef)(),Je=Object(P.useRef)({}),Pe=Object(P.useRef)(),ze=Object(P.useRef)(!1),Xe=Object(P.useRef)(),qe=Object(P.useState)(!1),He=Object(ue.a)(qe,2),Be=He[0],Fe=He[1];function Lt(){var S;return Qe.current&&(S=new R.default(function(A){var ae=Object(me.a)(A),ge;try{for(ae.s();!(ge=ae.n()).done;){var xe=ge.value;(xe.target.offsetHeight>0||xe.target.offsetWidth>0)&&Je.current.instance.layout()}}catch(Ct){ae.e(Ct)}finally{ae.f()}}),S.observe(Qe.current)),S}function ht(){Z.b.warn(decodeURIComponent(T))}var ot=function(){var A=Je.current.instance;if(ye!=null&&A&&Be){var ae=A.getModel();ae&&ye!==ae.getValue()&&(V=!0,ae.setValue(ye),A.layout(),V=!1)}};Object(P.useEffect)(function(){Pe.current&&clearTimeout(Pe.current),Pe.current=setTimeout(function(){ot()},500)},[ye,Be,Je.current]);function st(){var S=Je.current.instance;if(S){var A=S.getSelection(),ae=Je.current.pastePos||{},ge=new re.Range(ae.startLineNumber||A.endLineNumber,ae.startColumn||A.endColumn,ae.endLineNumber||A.endLineNumber,ae.endColumn||A.endColumn);setTimeout(function(){S.executeEdits("",[{range:ge,text:""}])},300)}}function Et(S){(window.navigator.platform.match("Mac")?S.metaKey:S.ctrlKey)&&S.keyCode==83&&(S.preventDefault(),Q())}var bt=function(){if(Ce&&Je.current.instance){var A=Je.current.instance.getContentHeight();b(A<ne?ne:A)}else b(ne)};function ft(S){var A=document.createEvent("MouseEvents");A.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),S.dispatchEvent(A)}function we(S,A){var ae=window.URL||window.webkitURL||window,ge=new Blob([A]),xe=document.createElementNS("http://www.w3.org/1999/xhtml","a");xe.href=ae.createObjectURL(ge),xe.download=S,ft(xe)}Object(P.useEffect)(function(){bt()},[bt]),Object(P.useEffect)(function(){Qe.current&&!Be&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(S){try{re=S,Je.current.instance=re.editor.create(Qe.current,{value:ye,language:ie(E),theme:_,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},M);var A=Je.current.instance;if(Te(A,re),setTimeout(function(){bt(),Je.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){we(dt||"educoder.txt",A.getValue())}})},500),Je.current.subscription=A.onDidChangeModelContent(function(ge){ze.current?clearTimeout(Xe.current):(bt(),Le(A.getValue(),ge)),Xe.current=setTimeout(function(){ze.current=!1},500)}),window.Monaco||O(re),$e&&(A.addCommand(re.KeyMod.CtrlCmd|re.KeyMod.Shift|re.KeyCode.KEY_V,function(){return ht(),null}),A.addCommand(re.KeyMod.CtrlCmd|re.KeyCode.KEY_C,function(){return ht(),null})),window.Monaco=re,m&&A.onDidBlurEditorWidget(function(){m(A.getValue())}),w&&A.onDidFocusEditorText(function(){w(A.getValue())}),$e){A.addCommand(re.KeyMod.CtrlCmd|re.KeyCode.KEY_V,function(){return ht(),null}),A.onDidPaste(function(ge){Je.current.pastePos=ge});try{window.addEventListener("paste",st)}catch(ge){}}var ae=Lt();return Fe(!0),function(){var ge=Je.current.instance;ge.dispose();var xe=ge.getModel();xe&&xe.dispose(),Je.current.subscription&&Je.current.subscription.dispose(),$e&&window.removeEventListener("paste",st),ae.unobserve(Qe.current)}}catch(ge){}})},[]),Object(P.useEffect)(function(){var S=Je.current.instance;if(S&&Be)return document.addEventListener("keydown",Et,!1),function(){document.removeEventListener("keydown",Et)}},[Q,Be]),Object(P.useEffect)(function(){var S=Je.current.instance;if(S&&Be){var A=ie(E);re.editor.setModelLanguage(S.getModel(),A),console.log("language:",E,S.getModel(),A)}},[E,Be]),Object(P.useEffect)(function(){var S=Je.current.instance;S&&Be&&re.editor.setTheme(_)},[_,Be]),Object(P.useEffect)(function(){var S=Je.current.instance;S&&Be&&(S.updateOptions(Object(z.a)({},k)),setTimeout(function(){S.getModel().updateOptions(Object(z.a)({},k))},200))},[JSON.stringify(k),Be]),Object(P.useEffect)(function(){var S=Je.current.instance;S&&Be&&S.layout()},[v,ne,Be]);var St=Object(P.useState)(U(v)),lt=Object(ue.a)(St,2),ke=lt[0],Re=lt[1],D=Object(P.useState)(U(ne)),B=Object(ue.a)(D,2),I=B[0],b=B[1],x=Object(z.a)(Object(z.a)({},X),{},{width:ke,height:I});return L.a.createElement("div",{className:"my-monaco-editor",ref:Qe,style:x})};function je(fe){var le=fe.width,v=le===void 0?"100%":le,pe=fe.height,ne=pe===void 0?"100%":pe,ye=fe.original,j=fe.modified,E=fe.language,K=fe.options,X=K===void 0?{}:K,C=Object(P.useRef)(),k=Object(P.useState)(null),Y=Object(ue.a)(k,2),M=Y[0],de=Y[1];function _(Ce){var Ve;return C.current&&(Ve=new R.default(function($e){var _e=Object(me.a)($e),Le;try{for(_e.s();!(Le=_e.n()).done;){var Se=Le.value;(Se.target.offsetHeight>0||Se.target.offsetWidth>0)&&Ce.layout()}}catch(Te){_e.e(Te)}finally{_e.f()}}),Ve.observe(C.current)),Ve}Object(P.useEffect)(function(){C.current&&y.e(27).then(y.t.bind(null,"M/lh",7)).then(function(Ce){re=Ce;var Ve=re.editor.createDiffEditor(C.current,Object(z.a)(Object(z.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},X),{},{wordWrap:!0}));de(Ve);var $e=_(Ve);return function(){Ve.dispose();var _e=Ve.getModel();_e&&_e.dispose(),$e.unobserve(C.current)}})},[]),Object(P.useEffect)(function(){M&&M.setModel({original:re.editor.createModel(ye,E),modified:re.editor.createModel(j,E)})},[ye,j,E,M]);var m=U(v),Q=U(ne),Oe={width:m,height:Q};return L.a.createElement("div",{className:"my-diff-editor",ref:C,style:Oe})}},ZpRC:function(nt,Ye,y){"use strict";function z(O){return typeof O=="object"&&O!=null&&O.nodeType===1}function ve(O,T){return(!T||O!=="hidden")&&O!=="visible"&&O!=="clip"}function Z(O,T){if(O.clientHeight<O.scrollHeight||O.clientWidth<O.scrollWidth){var ee=getComputedStyle(O,null);return ve(ee.overflowY,T)||ve(ee.overflowX,T)||function(U){var W=function(V){if(!V.ownerDocument||!V.ownerDocument.defaultView)return null;try{return V.ownerDocument.defaultView.frameElement}catch($){return null}}(U);return!!W&&(W.clientHeight<U.scrollHeight||W.clientWidth<U.scrollWidth)}(O)}return!1}function me(O,T,ee,U,W,V,$,ie){return V<O&&$>T||V>O&&$<T?0:V<=O&&ie<=ee||$>=T&&ie>=ee?V-O-U:$>T&&ie<ee||V<O&&ie>ee?$-T+W:0}var ue=function(O,T){var ee=window,U=T.scrollMode,W=T.block,V=T.inline,$=T.boundary,ie=T.skipOverflowHiddenElements,re=typeof $=="function"?$:function(Xe){return Xe!==$};if(!z(O))throw new TypeError("Invalid target");for(var be=document.scrollingElement||document.documentElement,je=[],fe=O;z(fe)&&re(fe);){if((fe=fe.parentElement)===be){je.push(fe);break}fe!=null&&fe===document.body&&Z(fe)&&!Z(document.documentElement)||fe!=null&&Z(fe,ie)&&je.push(fe)}for(var le=ee.visualViewport?ee.visualViewport.width:innerWidth,v=ee.visualViewport?ee.visualViewport.height:innerHeight,pe=window.scrollX||pageXOffset,ne=window.scrollY||pageYOffset,ye=O.getBoundingClientRect(),j=ye.height,E=ye.width,K=ye.top,X=ye.right,C=ye.bottom,k=ye.left,Y=W==="start"||W==="nearest"?K:W==="end"?C:K+j/2,M=V==="center"?k+E/2:V==="end"?X:k,de=[],_=0;_<je.length;_++){var m=je[_],Q=m.getBoundingClientRect(),Oe=Q.height,Ce=Q.width,Ve=Q.top,$e=Q.right,_e=Q.bottom,Le=Q.left;if(U==="if-needed"&&K>=0&&k>=0&&C<=v&&X<=le&&K>=Ve&&C<=_e&&k>=Le&&X<=$e)return de;var Se=getComputedStyle(m),Te=parseInt(Se.borderLeftWidth,10),te=parseInt(Se.borderTopWidth,10),w=parseInt(Se.borderRightWidth,10),Ie=parseInt(Se.borderBottomWidth,10),dt=0,kt=0,Qe="offsetWidth"in m?m.offsetWidth-m.clientWidth-Te-w:0,Je="offsetHeight"in m?m.offsetHeight-m.clientHeight-te-Ie:0;if(be===m)dt=W==="start"?Y:W==="end"?Y-v:W==="nearest"?me(ne,ne+v,v,te,Ie,ne+Y,ne+Y+j,j):Y-v/2,kt=V==="start"?M:V==="center"?M-le/2:V==="end"?M-le:me(pe,pe+le,le,Te,w,pe+M,pe+M+E,E),dt=Math.max(0,dt+ne),kt=Math.max(0,kt+pe);else{dt=W==="start"?Y-Ve-te:W==="end"?Y-_e+Ie+Je:W==="nearest"?me(Ve,_e,Oe,te,Ie+Je,Y,Y+j,j):Y-(Ve+Oe/2)+Je/2,kt=V==="start"?M-Le-Te:V==="center"?M-(Le+Ce/2)+Qe/2:V==="end"?M-$e+w+Qe:me(Le,$e,Ce,Te,w+Qe,M,M+E,E);var Pe=m.scrollLeft,ze=m.scrollTop;Y+=ze-(dt=Math.max(0,Math.min(ze+dt,m.scrollHeight-Oe+Je))),M+=Pe-(kt=Math.max(0,Math.min(Pe+kt,m.scrollWidth-Ce+Qe)))}de.push({el:m,top:dt,left:kt})}return de};function q(O){return O===Object(O)&&Object.keys(O).length!==0}function P(O,T){T===void 0&&(T="auto");var ee="scrollBehavior"in document.body.style;O.forEach(function(U){var W=U.el,V=U.top,$=U.left;W.scroll&&ee?W.scroll({top:V,left:$,behavior:T}):(W.scrollTop=V,W.scrollLeft=$)})}function L(O){return O===!1?{block:"end",inline:"nearest"}:q(O)?O:{block:"start",inline:"nearest"}}function R(O,T){var ee=!O.ownerDocument.documentElement.contains(O);if(q(T)&&typeof T.behavior=="function")return T.behavior(ee?[]:ue(O,T));if(ee)return;var U=L(T);return P(ue(O,U),U.behavior)}var F=Ye.a=R},aRTE:function(nt,Ye){nt.exports={L:1,M:0,Q:3,H:2}},bT9E:function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return ve});var z=y("VTBJ");function ve(Z,me){var ue=Object(z.a)({},Z);return Array.isArray(me)&&me.forEach(function(q){delete ue[q]}),ue}},c5Ni:function(nt,Ye,y){},dQei:function(nt,Ye){for(var y={glog:function(ve){if(ve<1)throw new Error("glog("+ve+")");return y.LOG_TABLE[ve]},gexp:function(ve){for(;ve<0;)ve+=255;for(;ve>=256;)ve-=255;return y.EXP_TABLE[ve]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},z=0;z<8;z++)y.EXP_TABLE[z]=1<<z;for(var z=8;z<256;z++)y.EXP_TABLE[z]=y.EXP_TABLE[z-4]^y.EXP_TABLE[z-5]^y.EXP_TABLE[z-6]^y.EXP_TABLE[z-8];for(var z=0;z<255;z++)y.LOG_TABLE[y.EXP_TABLE[z]]=z;nt.exports=y},dWSS:function(nt,Ye,y){var z=y("dQei");function ve(Z,me){if(Z.length==null)throw new Error(Z.length+"/"+me);for(var ue=0;ue<Z.length&&Z[ue]==0;)ue++;this.num=new Array(Z.length-ue+me);for(var q=0;q<Z.length-ue;q++)this.num[q]=Z[q+ue]}ve.prototype={get:function(Z){return this.num[Z]},getLength:function(){return this.num.length},multiply:function(Z){for(var me=new Array(this.getLength()+Z.getLength()-1),ue=0;ue<this.getLength();ue++)for(var q=0;q<Z.getLength();q++)me[ue+q]^=z.gexp(z.glog(this.get(ue))+z.glog(Z.get(q)));return new ve(me,0)},mod:function(Z){if(this.getLength()-Z.getLength()<0)return this;for(var me=z.glog(this.get(0))-z.glog(Z.get(0)),ue=new Array(this.getLength()),q=0;q<this.getLength();q++)ue[q]=this.get(q);for(var q=0;q<Z.getLength();q++)ue[q]^=z.gexp(z.glog(Z.get(q))+me);return new ve(ue,0).mod(Z)}},nt.exports=ve},dejd:function(nt,Ye,y){},dmUQ:function(nt,Ye,y){"use strict";var z=y("Ff2n"),ve=y("rePB"),Z=y("1OyB"),me=y("vuIU"),ue=y("Ji7U"),q=y("md7G"),P=y("foSv"),L=y("q1tI"),R=y.n(L),F=y("TSYQ"),O=y.n(F),T=y("4IlW");function ee(j,E){var K=Object.keys(j);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(j);E&&(X=X.filter(function(C){return Object.getOwnPropertyDescriptor(j,C).enumerable})),K.push.apply(K,X)}return K}function U(j){for(var E=1;E<arguments.length;E++){var K=arguments[E]!=null?arguments[E]:{};E%2?ee(Object(K),!0).forEach(function(X){Object(ve.a)(j,X,K[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(K)):ee(Object(K)).forEach(function(X){Object.defineProperty(j,X,Object.getOwnPropertyDescriptor(K,X))})}return j}function W(j){var E=V();return function(){var X=Object(P.a)(j),C;if(E){var k=Object(P.a)(this).constructor;C=Reflect.construct(X,arguments,k)}else C=X.apply(this,arguments);return Object(q.a)(this,C)}}function V(){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(j){return!1}}function $(){}function ie(j){j.preventDefault()}var re=function(E){return E.replace(/[^\w.-]+/g,"")},be=200,je=600,fe=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,le=function(E){return E!=null},v=function(E,K){return K===E||typeof K=="number"&&typeof E=="number"&&isNaN(K)&&isNaN(E)},pe=function(j){Object(ue.a)(K,j);var E=W(K);function K(X){var C;Object(Z.a)(this,K),C=E.call(this,X),C.onKeyDown=function(M){var de=C.props,_=de.onKeyDown,m=de.onPressEnter;if(M.keyCode===T.a.UP){var Q=C.getRatio(M);C.up(M,Q,null),C.stop()}else if(M.keyCode===T.a.DOWN){var Oe=C.getRatio(M);C.down(M,Oe,null),C.stop()}else M.keyCode===T.a.ENTER&&m&&m(M);if(C.recordCursorPosition(),C.lastKeyCode=M.keyCode,_){for(var Ce=arguments.length,Ve=new Array(Ce>1?Ce-1:0),$e=1;$e<Ce;$e++)Ve[$e-1]=arguments[$e];_.apply(void 0,[M].concat(Ve))}},C.onKeyUp=function(M){var de=C.props.onKeyUp;if(C.stop(),C.recordCursorPosition(),de){for(var _=arguments.length,m=new Array(_>1?_-1:0),Q=1;Q<_;Q++)m[Q-1]=arguments[Q];de.apply(void 0,[M].concat(m))}},C.onChange=function(M){var de=C.props.onChange;C.state.focused&&(C.inputting=!0),C.rawInput=C.props.parser(C.getValueFromEvent(M)),C.setState({inputValue:C.rawInput}),de(C.toNumber(C.rawInput))},C.onMouseUp=function(){var M=C.props.onMouseUp;C.recordCursorPosition(),M&&M.apply(void 0,arguments)},C.onFocus=function(){var M;C.setState({focused:!0}),(M=C.props).onFocus.apply(M,arguments)},C.onBlur=function(){var M=C.props.onBlur;C.inputting=!1,C.setState({focused:!1});var de=C.getCurrentValidValue(C.state.inputValue),_=C.setValue(de,$);if(M){var m=C.input.value,Q=C.getInputDisplayValue({focus:!1,value:_});C.input.value=Q&&Number(Q),M.apply(void 0,arguments),C.input.value=m}},C.getRatio=function(M){var de=1;return M.metaKey||M.ctrlKey?de=.1:M.shiftKey&&(de=10),de},C.getFullNum=function(M){return isNaN(M)?M:/e/i.test(String(M))?Number(M).toFixed(18).replace(/\.?0+$/,""):M},C.getPrecision=function(M){if(le(C.props.precision))return C.props.precision;var de=String(M);if(de.indexOf("e-")>=0)return parseInt(de.slice(de.indexOf("e-")+2),10);var _=0;return de.indexOf(".")>=0&&(_=de.length-de.indexOf(".")-1),_},C.getInputDisplayValue=function(M){var de=M||C.state,_=de.focused,m=de.inputValue,Q=de.value,Oe;_?Oe=m:Oe=C.toPrecisionAsStep(Q),Oe==null&&(Oe="");var Ce=C.formatWrapper(Oe);return le(C.props.decimalSeparator)&&(Ce=Ce.toString().replace(".",C.props.decimalSeparator)),Ce},C.recordCursorPosition=function(){try{C.cursorStart=C.input.selectionStart,C.cursorEnd=C.input.selectionEnd,C.currentValue=C.input.value,C.cursorBefore=C.input.value.substring(0,C.cursorStart),C.cursorAfter=C.input.value.substring(C.cursorEnd)}catch(M){}},C.restoreByAfter=function(M){if(M===void 0)return!1;var de=C.input.value,_=de.lastIndexOf(M);if(_===-1)return!1;var m=C.cursorBefore.length;return C.lastKeyCode===T.a.DELETE&&C.cursorBefore.charAt(m-1)===M[0]?(C.fixCaret(m,m),!0):_+M.length===de.length?(C.fixCaret(_,_),!0):!1},C.partRestoreByAfter=function(M){return M===void 0?!1:Array.prototype.some.call(M,function(de,_){var m=M.substring(_);return C.restoreByAfter(m)})},C.isNotCompleteNumber=function(M){return isNaN(M)||M===""||M===null||M&&M.toString().indexOf(".")===M.toString().length-1},C.stop=function(){C.autoStepTimer&&clearTimeout(C.autoStepTimer)},C.down=function(M,de,_){C.pressingUpOrDown=!0,C.step("down",M,de,_)},C.up=function(M,de,_){C.pressingUpOrDown=!0,C.step("up",M,de,_)},C.saveInput=function(M){C.input=M};var k=X.value;k===void 0&&(k=X.defaultValue),C.state={focused:X.autoFocus};var Y=C.getValidValue(C.toNumber(k));return C.state=U(U({},C.state),{},{inputValue:C.toPrecisionAsStep(Y),value:Y}),C}return Object(me.a)(K,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(C){var k=this.props,Y=k.value,M=k.onChange,de=k.max,_=k.min,m=this.state.focused;if(C){if(!v(C.value,Y)||!v(C.max,de)||!v(C.min,_)){var Q=m?Y:this.getValidValue(Y),Oe;this.pressingUpOrDown?Oe=Q:this.inputting?Oe=this.rawInput:Oe=this.toPrecisionAsStep(Q),this.setState({value:Q,inputValue:Oe})}var Ce="value"in this.props?Y:this.state.value;"max"in this.props&&C.max!==de&&typeof Ce=="number"&&Ce>de&&M&&M(de),"min"in this.props&&C.min!==_&&typeof Ce=="number"&&Ce<_&&M&&M(_)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Ve=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===T.a.BACKSPACE?Ve=this.cursorStart-1:this.lastKeyCode===T.a.DELETE&&(Ve=this.cursorStart):Ve=this.input.value.length,this.fixCaret(Ve,Ve)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case T.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case T.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch($e){}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(C){var k=C;return k===""?k="":this.isNotCompleteNumber(parseFloat(k))?k=this.state.value:k=this.getValidValue(k),this.toNumber(k)}},{key:"getValueFromEvent",value:function(C){var k=C.target.value.trim().replace(/。/g,".");return le(this.props.decimalSeparator)&&(k=k.replace(this.props.decimalSeparator,".")),k}},{key:"getValidValue",value:function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,M=parseFloat(C);return isNaN(M)?C:(M<k&&(M=k),M>Y&&(M=Y),M)}},{key:"setValue",value:function(C,k){var Y=this.props.precision,M=this.isNotCompleteNumber(parseFloat(C))?null:parseFloat(C),de=this.state.value,_=de===void 0?null:de,m=this.state.inputValue,Q=m===void 0?null:m,Oe=typeof M=="number"?M.toFixed(Y):"".concat(M),Ce=M!==_||Oe!=="".concat(Q);return"value"in this.props?(Q=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Q},k)):this.setState({value:M,inputValue:this.toPrecisionAsStep(C)},k),Ce&&this.props.onChange(M),M}},{key:"getMaxPrecision",value:function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Y=this.props,M=Y.precision,de=Y.step;if(le(M))return M;var _=this.getPrecision(k),m=this.getPrecision(de),Q=this.getPrecision(C);return C?Math.max(Q,_+m):_+m}},{key:"getPrecisionFactor",value:function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Y=this.getMaxPrecision(C,k);return Math.pow(10,Y)}},{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(C){return this.props.formatter?this.props.formatter(C):C}},{key:"toPrecisionAsStep",value:function(C){if(this.isNotCompleteNumber(C)||C==="")return C;var k=Math.abs(this.getMaxPrecision(C));return isNaN(k)?C.toString():Number(C).toFixed(k)}},{key:"toNumber",value:function(C){var k=this.props.precision,Y=this.state.focused,M=C&&C.length>16&&Y;return this.isNotCompleteNumber(C)||M?C:le(k)?Math.round(C*Math.pow(10,k))/Math.pow(10,k):Number(C)}},{key:"upStep",value:function(C,k){var Y=this.props.step,M=this.getPrecisionFactor(C,k),de=Math.abs(this.getMaxPrecision(C,k)),_=((M*C+M*Y*k)/M).toFixed(de);return this.toNumber(_)}},{key:"downStep",value:function(C,k){var Y=this.props.step,M=this.getPrecisionFactor(C,k),de=Math.abs(this.getMaxPrecision(C,k)),_=((M*C-M*Y*k)/M).toFixed(de);return this.toNumber(_)}},{key:"step",value:function(C,k){var Y=this,M=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,de=arguments.length>3?arguments[3]:void 0;this.stop(),k&&(k.persist(),k.preventDefault());var _=this.props;if(_.disabled)return;var m=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(m))return;var Q=this["".concat(C,"Step")](m,M),Oe=Q>_.max||Q<_.min;if(Q>_.max?Q=_.max:Q<_.min&&(Q=_.min),this.setValue(Q,null),this.setState({focused:!0},function(){Y.pressingUpOrDown=!1}),Oe)return;this.autoStepTimer=setTimeout(function(){Y[C](k,M,!0)},de?be:je)}},{key:"fixCaret",value:function(C,k){if(C===void 0||k===void 0||!this.input||!this.input.value)return;try{var Y=this.input.selectionStart,M=this.input.selectionEnd;(C!==Y||k!==M)&&this.input.setSelectionRange(C,k)}catch(de){}}},{key:"render",value:function(){var C,k=this.props,Y=k.prefixCls,M=k.disabled,de=k.readOnly,_=k.useTouch,m=k.autoComplete,Q=k.upHandler,Oe=k.downHandler,Ce=k.className,Ve=k.max,$e=k.min,_e=k.style,Le=k.title,Se=k.onMouseEnter,Te=k.onMouseLeave,te=k.onMouseOver,w=k.onMouseOut,Ie=k.required,dt=k.onClick,kt=k.tabIndex,Qe=k.type,Je=k.placeholder,Pe=k.id,ze=k.inputMode,Xe=k.pattern,qe=k.step,He=k.maxLength,Be=k.autoFocus,Fe=k.name,Lt=k.onPaste,ht=k.onInput,ot=Object(z.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,Et=st.value,bt=st.focused,ft=O()(Y,(C={},Object(ve.a)(C,Ce,!!Ce),Object(ve.a)(C,"".concat(Y,"-disabled"),M),Object(ve.a)(C,"".concat(Y,"-focused"),bt),C)),we={};Object.keys(ot).forEach(function(A){(A.substr(0,5)==="data-"||A.substr(0,5)==="aria-"||A==="role")&&(we[A]=ot[A])});var St=!de&&!M,lt=this.getInputDisplayValue(null),ke=(Et||Et===0)&&(isNaN(Et)||Number(Et)>=Ve),Re=(Et||Et===0)&&(isNaN(Et)||Number(Et)<=$e),D=ke||M||de,B=Re||M||de,I=O()("".concat(Y,"-handler"),"".concat(Y,"-handler-up"),Object(ve.a)({},"".concat(Y,"-handler-up-disabled"),D)),b=O()("".concat(Y,"-handler"),"".concat(Y,"-handler-down"),Object(ve.a)({},"".concat(Y,"-handler-down-disabled"),B)),x=_?{onTouchStart:D?$:this.up,onTouchEnd:this.stop}:{onMouseDown:D?$:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},S=_?{onTouchStart:B?$:this.down,onTouchEnd:this.stop}:{onMouseDown:B?$:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return R.a.createElement("div",{className:ft,style:_e,title:Le,onMouseEnter:Se,onMouseLeave:Te,onMouseOver:te,onMouseOut:w,onFocus:function(){return null},onBlur:function(){return null}},R.a.createElement("div",{className:"".concat(Y,"-handler-wrap")},R.a.createElement("span",Object.assign({unselectable:"on"},x,{role:"button","aria-label":"Increase Value","aria-disabled":D,className:I}),Q||R.a.createElement("span",{unselectable:"on",className:"".concat(Y,"-handler-up-inner"),onClick:ie})),R.a.createElement("span",Object.assign({unselectable:"on"},S,{role:"button","aria-label":"Decrease Value","aria-disabled":B,className:b}),Oe||R.a.createElement("span",{unselectable:"on",className:"".concat(Y,"-handler-down-inner"),onClick:ie}))),R.a.createElement("div",{className:"".concat(Y,"-input-wrap")},R.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":$e,"aria-valuemax":Ve,"aria-valuenow":Et,required:Ie,type:Qe,placeholder:Je,onPaste:Lt,onClick:dt,onMouseUp:this.onMouseUp,className:"".concat(Y,"-input"),tabIndex:kt,autoComplete:m,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:St?this.onKeyDown:$,onKeyUp:St?this.onKeyUp:$,autoFocus:Be,maxLength:He,readOnly:de,disabled:M,max:Ve,min:$e,step:qe,name:Fe,title:Le,id:Pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(lt),pattern:Xe,inputMode:ze,onInput:ht},we))))}}]),K}(R.a.Component);pe.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:fe,min:-fe,step:1,style:{},onChange:$,onKeyDown:$,onPressEnter:$,onFocus:$,onBlur:$,parser:re,required:!1,autoComplete:"off"};var ne=pe,ye=Ye.a=ne},f4xo:function(nt,Ye,y){var z=y("nVVt");function ve(Z){this.mode=z.MODE_8BIT_BYTE,this.data=Z}ve.prototype={getLength:function(Z){return this.data.length},write:function(Z){for(var me=0;me<this.data.length;me++)Z.put(this.data.charCodeAt(me),8)}},nt.exports=ve},kSUc:function(nt,Ye,y){},kqOp:function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return F});var z=y("0Owb"),ve=y("fWQN"),Z=y("mtLc"),me=y("yKVA"),ue=y("879j"),q=y("q1tI"),P=y.n(q),L=y("Ot1p"),R="\u2581",F=function(O){Object(me.a)(ee,O);var T=Object(ue.a)(ee);function ee(){var U;Object(ve.a)(this,ee);for(var W=arguments.length,V=new Array(W),$=0;$<W;$++)V[$]=arguments[$];return U=T.call.apply(T,[this].concat(V)),U.getChCountBeforeCursor=function(ie,re){for(var be=re.line,je=0,fe=0;fe<be;fe++)je+=ie.getLine(fe).split(R).length-1;var le=ie.getLine(be).substring(0,re.ch);return je+=le.split(R).length-1,je},U.onCMBeforeChange=function(ie,re){var be=ie.getRange(re.from,re.to),je=0;if(re.text.forEach(function(pe){je+=pe.split(R).length-1}),be&&be.indexOf(R)!=-1){var fe=be.split(R).length-1,le=U.getChCountBeforeCursor(ie,re.from);console.log("\u5220\u9664".concat(fe,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(le,"\u4E2A\uFF0C\u65B0\u589E").concat(je,"\u4E2A")),U.props.deleteEmptyDisabled?re.cancel():U.props.onPlaceholderChange&&U.props.onPlaceholderChange(le,fe,je)}else if(je){var v=U.getChCountBeforeCursor(ie,re.from);console.log("\u65B0\u589E".concat(je,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(v,"\u4E2A")),U.props.onPlaceholderChange&&U.props.onPlaceholderChange(v,0,je)}},U}return Object(Z.a)(ee,[{key:"render",value:function(){return P.a.createElement(L.a,Object(z.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),ee}(q.Component)},lZu9:function(nt,Ye,y){(function(z){z(y("VrN/"),y("1eCo"),y("8EBN"))})(function(z){"use strict";z.defineMode("markdown",function(ve,Z){var me=z.getMode(ve,"text/html"),ue=me.name=="null";function q(_){if(z.findModeByName){var m=z.findModeByName(_);m&&(_=m.mime||m.mimes[0])}var Q=z.getMode(ve,_);return Q.name=="null"?null:Q}Z.highlightFormatting===void 0&&(Z.highlightFormatting=!1),Z.maxBlockquoteDepth===void 0&&(Z.maxBlockquoteDepth=0),Z.taskLists===void 0&&(Z.taskLists=!1),Z.strikethrough===void 0&&(Z.strikethrough=!1),Z.emoji===void 0&&(Z.emoji=!1),Z.fencedCodeBlockHighlighting===void 0&&(Z.fencedCodeBlockHighlighting=!0),Z.fencedCodeBlockDefaultMode===void 0&&(Z.fencedCodeBlockDefaultMode="text/plain"),Z.xml===void 0&&(Z.xml=!0),Z.tokenTypeOverrides===void 0&&(Z.tokenTypeOverrides={});var P={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 L in P)P.hasOwnProperty(L)&&Z.tokenTypeOverrides[L]&&(P[L]=Z.tokenTypeOverrides[L]);var R=/^([*\-_])(?:\s*\1){2,}\s*$/,F=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,O=/^\[(x| )\](?=\s)/i,T=Z.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ee=/^ {0,3}(?:\={1,}|-{2,})\s*$/,U=/^[^#!\[\]*_\\<>` "'(~:]+/,W=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,V=/^\s*\[[^\]]+?\]:.*$/,$=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,ie=" ";function re(_,m,Q){return m.f=m.inline=Q,Q(_,m)}function be(_,m,Q){return m.f=m.block=Q,Q(_,m)}function je(_){return!_||!/\S/.test(_.string)}function fe(_){if(_.linkTitle=!1,_.linkHref=!1,_.linkText=!1,_.em=!1,_.strong=!1,_.strikethrough=!1,_.quote=0,_.indentedCode=!1,_.f==v){var m=ue;if(!m){var Q=z.innerMode(me,_.htmlState);m=Q.mode.name=="xml"&&Q.state.tagStart===null&&!Q.state.context&&Q.state.tokenize.isInText}m&&(_.f=j,_.block=le,_.htmlState=null)}return _.trailingSpace=0,_.trailingSpaceNewLine=!1,_.prevLine=_.thisLine,_.thisLine={stream:null},null}function le(_,m){var Q=_.column()===m.indentation,Oe=je(m.prevLine.stream),Ce=m.indentedCode,Ve=m.prevLine.hr,$e=m.list!==!1,_e=(m.listStack[m.listStack.length-1]||0)+3;m.indentedCode=!1;var Le=m.indentation;if(m.indentationDiff===null&&(m.indentationDiff=m.indentation,$e)){for(m.list=null;Le<m.listStack[m.listStack.length-1];)m.listStack.pop(),m.listStack.length?m.indentation=m.listStack[m.listStack.length-1]:m.list=!1;m.list!==!1&&(m.indentationDiff=Le-m.listStack[m.listStack.length-1])}var Se=!Oe&&!Ve&&!m.prevLine.header&&(!$e||!Ce)&&!m.prevLine.fencedCodeEnd,Te=(m.list===!1||Ve||Oe)&&m.indentation<=_e&&_.match(R),te=null;if(m.indentationDiff>=4&&(Ce||m.prevLine.fencedCodeEnd||m.prevLine.header||Oe))return _.skipToEnd(),m.indentedCode=!0,P.code;if(_.eatSpace())return null;if(Q&&m.indentation<=_e&&(te=_.match(T))&&te[1].length<=6)return m.quote=0,m.header=te[1].length,m.thisLine.header=!0,Z.highlightFormatting&&(m.formatting="header"),m.f=m.inline,ne(m);if(m.indentation<=_e&&_.eat(">"))return m.quote=Q?1:m.quote+1,Z.highlightFormatting&&(m.formatting="quote"),_.eatSpace(),ne(m);if(!Te&&!m.setext&&Q&&m.indentation<=_e&&(te=_.match(F))){var w=te[1]?"ol":"ul";return m.indentation=Le+_.current().length,m.list=!0,m.quote=0,m.listStack.push(m.indentation),m.em=!1,m.strong=!1,m.code=!1,m.strikethrough=!1,Z.taskLists&&_.match(O,!1)&&(m.taskList=!0),m.f=m.inline,Z.highlightFormatting&&(m.formatting=["list","list-"+w]),ne(m)}else{if(Q&&m.indentation<=_e&&(te=_.match(W,!0)))return m.quote=0,m.fencedEndRE=new RegExp(te[1]+"+ *$"),m.localMode=Z.fencedCodeBlockHighlighting&&q(te[2]||Z.fencedCodeBlockDefaultMode),m.localMode&&(m.localState=z.startState(m.localMode)),m.f=m.block=pe,Z.highlightFormatting&&(m.formatting="code-block"),m.code=-1,ne(m);if(m.setext||(!Se||!$e)&&!m.quote&&m.list===!1&&!m.code&&!Te&&!V.test(_.string)&&(te=_.lookAhead(1))&&(te=te.match(ee)))return m.setext?(m.header=m.setext,m.setext=0,_.skipToEnd(),Z.highlightFormatting&&(m.formatting="header")):(m.header=te[0].charAt(0)=="="?1:2,m.setext=m.header),m.thisLine.header=!0,m.f=m.inline,ne(m);if(Te)return _.skipToEnd(),m.hr=!0,m.thisLine.hr=!0,P.hr;if(_.peek()==="[")return re(_,m,k)}return re(_,m,m.inline)}function v(_,m){var Q=me.token(_,m.htmlState);if(!ue){var Oe=z.innerMode(me,m.htmlState);(Oe.mode.name=="xml"&&Oe.state.tagStart===null&&!Oe.state.context&&Oe.state.tokenize.isInText||m.md_inside&&_.current().indexOf(">")>-1)&&(m.f=j,m.block=le,m.htmlState=null)}return Q}function pe(_,m){var Q=m.listStack[m.listStack.length-1]||0,Oe=m.indentation<Q,Ce=Q+3;if(m.fencedEndRE&&m.indentation<=Ce&&(Oe||_.match(m.fencedEndRE))){Z.highlightFormatting&&(m.formatting="code-block");var Ve;return Oe||(Ve=ne(m)),m.localMode=m.localState=null,m.block=le,m.f=j,m.fencedEndRE=null,m.code=0,m.thisLine.fencedCodeEnd=!0,Oe?be(_,m,m.block):Ve}else return m.localMode?m.localMode.token(_,m.localState):(_.skipToEnd(),P.code)}function ne(_){var m=[];if(_.formatting){m.push(P.formatting),typeof _.formatting=="string"&&(_.formatting=[_.formatting]);for(var Q=0;Q<_.formatting.length;Q++)m.push(P.formatting+"-"+_.formatting[Q]),_.formatting[Q]==="header"&&m.push(P.formatting+"-"+_.formatting[Q]+"-"+_.header),_.formatting[Q]==="quote"&&(!Z.maxBlockquoteDepth||Z.maxBlockquoteDepth>=_.quote?m.push(P.formatting+"-"+_.formatting[Q]+"-"+_.quote):m.push("error"))}if(_.taskOpen)return m.push("meta"),m.length?m.join(" "):null;if(_.taskClosed)return m.push("property"),m.length?m.join(" "):null;if(_.linkHref?m.push(P.linkHref,"url"):(_.strong&&m.push(P.strong),_.em&&m.push(P.em),_.strikethrough&&m.push(P.strikethrough),_.emoji&&m.push(P.emoji),_.linkText&&m.push(P.linkText),_.code&&m.push(P.code),_.image&&m.push(P.image),_.imageAltText&&m.push(P.imageAltText,"link"),_.imageMarker&&m.push(P.imageMarker)),_.header&&m.push(P.header,P.header+"-"+_.header),_.quote&&(m.push(P.quote),!Z.maxBlockquoteDepth||Z.maxBlockquoteDepth>=_.quote?m.push(P.quote+"-"+_.quote):m.push(P.quote+"-"+Z.maxBlockquoteDepth)),_.list!==!1){var Oe=(_.listStack.length-1)%3;Oe?Oe===1?m.push(P.list2):m.push(P.list3):m.push(P.list1)}return _.trailingSpaceNewLine?m.push("trailing-space-new-line"):_.trailingSpace&&m.push("trailing-space-"+(_.trailingSpace%2?"a":"b")),m.length?m.join(" "):null}function ye(_,m){return _.match(U,!0)?ne(m):void 0}function j(_,m){var Q=m.text(_,m);if(typeof Q!="undefined")return Q;if(m.list)return m.list=null,ne(m);if(m.taskList){var Oe=_.match(O,!0)[1]===" ";return Oe?m.taskOpen=!0:m.taskClosed=!0,Z.highlightFormatting&&(m.formatting="task"),m.taskList=!1,ne(m)}if(m.taskOpen=!1,m.taskClosed=!1,m.header&&_.match(/^#+$/,!0))return Z.highlightFormatting&&(m.formatting="header"),ne(m);var Ce=_.next();if(m.linkTitle){m.linkTitle=!1;var Ve=Ce;Ce==="("&&(Ve=")"),Ve=(Ve+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var $e="^\\s*(?:[^"+Ve+"\\\\]+|\\\\\\\\|\\\\.)"+Ve;if(_.match(new RegExp($e),!0))return P.linkHref}if(Ce==="`"){var _e=m.formatting;Z.highlightFormatting&&(m.formatting="code"),_.eatWhile("`");var Le=_.current().length;if(m.code==0&&(!m.quote||Le==1))return m.code=Le,ne(m);if(Le==m.code){var Se=ne(m);return m.code=0,Se}else return m.formatting=_e,ne(m)}else if(m.code)return ne(m);if(Ce==="\\"&&(_.next(),Z.highlightFormatting)){var Te=ne(m),te=P.formatting+"-escape";return Te?Te+" "+te:te}if(Ce==="!"&&_.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return m.imageMarker=!0,m.image=!0,Z.highlightFormatting&&(m.formatting="image"),ne(m);if(Ce==="["&&m.imageMarker&&_.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return m.imageMarker=!1,m.imageAltText=!0,Z.highlightFormatting&&(m.formatting="image"),ne(m);if(Ce==="]"&&m.imageAltText){Z.highlightFormatting&&(m.formatting="image");var Te=ne(m);return m.imageAltText=!1,m.image=!1,m.inline=m.f=K,Te}if(Ce==="["&&!m.image)return m.linkText&&_.match(/^.*?\]/)||(m.linkText=!0,Z.highlightFormatting&&(m.formatting="link")),ne(m);if(Ce==="]"&&m.linkText){Z.highlightFormatting&&(m.formatting="link");var Te=ne(m);return m.linkText=!1,m.inline=m.f=_.match(/\(.*?\)| ?\[.*?\]/,!1)?K:j,Te}if(Ce==="<"&&_.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){m.f=m.inline=E,Z.highlightFormatting&&(m.formatting="link");var Te=ne(m);return Te?Te+=" ":Te="",Te+P.linkInline}if(Ce==="<"&&_.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){m.f=m.inline=E,Z.highlightFormatting&&(m.formatting="link");var Te=ne(m);return Te?Te+=" ":Te="",Te+P.linkEmail}if(Z.xml&&Ce==="<"&&_.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var w=_.string.indexOf(">",_.pos);if(w!=-1){var Ie=_.string.substring(_.start,w);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ie)&&(m.md_inside=!0)}return _.backUp(1),m.htmlState=z.startState(me),be(_,m,v)}if(Z.xml&&Ce==="<"&&_.match(/^\/\w*?>/))return m.md_inside=!1,"tag";if(Ce==="*"||Ce==="_"){for(var dt=1,kt=_.pos==1?" ":_.string.charAt(_.pos-2);dt<3&&_.eat(Ce);)dt++;var Qe=_.peek()||" ",Je=!/\s/.test(Qe)&&(!$.test(Qe)||/\s/.test(kt)||$.test(kt)),Pe=!/\s/.test(kt)&&(!$.test(kt)||/\s/.test(Qe)||$.test(Qe)),ze=null,Xe=null;if(dt%2&&(!m.em&&Je&&(Ce==="*"||!Pe||$.test(kt))?ze=!0:m.em==Ce&&Pe&&(Ce==="*"||!Je||$.test(Qe))&&(ze=!1)),dt>1&&(!m.strong&&Je&&(Ce==="*"||!Pe||$.test(kt))?Xe=!0:m.strong==Ce&&Pe&&(Ce==="*"||!Je||$.test(Qe))&&(Xe=!1)),Xe!=null||ze!=null){Z.highlightFormatting&&(m.formatting=ze==null?"strong":Xe==null?"em":"strong em"),ze===!0&&(m.em=Ce),Xe===!0&&(m.strong=Ce);var Se=ne(m);return ze===!1&&(m.em=!1),Xe===!1&&(m.strong=!1),Se}}else if(Ce===" "&&(_.eat("*")||_.eat("_"))){if(_.peek()===" ")return ne(m);_.backUp(1)}if(Z.strikethrough){if(Ce==="~"&&_.eatWhile(Ce)){if(m.strikethrough){Z.highlightFormatting&&(m.formatting="strikethrough");var Se=ne(m);return m.strikethrough=!1,Se}else if(_.match(/^[^\s]/,!1))return m.strikethrough=!0,Z.highlightFormatting&&(m.formatting="strikethrough"),ne(m)}else if(Ce===" "&&_.match(/^~~/,!0)){if(_.peek()===" ")return ne(m);_.backUp(2)}}if(Z.emoji&&Ce===":"&&_.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){m.emoji=!0,Z.highlightFormatting&&(m.formatting="emoji");var qe=ne(m);return m.emoji=!1,qe}return Ce===" "&&(_.match(/^ +$/,!1)?m.trailingSpace++:m.trailingSpace&&(m.trailingSpaceNewLine=!0)),ne(m)}function E(_,m){var Q=_.next();if(Q===">"){m.f=m.inline=j,Z.highlightFormatting&&(m.formatting="link");var Oe=ne(m);return Oe?Oe+=" ":Oe="",Oe+P.linkInline}return _.match(/^[^>]+/,!0),P.linkInline}function K(_,m){if(_.eatSpace())return null;var Q=_.next();return Q==="("||Q==="["?(m.f=m.inline=C(Q==="("?")":"]"),Z.highlightFormatting&&(m.formatting="link-string"),m.linkHref=!0,ne(m)):"error"}var X={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function C(_){return function(m,Q){var Oe=m.next();if(Oe===_){Q.f=Q.inline=j,Z.highlightFormatting&&(Q.formatting="link-string");var Ce=ne(Q);return Q.linkHref=!1,Ce}return m.match(X[_]),Q.linkHref=!0,ne(Q)}}function k(_,m){return _.match(/^([^\]\\]|\\.)*\]:/,!1)?(m.f=Y,_.next(),Z.highlightFormatting&&(m.formatting="link"),m.linkText=!0,ne(m)):re(_,m,j)}function Y(_,m){if(_.match(/^\]:/,!0)){m.f=m.inline=M,Z.highlightFormatting&&(m.formatting="link");var Q=ne(m);return m.linkText=!1,Q}return _.match(/^([^\]\\]|\\.)+/,!0),P.linkText}function M(_,m){return _.eatSpace()?null:(_.match(/^[^\s]+/,!0),_.peek()===void 0?m.linkTitle=!0:_.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),m.f=m.inline=j,P.linkHref+" url")}var de={startState:function(){return{f:le,prevLine:{stream:null},thisLine:{stream:null},block:le,htmlState:null,indentation:0,inline:j,text:ye,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(_){return{f:_.f,prevLine:_.prevLine,thisLine:_.thisLine,block:_.block,htmlState:_.htmlState&&z.copyState(me,_.htmlState),indentation:_.indentation,localMode:_.localMode,localState:_.localMode?z.copyState(_.localMode,_.localState):null,inline:_.inline,text:_.text,formatting:!1,linkText:_.linkText,linkTitle:_.linkTitle,linkHref:_.linkHref,code:_.code,em:_.em,strong:_.strong,strikethrough:_.strikethrough,emoji:_.emoji,header:_.header,setext:_.setext,hr:_.hr,taskList:_.taskList,list:_.list,listStack:_.listStack.slice(0),quote:_.quote,indentedCode:_.indentedCode,trailingSpace:_.trailingSpace,trailingSpaceNewLine:_.trailingSpaceNewLine,md_inside:_.md_inside,fencedEndRE:_.fencedEndRE}},token:function(_,m){if(m.formatting=!1,_!=m.thisLine.stream){if(m.header=0,m.hr=!1,_.match(/^\s*$/,!0))return fe(m),null;if(m.prevLine=m.thisLine,m.thisLine={stream:_},m.taskList=!1,m.trailingSpace=0,m.trailingSpaceNewLine=!1,!m.localState&&(m.f=m.block,m.f!=v)){var Q=_.match(/^\s*/,!0)[0].replace(/\t/g,ie).length;if(m.indentation=Q,m.indentationDiff=null,Q>0)return null}}return m.f(_,m)},innerMode:function(_){return _.block==v?{state:_.htmlState,mode:me}:_.localState?{state:_.localState,mode:_.localMode}:{state:_,mode:de}},indent:function(_,m,Q){return _.block==v&&me.indent?me.indent(_.htmlState,m,Q):_.localState&&_.localMode.indent?_.localMode.indent(_.localState,m,Q):z.Pass},blankLine:fe,getType:ne,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return de},"xml"),z.defineMIME("text/markdown","markdown"),z.defineMIME("text/x-markdown","markdown")})},nVVt:function(nt,Ye){nt.exports={MODE_NUMBER:1<<0,MODE_ALPHA_NUM:1<<1,MODE_8BIT_BYTE:1<<2,MODE_KANJI:1<<3}},osHv:function(nt,Ye,y){(function(z){z(y("VrN/"))})(function(z){"use strict";var ve=z.Pos;function Z($,ie){return $.line-ie.line||$.ch-ie.ch}var me="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",ue=me+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",q=new RegExp("<(/?)(["+me+"]["+ue+"]*)","g");function P($,ie,re,be){this.line=ie,this.ch=re,this.cm=$,this.text=$.getLine(ie),this.min=be?Math.max(be.from,$.firstLine()):$.firstLine(),this.max=be?Math.min(be.to-1,$.lastLine()):$.lastLine()}function L($,ie){var re=$.cm.getTokenTypeAt(ve($.line,ie));return re&&/\btag\b/.test(re)}function R($){return $.line>=$.max?void 0:($.ch=0,$.text=$.cm.getLine(++$.line),!0)}function F($){return $.line<=$.min?void 0:($.text=$.cm.getLine(--$.line),$.ch=$.text.length,!0)}function O($){for(;;){var ie=$.text.indexOf(">",$.ch);if(ie==-1){if(R($))continue;return}if(!L($,ie+1)){$.ch=ie+1;continue}var re=$.text.lastIndexOf("/",ie),be=re>-1&&!/\S/.test($.text.slice(re+1,ie));return $.ch=ie+1,be?"selfClose":"regular"}}function T($){for(;;){var ie=$.ch?$.text.lastIndexOf("<",$.ch-1):-1;if(ie==-1){if(F($))continue;return}if(!L($,ie+1)){$.ch=ie;continue}q.lastIndex=ie,$.ch=ie;var re=q.exec($.text);if(re&&re.index==ie)return re}}function ee($){for(;;){q.lastIndex=$.ch;var ie=q.exec($.text);if(!ie){if(R($))continue;return}if(!L($,ie.index+1)){$.ch=ie.index+1;continue}return $.ch=ie.index+ie[0].length,ie}}function U($){for(;;){var ie=$.ch?$.text.lastIndexOf(">",$.ch-1):-1;if(ie==-1){if(F($))continue;return}if(!L($,ie+1)){$.ch=ie;continue}var re=$.text.lastIndexOf("/",ie),be=re>-1&&!/\S/.test($.text.slice(re+1,ie));return $.ch=ie+1,be?"selfClose":"regular"}}function W($,ie){for(var re=[];;){var be=ee($),je,fe=$.line,le=$.ch-(be?be[0].length:0);if(!be||!(je=O($)))return;if(je=="selfClose")continue;if(be[1]){for(var v=re.length-1;v>=0;--v)if(re[v]==be[2]){re.length=v;break}if(v<0&&(!ie||ie==be[2]))return{tag:be[2],from:ve(fe,le),to:ve($.line,$.ch)}}else re.push(be[2])}}function V($,ie){for(var re=[];;){var be=U($);if(!be)return;if(be=="selfClose"){T($);continue}var je=$.line,fe=$.ch,le=T($);if(!le)return;if(le[1])re.push(le[2]);else{for(var v=re.length-1;v>=0;--v)if(re[v]==le[2]){re.length=v;break}if(v<0&&(!ie||ie==le[2]))return{tag:le[2],from:ve($.line,$.ch),to:ve(je,fe)}}}}z.registerHelper("fold","xml",function($,ie){for(var re=new P($,ie.line,0);;){var be=ee(re);if(!be||re.line!=ie.line)return;var je=O(re);if(!je)return;if(!be[1]&&je!="selfClose"){var fe=ve(re.line,re.ch),le=W(re,be[2]);return le&&Z(le.from,fe)>0?{from:fe,to:le.from}:null}}}),z.findMatchingTag=function($,ie,re){var be=new P($,ie.line,ie.ch,re);if(be.text.indexOf(">")==-1&&be.text.indexOf("<")==-1)return;var je=O(be),fe=je&&ve(be.line,be.ch),le=je&&T(be);if(!je||!le||Z(be,ie)>0)return;var v={from:ve(be.line,be.ch),to:fe,tag:le[2]};return je=="selfClose"?{open:v,close:null,at:"open"}:le[1]?{open:V(be,le[2]),close:v,at:"close"}:(be=new P($,fe.line,fe.ch,re),{open:v,close:W(be,le[2]),at:"open"})},z.findEnclosingTag=function($,ie,re,be){for(var je=new P($,ie.line,ie.ch,re);;){var fe=V(je,be);if(!fe)break;var le=new P($,ie.line,ie.ch,re),v=W(le,fe.tag);if(v)return{open:fe,close:v}}},z.scanForClosingTag=function($,ie,re,be){var je=new P($,ie.line,ie.ch,be?{from:0,to:be}:null);return W(je,re)}})},p5ED:function(nt,Ye,y){"use strict";var z=y("+L6B"),ve=y("2/Rp"),Z=y("5Dmo"),me=y("3S7+"),ue=y("k1fw"),q=y("tJVT"),P=y("q1tI"),L=y.n(P),R=y("vHTk"),F=y.n(R),O=y("yEEn"),T=y("ZW9T"),ee=y("1vsH");Ye.a=function(U){var W=U.name,V=U.data,$=U.theme,ie=U.type,re=U.filename,be=U.monacoEditor,je=U.className,fe=U.style,le=U.close,v=U.onClose,pe=U.hasMask,ne=Object(P.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ye=Object(q.a)(ne,2),j=ye[0],E=ye[1],K=Object(P.useState)(""),X=Object(q.a)(K,2),C=X[0],k=X[1],Y=Object(P.useRef)();re&&(be.filename=re),Object(P.useEffect)(function(){var _,m,Q=(_=document.cookie)===null||_===void 0||((m=_.replace(/\s/g,""))===null||m===void 0)?void 0:m.split(";");Q==null||Q.map(function(Oe){var Ce=Oe.split("=");Ce[0]==="_educoder_session"&&k(Ce[1])})},[]);var M=function(){if(V.startsWith("http")||V.startsWith("/")){de();return}Object(ee.x)(re||"educoder",V,re)},de=function(){Object(ee.v)(re||W,V)};return console.log("data:",V,"fileanme:",re," name:",W),L.a.createElement("div",{style:Object(ue.a)({},fe||{}),className:"".concat(pe&&F.a.bgBlack," ").concat(ie?F.a.wrp:"hide")},le&&L.a.createElement("div",{className:F.a.close,ref:Y},L.a.createElement(me.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Y.current}},L.a.createElement("span",{onClick:de},L.a.createElement("i",{className:"icon-quxiaozhiding"}))),L.a.createElement(me.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Y.current}},L.a.createElement("span",{className:"",onClick:v},L.a.createElement("i",{className:"icon-guanbi1"})))),L.a.createElement("div",{className:"".concat(F.a[je]," ").concat(je," ").concat(F.a.monaco," ").concat(ie==="txt"?"show":"hide")},ie==="txt"&&L.a.createElement(T.b,be)),ie==="audio"&&L.a.createElement("audio",{src:"".concat(V!=null&&V.startsWith("/")||(V==null?void 0:V.indexOf("https://"))>-1?V:"data:audio/mp3;base64,").concat(V),autoPlay:!0}),ie==="video"&&L.a.createElement(L.a.Fragment,null,V!=null&&V.startsWith("/")?L.a.createElement("video",{controls:!0,src:"".concat(V),autoPlay:!0}):L.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(V),autoPlay:!0})),ie==="html"&&L.a.createElement("iframe",{src:V+"&disposition=inline"}),ie==="pdf"&&L.a.createElement("embed",{className:F.a.embed,src:V}),ie==="image"&&L.a.createElement(L.a.Fragment,null,L.a.createElement("img",{src:"".concat(V!=null&&V.startsWith("/")||(V==null?void 0:V.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(V)})),ie==="other"&&L.a.createElement("div",null,L.a.createElement(ve.a,{type:"primary",size:"large",onClick:M},L.a.createElement(O.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(ie==="download"||ie==="office")&&L.a.createElement(ve.a,{type:"primary",size:"large",onClick:M},L.a.createElement(O.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(nt,Ye,y){},"rAM+":function(nt,Ye,y){"use strict";y.d(Ye,"a",function(){return ve});var z=y("Qw5x");function ve(Z,me){var ue;if(typeof Symbol=="undefined"||Z[Symbol.iterator]==null){if(Array.isArray(Z)||(ue=Object(z.a)(Z))||me&&Z&&typeof Z.length=="number"){ue&&(Z=ue);var q=0,P=function(){};return{s:P,n:function(){return q>=Z.length?{done:!0}:{done:!1,value:Z[q++]}},e:function(T){throw T},f: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.`)}var L=!0,R=!1,F;return{s:function(){ue=Z[Symbol.iterator]()},n:function(){var T=ue.next();return L=T.done,T},e:function(T){R=!0,F=T},f:function(){try{!L&&ue.return!=null&&ue.return()}finally{if(R)throw F}}}}},rUJ1:function(nt,Ye){const y=/[&<>"']/,z=/[&<>"']/g,ve=/[<>"']|&(?!#?\w+;)/,Z=/[<>"']|&(?!#?\w+;)/g,me={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ue=pe=>me[pe];function q(pe,ne){if(ne){if(y.test(pe))return pe.replace(z,ue)}else if(ve.test(pe))return pe.replace(Z,ue);return pe}const P=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function L(pe){return pe.replace(P,(ne,ye)=>(ye=ye.toLowerCase(),ye==="colon"?":":ye.charAt(0)==="#"?ye.charAt(1)==="x"?String.fromCharCode(parseInt(ye.substring(2),16)):String.fromCharCode(+ye.substring(1)):""))}const R=/(^|[^\[])\^/g;function F(pe,ne){pe=pe.source||pe,ne=ne||"";const ye={replace:(j,E)=>(E=E.source||E,E=E.replace(R,"$1"),pe=pe.replace(j,E),ye),getRegex:()=>new RegExp(pe,ne)};return ye}const O=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function ee(pe,ne,ye){if(pe){let j;try{j=decodeURIComponent(L(ye)).replace(O,"").toLowerCase()}catch(E){return null}if(j.indexOf("javascript:")===0||j.indexOf("vbscript:")===0||j.indexOf("data:")===0)return null}ne&&!T.test(ye)&&(ye=ie(ne,ye));try{ye=encodeURI(ye).replace(/%25/g,"%")}catch(j){return null}return ye}const U={},W=/^[^:]+:\/*[^/]*$/,V=/^([^:]+:)[\s\S]*$/,$=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ie(pe,ne){U[" "+pe]||(W.test(pe)?U[" "+pe]=pe+"/":U[" "+pe]=fe(pe,"/",!0)),pe=U[" "+pe];const ye=pe.indexOf(":")===-1;return ne.substring(0,2)==="//"?ye?ne:pe.replace(V,"$1")+ne:ne.charAt(0)==="/"?ye?ne:pe.replace($,"$1")+ne:pe+ne}const re={exec:function(){}};function be(pe){let ne=1,ye,j;for(;ne<arguments.length;ne++){ye=arguments[ne];for(j in ye)Object.prototype.hasOwnProperty.call(ye,j)&&(pe[j]=ye[j])}return pe}function je(pe,ne){const ye=pe.replace(/\|/g,(K,X,C)=>{let k=!1,Y=X;for(;--Y>=0&&C[Y]==="\\";)k=!k;return k?"|":" |"}),j=ye.split(/ \|/);let E=0;if(j.length>ne)j.splice(ne);else for(;j.length<ne;)j.push("");for(;E<j.length;E++)j[E]=j[E].trim().replace(/\\\|/g,"|");return j}function fe(pe,ne,ye){const j=pe.length;if(j===0)return"";let E=0;for(;E<j;){const K=pe.charAt(j-E-1);if(K===ne&&!ye)E++;else if(K!==ne&&ye)E++;else break}return pe.substr(0,j-E)}function le(pe,ne){if(pe.indexOf(ne[1])===-1)return-1;const ye=pe.length;let j=0,E=0;for(;E<ye;E++)if(pe[E]==="\\")E++;else if(pe[E]===ne[0])j++;else if(pe[E]===ne[1]&&(j--,j<0))return E;return-1}function v(pe){pe&&pe.sanitize&&!pe.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}nt.exports={escape:q,unescape:L,edit:F,cleanUrl:ee,resolveUrl:ie,noopTest:re,merge:be,splitCells:je,rtrim:fe,findClosingBracket:le,checkSanitizeDeprecation:v}},rcnY:function(nt,Ye,y){var z=y("aRTE");function ve(Z,me){this.totalCount=Z,this.dataCount=me}ve.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],ve.getRSBlocks=function(Z,me){var ue=ve.getRsBlockTable(Z,me);if(ue==null)throw new Error("bad rs block @ typeNumber:"+Z+"/errorCorrectLevel:"+me);for(var q=ue.length/3,P=new Array,L=0;L<q;L++)for(var R=ue[L*3+0],F=ue[L*3+1],O=ue[L*3+2],T=0;T<R;T++)P.push(new ve(F,O));return P},ve.getRsBlockTable=function(Z,me){switch(me){case z.L:return ve.RS_BLOCK_TABLE[(Z-1)*4+0];case z.M:return ve.RS_BLOCK_TABLE[(Z-1)*4+1];case z.Q:return ve.RS_BLOCK_TABLE[(Z-1)*4+2];case z.H:return ve.RS_BLOCK_TABLE[(Z-1)*4+3];default:return}},nt.exports=ve},sDPU:function(nt,Ye,y){"use strict";y.r(Ye);var z=y("cWXX"),ve=y("/ezw"),Z=y("k1fw"),me=y("9og8"),ue=y("tJVT"),q=y("WmNS"),P=y.n(q),L=y("q1tI"),R=y.n(L),F=y("Ty5D"),O=y("9kvl"),T=y("FIWC"),ee=y.n(T),U=y("sbIO"),W=y("ErOA"),V=y("LvDl"),$=y.n(V),ie=function(be){var je,fe,le,v,pe=be.paperlibrary,ne=be.user,ye=be.globalSetting,j=be.dispatch,E=be.location,K=(E==null||((je=E.query)===null||je===void 0)?void 0:je.select)||0,X=Object(L.useState)(!1),C=Object(ue.a)(X,2),k=C[0],Y=C[1],M=Object(L.useState)(!0),de=Object(ue.a)(M,2),_=de[0],m=de[1],Q=Object(L.useState)(Number(K)),Oe=Object(ue.a)(Q,2),Ce=Oe[0],Ve=Oe[1],$e=Object(L.useState)({}),_e=Object(ue.a)($e,2),Le=_e[0],Se=_e[1],Te=Object(F.i)(),te=ne.userInfo;Object(L.useEffect)(function(){return j({type:"globalSetting/footerToggle",payload:!1}),function(){j({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(L.useEffect)(function(){return j({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),j({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),function(){j({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),j({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[]),Object(L.useEffect)(function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}},[]),Object(L.useEffect)(function(){w(Ce)},[]);var w=function(){var Pe=Object(me.a)(P.a.mark(function ze(){var Xe,qe,He=arguments;return P.a.wrap(function(Fe){for(;;)switch(Fe.prev=Fe.next){case 0:return Xe=He.length>0&&He[0]!==void 0?He[0]:0,console.log(Te),Fe.next=4,Object(W.a)("/api/exercises/".concat(Te.categoryId,"/preview_random_exercise.json"),{method:"get",params:{num:Xe}});case 4:qe=Fe.sent,m(!1),Se(Ie(qe));case 7:case"end":return Fe.stop()}},ze)}));return function(){return Pe.apply(this,arguments)}}(),Ie=function(ze){var Xe={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!ze)return;var qe=ze||{},He=qe.exam,Be=qe.single_questions,Fe=qe.multiple_questions,Lt=qe.judgement_questions,ht=qe.program_questions,ot=qe.completion_questions,st=qe.subjective_questions,Et=qe.practical_questions,bt=qe.combination_questions,ft=[Object(Z.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},Be),Object(Z.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},Fe),Object(Z.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},ot),Object(Z.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Lt),Object(Z.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},st),Object(Z.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},ht),Object(Z.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},Et),Object(Z.a)({type:"COMBINATION",name:"\u7EC4\u5408\u9898"},bt)],we=[],St=0,lt=0,ke=ft.filter(function(Re){return Re.questions_count>0}).map(function(Re,D){var B;return(B=Re.questions)===null||B===void 0||B.forEach(function(I){we.push(I.id),St=St+I.score,lt=lt+1}),Object(Z.a)(Object(Z.a)({},Re),{number:Xe[D+1]})});return{all_questions_count:lt,all_score:St,questionList:ke,ids:we,exam:He}},dt=function(){O.d.push("/classrooms/".concat(Te.coursesId,"/exercise"))},kt=function(){alert("\u4FDD\u5B58")},Qe=function(){var Pe=Object(me.a)(P.a.mark(function ze(Xe,qe){var He,Be,Fe;return P.a.wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:return ht.next=2,Object(W.a)("/api/exercises/".concat(Te.categoryId,"/toggle_random_question.json"),{method:"post",body:{question_id:Xe==null?void 0:Xe.single_question_id}});case 2:He=ht.sent,He!=null&&He.question&&(Fe=Object(V.cloneDeep)(Le),Fe.questionList=Fe==null||((Be=Fe.questionList)===null||Be===void 0)?void 0:Be.map(function(ot){if(ot.type===qe.type){var st=Object(V.cloneDeep)(ot==null?void 0:ot.questions);return st.splice(qe.index,1,He==null?void 0:He.question),Object(Z.a)(Object(Z.a)({},ot),{},{questions:st})}return ot}),Se(Fe));case 4:case"end":return ht.stop()}},ze)}));return function(Xe,qe){return Pe.apply(this,arguments)}}(),Je=function(){var Pe=Object(me.a)(P.a.mark(function ze(Xe){return P.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:document.body.scrollIntoView(),w(Xe),Ve(Xe);case 3:case"end":return He.stop()}},ze)}));return function(Xe){return Pe.apply(this,arguments)}}();return console.log(Object(F.h)(),"location333"),R.a.createElement("section",{className:ee.a.wrap},R.a.createElement(ve.a,{loading:_,active:!0,paragraph:{rows:5}},((fe=Object(F.h)())===null||fe===void 0||((le=fe.pathname)===null||le===void 0)?void 0:le.includes("preview"))&&R.a.createElement("div",{className:ee.a.crumbs},R.a.createElement("b",null),R.a.createElement("span",{className:"current",onClick:function(){return O.d.push("/classrooms/".concat(Te.coursesId,"/exercise"))}},"".concat(te==null||((v=te.course)===null||v===void 0)?void 0:v.course_name,">")),R.a.createElement("span",{className:"current",onClick:function(){return O.d.push("/classrooms/".concat(Te.coursesId,"/exercise"))}},"\u8BD5\u5377\u5217\u8868>"),R.a.createElement("span",{style:{color:"#bebebe"}},"\u9884\u89C8")),R.a.createElement(U.a,{loading:k,submit:kt,goBack:dt,data:Le,selectValue:Ce,editPreview:!0,onExchange:Qe,onSkipExamination:Je})))};Ye.default=Object(O.a)(function(re){var be=re.paperlibrary,je=re.user,fe=re.globalSetting;return{paperlibrary:be,user:je,globalSetting:fe}})(ie)},sbIO:function(nt,Ye,y){"use strict";var z=y("DjyN"),ve=y("NUBc"),Z=y("5Dmo"),me=y("3S7+"),ue=y("/zsF"),q=y("PArb"),P=y("Q9mQ"),L=y("diRs"),R=y("+L6B"),F=y("2/Rp"),O=y("5NDa"),T=y("5rEg"),ee=y("miYZ"),U=y("tsqr"),W=y("9og8"),V=y("giR+"),$=y("fyUT"),ie=y("2qtc"),re=y("kLXV"),be=y("tJVT"),je=y("WmNS"),fe=y.n(je),le=y("q1tI"),v=y.n(le),pe=y("PsQE"),ne=y.n(pe),ye=y("0eGx"),j=y.n(ye),E=y("9Bee"),K=y("Ty5D"),X=y("9kvl"),C=y("ErOA"),k=y("+yhJ"),Y=y.n(k),M=y("RZ/O"),de=y.n(M),_=y("LvDl"),m=y("6K3P"),Q=y.n(m),Oe=y("sRBo"),Ce=y("kaz8"),Ve=y("oBTY"),$e=y("PpiC"),_e=y("Ot1p"),Le=y("kqOp"),Se=y("7qnI"),Te=y("1vsH"),te=y("PGNT"),w=y.n(te),Ie=["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"],dt=function(D,B){var I=D.globalSetting,b=D.loading,x=D.dispatch,S=D.isEdit,A=D.editData,ae=Object($e.a)(D,["globalSetting","loading","dispatch","isEdit","editData"]),ge=Object(le.useState)(""),xe=Object(be.a)(ge,2),Ct=xe[0],At=xe[1],Ee=Object(le.useState)(""),it=Object(be.a)(Ee,2),pt=it[0],Ge=it[1],Dt=Object(le.useState)([]),Tt=Object(be.a)(Dt,2),Ft=Tt[0],Pt=Tt[1],ut=Object(le.useState)(""),Wt=Object(be.a)(ut,2),Nt=Wt[0],We=Wt[1],gt=Object(le.useState)(),vt=Object(be.a)(gt,2),_t=vt[0],Xt=vt[1],Gt=Object(le.useState)(!1),Zt=Object(be.a)(Gt,2),Ht=Zt[0],yt=Zt[1];Object(le.useEffect)(function(){if(!A||!S)return;At(A==null?void 0:A.name),Ge(A==null?void 0:A.analysis),Xt(A==null?void 0:A.is_ordered),yt(!0)},[A]),Object(le.useEffect)(function(){if(!Ht)return;var De=A==null?void 0:A.standard_answer.map(function(Ze){return Ze.answer_text});Pt(De),yt(!1)},[Ht]),Object(le.useImperativeHandle)(B,function(){return{onSave:Yt,Clear:Mt}});var Yt=function(){var Ze=[],on=!1;return Ct?(Ft.forEach(function(hn,gn){Ze.push({position:gn+1,answer_text:[]}),hn.forEach(function(En,h){Ze[gn].answer_text.push(En),(!En||!Object(Te.bb)(En,1e4))&&(We("".concat(gn,"-").concat(h)),U.b.info(En?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),on=!0)})}),on?!1:(Ze==null?void 0:Ze.length)>20?(U.b.warn("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:Ct,analysis:pt,standard_answers:Ze,is_ordered:_t}):(U.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Mt=function(){At(""),Ge(""),Pt([]),Xt(!1)},qt=function(Ze,on,hn){var gn=Ft.slice();if(on&&gn.splice(Ze,on),hn)for(var En=0;En<hn;En++)gn.splice(Ze+En,0,[""]);Pt(gn)},It=function(Ze,on,hn){We("");var gn=Ft.slice();gn[Ze][on]=hn,Pt(gn)},bn=function(Ze){var on=Ft.slice();on[Ze]=[].concat(Object(Ve.a)(on[Ze]),[""]),Pt(on)},oi=function(Ze,on){var hn=Ft.slice();if(!hn[Ze][on]){hn[Ze]=hn[Ze].filter(function(gn,En){return En!==on}),Pt(hn);return}re.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:w.a.modal,onOk:function(){hn[Ze]=hn[Ze].filter(function(En,h){return h!==on}),Pt(hn)}})},li=function(Ze){re.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:w.a.modal,onOk:function(){var hn=Ft.slice();hn=Ft.filter(function(gn,En){return Ze!==En}),Pt(hn)}})};return v.a.createElement("section",{className:w.a.wrap},v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u9898\u5E72\uFF1A")),v.a.createElement("div",null,v.a.createElement(Le.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Ct,onChange:function(Ze){return At(Ze)},showNullButton:!0,onPlaceholderChange:qt})),v.a.createElement("div",{className:"mt20"},Ft.map(function(De,Ze){return v.a.createElement(Se.a,{key:Ze,answers:De,index:Ze,flex:1,is_md:!0,activeOptionErrorIndex:Nt,onAnswerChange:It,addChildAnswer:bn,deleteChildAnswer:oi,deleteChildAnswermain:li})})),v.a.createElement("div",{className:"mt20"},Ft.length>1&&v.a.createElement("span",null,v.a.createElement(Ce.a,{checked:_t,onChange:function(Ze){return Xt(Ze.target.checked)},className:"".concat(w.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),v.a.createElement("span",{className:"".concat(w.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"))),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),v.a.createElement(_e.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:pt,onChange:function(Ze){return Ge(Ze)}}))},kt=Object(X.a)(function(Re){var D=Re.loading,B=Re.globalSetting;return{globalSetting:B,loading:D.effects}},null,null,{forwardRef:!0})(Object(le.forwardRef)(dt)),Qe=y("7Kak"),Je=y("9yH6"),Pe=["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"],ze=function(D,B){var I=D.globalSetting,b=D.loading,x=D.editData,S=D.dispatch,A=D.onRef,ae=A===void 0?function(){}:A,ge=D.isEdit,xe=Object($e.a)(D,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),Ct=Object(le.useState)(),At=Object(be.a)(Ct,2),Ee=At[0],it=At[1],pt=Object(le.useState)(""),Ge=Object(be.a)(pt,2),Dt=Ge[0],Tt=Ge[1],Ft=Object(le.useState)(""),Pt=Object(be.a)(Ft,2),ut=Pt[0],Wt=Pt[1];Object(le.useEffect)(function(){if(!x||!ge)return;Tt(x==null?void 0:x.name),Wt(x==null?void 0:x.analysis);var gt=x==null?void 0:x.choices.find(function(vt){return vt.is_answer});it(gt.choice_text==="\u6B63\u786E"?"0":"1")},[x]),Object(le.useImperativeHandle)(B,function(){return{onSave:Nt,Clear:We}});var Nt=function(){if(!Dt)return U.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(!Ee)return U.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1;var vt=[{choice_text:"\u6B63\u786E",is_answer:Ee==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Ee==="1"?1:0}];return{name:Dt,choices:vt,analysis:ut}},We=function(){Tt(""),Wt(""),it("")};return v.a.createElement("section",{className:w.a.wrap},v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u9898\u5E72\uFF1A")),v.a.createElement(_e.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Dt,onChange:function(vt){return Tt(vt)}}),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",v.a.createElement("span",{className:w.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),v.a.createElement(Je.a.Group,{buttonStyle:"solid",value:Ee,onChange:function(vt){return it(vt.target.value)}},v.a.createElement(Je.a.Button,{value:"0",className:"".concat(w.a.radio," mr40")},"\u6B63\u786E"),v.a.createElement(Je.a.Button,{value:"1",className:w.a.radio},"\u9519\u8BEF")),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),v.a.createElement(_e.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ut,onChange:function(vt){return Wt(vt)}}))},Xe=Object(X.a)(function(Re){var D=Re.loading,B=Re.globalSetting;return{globalSetting:B,loading:D.effects}},null,null,{forwardRef:!0})(Object(le.forwardRef)(ze)),qe=["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(D,B){var I=D.editData,b=D.globalSetting,x=D.loading,S=D.dispatch,A=D.onRef,ae=A===void 0?function(){}:A,ge=D.isEdit,xe=Object($e.a)(D,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Ct=Object(le.useState)([]),At=Object(be.a)(Ct,2),Ee=At[0],it=At[1],pt=Object(le.useState)(),Ge=Object(be.a)(pt,2),Dt=Ge[0],Tt=Ge[1],Ft=Object(le.useState)([]),Pt=Object(be.a)(Ft,2),ut=Pt[0],Wt=Pt[1],Nt=Object(le.useState)(""),We=Object(be.a)(Nt,2),gt=We[0],vt=We[1],_t=Object(le.useState)(""),Xt=Object(be.a)(_t,2),Gt=Xt[0],Zt=Xt[1];Object(le.useEffect)(function(){it(["","","",""])},[]),Object(le.useEffect)(function(){if(!I||!ge)return;vt(I==null?void 0:I.name),Zt(I==null?void 0:I.analysis),it(I==null?void 0:I.choices.map(function(Mt){return Mt.choice_text}));var Yt=[];I==null||I.choices.map(function(Mt,qt){Mt.is_answer&&Yt.push(qt)}),Wt(Yt)},[I]),Object(le.useImperativeHandle)(B,function(){return{onSave:Ht,Clear:yt}});var Ht=function(){if(!gt)return U.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Mt=Ee.findIndex(function(It){return!It});if(Mt>-1)return U.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(qe[Mt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(!ut.length)return U.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(ut.length<2)return U.b.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;var qt=Ee.map(function(It,bn){return{choice_text:It,is_answer:ut.includes(bn)?1:0}});return{name:gt,choices:qt,analysis:Gt}},yt=function(){it(["","","",""]),vt(""),Zt(""),Wt("")};return v.a.createElement("section",{className:w.a.wrap},v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u9898\u5E72\uFF1A")),v.a.createElement(_e.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:gt,onChange:function(Mt){return vt(Mt)}}),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",v.a.createElement("span",{className:w.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ee.map(function(Yt,Mt){return v.a.createElement("div",{className:w.a.choiceWrap,key:Mt},v.a.createElement(me.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},v.a.createElement("div",{className:"".concat(w.a.answer," ").concat(ut.includes(Mt)?w.a.activeAnswer:""),onClick:function(){ut.includes(Mt)?Wt(ut.filter(function(It){return It!==Mt})):Wt([].concat(Object(Ve.a)(ut),[Mt]))}},qe[Mt])),v.a.createElement("div",{className:w.a.editorWrap},Dt===Mt?v.a.createElement(_e.a,{id:"single-question-option-".concat(Mt),watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Yt,onChange:function(It){Ee[Mt]=It,it(Ee)}}):v.a.createElement("div",{className:w.a.htmlWrap,onClick:function(){return Tt(Mt)}},v.a.createElement(E.a,{value:Yt}))),Mt>1&&v.a.createElement(me.a,{title:"\u5220\u9664"},v.a.createElement("i",{className:"".concat(w.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){it(Ee.filter(function(It,bn){return bn!==Mt})),ut.includes(Mt)?Wt(ut.filter(function(It){return It!==Mt})):Wt([].concat(Object(Ve.a)(ut),[Mt]))}})),Mt<7&&Mt===Ee.length-1&&v.a.createElement(me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},v.a.createElement("i",{className:"".concat(w.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return it([].concat(Object(Ve.a)(Ee),[""]))}})))}),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),v.a.createElement(_e.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gt,onChange:function(Mt){return Zt(Mt)}}))},Be=Object(X.a)(function(Re){var D=Re.loading,B=Re.globalSetting;return{globalSetting:B,loading:D.effects}},null,null,{forwardRef:!0})(Object(le.forwardRef)(He)),Fe=["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"],Lt=function(D,B){var I=D.editData,b=D.globalSetting,x=D.loading,S=D.dispatch,A=D.onRef,ae=A===void 0?function(){}:A,ge=D.isEdit,xe=Object($e.a)(D,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Ct=Object(le.useState)([]),At=Object(be.a)(Ct,2),Ee=At[0],it=At[1],pt=Object(le.useState)(),Ge=Object(be.a)(pt,2),Dt=Ge[0],Tt=Ge[1],Ft=Object(le.useState)(),Pt=Object(be.a)(Ft,2),ut=Pt[0],Wt=Pt[1],Nt=Object(le.useState)(""),We=Object(be.a)(Nt,2),gt=We[0],vt=We[1],_t=Object(le.useState)(""),Xt=Object(be.a)(_t,2),Gt=Xt[0],Zt=Xt[1];Object(le.useEffect)(function(){it(["","","",""])},[]),Object(le.useEffect)(function(){if(!I||!ge)return;vt(I==null?void 0:I.name),Zt(I==null?void 0:I.analysis),it(I==null?void 0:I.choices.map(function(Yt){return Yt.choice_text})),Wt(I==null?void 0:I.choices.findIndex(function(Yt){return Yt.is_answer}))},[I]),Object(le.useImperativeHandle)(B,function(){return{onSave:Ht,Clear:yt}});var Ht=function(){if(!gt)return U.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;var Mt=Ee.findIndex(function(It){return!It});if(Mt>-1)return U.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Fe[Mt]," \u9009\u9879\u7684\u5185\u5BB9")),!1;if(console.log("activeAnswer: ",ut),!(typeof ut=="number"))return U.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 qt=Ee.map(function(It,bn){return{choice_text:It,is_answer:ut===bn?1:0}});return{name:gt,choices:qt,analysis:Gt}},yt=function(){it(["","","",""]),vt(""),Zt(""),Wt("")};return v.a.createElement("section",{className:w.a.wrap},v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u9898\u5E72\uFF1A")),v.a.createElement(_e.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:gt,onChange:function(Mt){return vt(Mt)}}),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",v.a.createElement("span",{className:w.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Ee.map(function(Yt,Mt){return v.a.createElement("div",{className:w.a.choiceWrap,key:Mt},v.a.createElement(me.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},v.a.createElement("div",{className:"".concat(w.a.answer," ").concat(ut===Mt?w.a.activeAnswer:""),onClick:function(){return Wt(Mt)}},Fe[Mt])),v.a.createElement("div",{className:w.a.editorWrap},Dt===Mt?v.a.createElement(_e.a,{id:"single-question-option-".concat(Mt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Yt,onChange:function(It){Ee[Mt]=It,it(Ee)}}):v.a.createElement("div",{className:w.a.htmlWrap,onClick:function(){return Tt(Mt)}},v.a.createElement(E.a,{value:Yt}))),Mt>1&&v.a.createElement(me.a,{title:"\u5220\u9664"},v.a.createElement("i",{className:"".concat(w.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){it(Ee.filter(function(It,bn){return bn!==Mt})),Mt===ut&&Wt(null)}})),Mt<7&&Mt===Ee.length-1&&v.a.createElement(me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},v.a.createElement("i",{className:"".concat(w.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return it([].concat(Object(Ve.a)(Ee),[""]))}})))}),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),v.a.createElement(_e.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gt,onChange:function(Mt){return Zt(Mt)}}))},ht=Object(X.a)(function(Re){var D=Re.loading,B=Re.globalSetting;return{globalSetting:B,loading:D.effects}},null,null,{forwardRef:!0})(Object(le.forwardRef)(Lt)),ot=["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(D,B){var I=D.editData,b=D.globalSetting,x=D.loading,S=D.dispatch,A=D.onRef,ae=A===void 0?function(){}:A,ge=D.isEdit,xe=Object($e.a)(D,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Ct=Object(le.useState)(""),At=Object(be.a)(Ct,2),Ee=At[0],it=At[1],pt=Object(le.useState)(""),Ge=Object(be.a)(pt,2),Dt=Ge[0],Tt=Ge[1],Ft=Object(le.useState)(""),Pt=Object(be.a)(Ft,2),ut=Pt[0],Wt=Pt[1];Object(le.useEffect)(function(){var gt;if(!I||!ge)return;it(I==null?void 0:I.name),Tt(I==null?void 0:I.analysis),Wt(I==null||((gt=I.answer_texts)===null||gt===void 0)?void 0:gt[0])},[I]),Object(le.useImperativeHandle)(B,function(){return{onSave:Nt,Clear:We}});var Nt=function(){return Ee?ut?{name:Ee,answer_texts:[ut],analysis:Dt}:(U.b.info("\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848"),!1):(U.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},We=function(){it(""),Tt(""),Wt("")};return v.a.createElement("section",{className:w.a.wrap},v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u9898\u5E72\uFF1A")),v.a.createElement(_e.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ee,onChange:function(vt){return it(vt)}}),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),v.a.createElement(_e.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:ut,onChange:function(vt){return Wt(vt)}}),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),v.a.createElement(_e.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Dt,onChange:function(vt){return Tt(vt)}}))},Et=Object(X.a)(function(Re){var D=Re.loading,B=Re.globalSetting;return{globalSetting:B,loading:D.effects}},null,null,{forwardRef:!0})(Object(le.forwardRef)(st)),bt=y("k1fw"),ft=["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(D,B){var I=D.globalSetting,b=D.loading,x=D.dispatch,S=D.editData,A=D.onRef,ae=A===void 0?function(){}:A,ge=D.isEdit,xe=Object($e.a)(D,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),Ct=Object(le.useState)(""),At=Object(be.a)(Ct,2),Ee=At[0],it=At[1],pt=Object(le.useState)([]),Ge=Object(be.a)(pt,2),Dt=Ge[0],Tt=Ge[1];console.log(Dt),Object(le.useEffect)(function(){var Nt;if(!S||!ge)return;it(S==null?void 0:S.name);var We=S==null||((Nt=S.sub_item_banks)===null||Nt===void 0)?void 0:Nt.map(function(gt){var vt,_t,Xt;return Object(bt.a)(Object(bt.a)({},gt),{},{id:gt.id,open:!1,qusList:gt==null||((vt=gt.choices)===null||vt===void 0)?void 0:vt.map(function(Gt){return Gt.choice_text}),activeQusEditor:null,qusAnswer:(_t=[gt==null||((Xt=gt.choices)===null||Xt===void 0)?void 0:Xt.findIndex(function(Gt){return Gt.is_answer})])===null||_t===void 0?void 0:_t.filter(function(Gt){return Gt!==-1})})});Tt(We)},[S]),Object(le.useImperativeHandle)(B,function(){return{onSave:Ft,Clear:Pt}});var Ft=function(){if(!Ee)return U.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;if(Dt.length===0)return U.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),!1;for(var We=0;We<Dt.length;We++){var gt,vt=Dt[We];if(!(vt!=null&&vt.name))return U.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(We+1,"\u5C0F\u9898\u9898\u5E72")),!1;var _t=vt==null||((gt=vt.qusList)===null||gt===void 0)?void 0:gt.findIndex(function(Gt){return!Gt});if(_t>-1)return U.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(We+1,"\u5C0F\u9898").concat(ft[_t],"\u9009\u9879\u7684\u5185\u5BB9")),!1;if(!(vt!=null&&vt.qusAnswer.length))return U.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(We+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),!1}var Xt=Dt.map(function(Gt){return{id:Gt.id>1?Gt.id:null,name:Gt.name,item_type:Gt.item_type,analysis:Gt.analysis,choices:Gt.qusList.map(function(Zt,Ht){return{choice_text:Zt,is_answer:Gt.qusAnswer[0]===Ht?1:0}})}});return{name:Ee,sub_item_banks:Xt}},Pt=function(){it(""),Tt([])},ut=function(){var We={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Tt(Dt.concat(We))},Wt=function(We,gt,vt){var _t=Object(_.cloneDeep)(Dt);if(We==="open"&&(_t[gt].open=!_t[gt].open),We==="delete"&&_t.splice(gt,1),We==="value"&&(_t[gt].name=vt),We==="answer"&&(_t[gt].qusAnswer=[vt]),We==="edit"&&(_t[gt].activeQusEditor=vt),We==="details"&&(_t[gt].qusList[_t[gt].activeQusEditor]=vt),We==="addQus"&&(_t[gt].qusList=_t[gt].qusList.concat("")),We==="deleteQus"){var Xt;_t[gt].qusList=_t[gt].qusList.filter(function(Gt,Zt){return Zt!==vt}),_t[gt].qusAnswer=(Xt=_t[gt].qusAnswer)===null||Xt===void 0?void 0:Xt.filter(function(Gt){return Gt!==vt})}We==="analysis"&&(_t[gt].analysis=vt),Tt(_t)};return v.a.createElement("section",{className:w.a.wrap},v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u9898\u5E72\uFF1A")),v.a.createElement(_e.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ee,onChange:function(We){return it(We)}}),Dt==null?void 0:Dt.map(function(Nt,We){var gt;return v.a.createElement("div",{className:w.a.fold,key:Nt.id},v.a.createElement("div",{onClick:function(){return Wt("open",We)},className:w.a.head},v.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Nt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),v.a.createElement("span",null,"\u7B2C",We+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),v.a.createElement("b",{style:{visibility:"hidden"},onClick:function(_t){_t.stopPropagation(),Wt("delete",We)},className:"iconfont icon-shanchu8"})),v.a.createElement("div",{className:"mb10",style:{display:Nt.open?"block":"none"}},v.a.createElement(_e.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Nt==null?void 0:Nt.name,onChange:function(_t){return Wt("value",We,_t)}}),v.a.createElement("p",{className:w.a.titleWrap},v.a.createElement("span",{className:w.a.required},"*"),v.a.createElement("span",{className:w.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",v.a.createElement("span",{className:w.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Nt==null||((gt=Nt.qusList)===null||gt===void 0)?void 0:gt.map(function(vt,_t){var Xt,Gt;return v.a.createElement("div",{className:w.a.choiceWrap,key:_t},v.a.createElement(me.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},v.a.createElement("div",{className:"".concat(w.a.answer," ").concat(Nt!=null&&(Xt=Nt.qusAnswer)!==null&&Xt!==void 0&&Xt.includes(_t)?w.a.activeAnswer:""),onClick:function(){return Wt("answer",We,_t)}},ft[_t])),v.a.createElement("div",{className:w.a.editorWrap},(Nt==null?void 0:Nt.activeQusEditor)===_t?v.a.createElement(_e.a,{id:"single-question-option-".concat(_t),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:vt,onChange:function(Ht){return Wt("details",We,Ht)}}):v.a.createElement("div",{className:w.a.htmlWrap,onClick:function(){return Wt("edit",We,_t)}},v.a.createElement(E.a,{value:vt}))),_t>1&&v.a.createElement(me.a,{title:"\u5220\u9664"},v.a.createElement("i",{className:"".concat(w.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Wt("deleteQus",We,_t)}})),_t<7&&_t===(Nt==null||((Gt=Nt.qusList)===null||Gt===void 0)?void 0:Gt.length)-1&&v.a.createElement(me.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},v.a.createElement("i",{className:"".concat(w.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Wt("addQus",We)}})))}),v.a.createElement("p",{className:"mb10 mt10"},v.a.createElement("span",{className:w.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),v.a.createElement(_e.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Nt.analysis,onChange:function(_t){return Wt("analysis",We,_t)}})))}))},St=Object(X.a)(function(Re){var D=Re.loading,B=Re.globalSetting;return{globalSetting:B,loading:D.effects}},null,null,{forwardRef:!0})(Object(le.forwardRef)(we)),lt=function(D){var B,I,b,x,S,A,ae,ge,xe=D.data,Ct=D.submit,At=D.goBack,Ee=D.loading,it=D.onTypeScore,pt=D.editPreview,Ge=pt===void 0?!1:pt,Dt=D.onSkipExamination,Tt=D.selectValue,Ft=D.onExchange,Pt=Object(le.useRef)(),ut=Object(le.useRef)(Object(_.debounce)(function(){return qt()},100,{leading:!0,trailing:!0})),Wt=Object(le.useState)(null),Nt=Object(be.a)(Wt,2),We=Nt[0],gt=Nt[1],vt=Object(le.useState)(!1),_t=Object(be.a)(vt,2),Xt=_t[0],Gt=_t[1],Zt=Object(K.i)();Object(le.useEffect)(function(){return window.addEventListener("scroll",ut==null?void 0:ut.current),function(){window.removeEventListener("scroll",ut==null?void 0:ut.current)}},[]),Object(le.useEffect)(function(){Gt(!0)},[]),Object(le.useEffect)(function(){var se,J,Me,rt,ct=(se=document.getElementById("examName"))===null||se===void 0||((J=se.getElementsByClassName("ant-pagination-options-quick-jumper"))===null||J===void 0||((Me=J[0])===null||Me===void 0||((rt=Me.childNodes)===null||rt===void 0)))?void 0:rt[2];ct&&(ct.nodeValue="\u4EFD")},[xe]);var Ht=function(J){var Me=parseInt(J);return isNaN(Me)?"":Me};function yt(){var se=0,J=0,Me=0;return document.body&&(J=document.body.scrollTop),document.documentElement&&(Me=document.documentElement.scrollTop),se=J-Me>0?J:Me,se}function Yt(){var se=0,J=0,Me=0;return document.body&&(J=document.body.scrollHeight),document.documentElement&&(Me=document.documentElement.scrollHeight),se=J-Me>0?J:Me,se}function Mt(){var se=0;return document.compatMode=="CSS1Compat"?se=document.documentElement.clientHeight:se=document.body.clientHeight,se}var qt=function(){var J=document.getElementById("preview_btns"),Me=document.getElementById("preview_btns_else");yt()+Mt()>=Yt()-68?(J.style.visibility="hidden",Me.style.visibility="visible"):(J.style.visibility="visible",Me.style.visibility="hidden")},It=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],bn=function(J){var Me,rt=[];return v.a.createElement(v.a.Fragment,null,v.a.createElement("aside",{className:ne.a.single},J==null||((Me=J.choices)===null||Me===void 0)?void 0:Me.map(function(ct,at){return ct.is_answer&&rt.push(on[at]),v.a.createElement("ul",{key:at},v.a.createElement("li",null,on[at],"\u3001"),v.a.createElement("li",null,v.a.createElement(E.a,{value:ct.choice_text})))})),v.a.createElement("div",{className:ne.a.analysis},v.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",rt.join(""),v.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",It[J.difficulty])),v.a.createElement("aside",null,v.a.createElement("span",{className:ne.a.text},"\u89E3\u6790:"),v.a.createElement(E.a,{value:J.analysis?J.analysis:"\u6682\u65E0\u89E3\u6790"})),v.a.createElement("ul",null,v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(J==null?void 0:J.discipline_name,"/").concat(J==null?void 0:J.sub_discipline_name)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),J==null?void 0:J.tag_discipline_name))))},oi=function(J){var Me,rt=J==null||((Me=J.standard_answer)===null||Me===void 0)?void 0:Me.map(function(ct){var at;return"\u7B54\u6848\uFF08\u586B\u7A7A".concat(ct.position,"\uFF09\uFF1A").concat(ct==null||((at=ct.answer_text)===null||at===void 0)?void 0:at.join("\u3001"))});return v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{className:ne.a.analysis},v.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",rt),v.a.createElement("aside",null,v.a.createElement("span",{className:ne.a.text},"\u89E3\u6790:"),v.a.createElement(E.a,{value:J.analysis?J.analysis:"\u6682\u65E0\u89E3\u6790"})),v.a.createElement("ul",null,v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(J==null?void 0:J.discipline_name,"/").concat(J==null?void 0:J.sub_discipline_name)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),J==null?void 0:J.tag_discipline_name))))},li=function(J){var Me;return v.a.createElement("div",{className:ne.a.analysis},v.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",J==null||((Me=J.answer_texts)===null||Me===void 0)?void 0:Me[0]),v.a.createElement("aside",null,v.a.createElement("span",{className:ne.a.text},"\u89E3\u6790:"),v.a.createElement(E.a,{value:J.analysis?J.analysis:"\u6682\u65E0\u89E3\u6790"})),v.a.createElement("ul",null,v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(J==null?void 0:J.discipline_name,"/").concat(J==null?void 0:J.sub_discipline_name)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),J==null?void 0:J.tag_discipline_name)))},De=function(J){var Me;return v.a.createElement("div",{className:ne.a.analysis},v.a.createElement("aside",null,v.a.createElement("span",{className:ne.a.text},"\u9884\u671F\u8F93\u51FA:"),v.a.createElement(E.a,{value:J==null||((Me=J.program_attr)===null||Me===void 0)?void 0:Me.description})),v.a.createElement("ul",null,v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(J==null?void 0:J.discipline_name,"/").concat(J==null?void 0:J.sub_discipline_name)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),J==null?void 0:J.tag_discipline_name)))},Ze=function(J,Me){var rt;return v.a.createElement("div",null,J==null||((rt=J.sub_item_banks)===null||rt===void 0)?void 0:rt.map(function(ct,at){var Ot,en=[];return v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},Me+1+"."+(at+1),"\uFF08\u5355\u9009\u9898\uFF09",ct.name),v.a.createElement("aside",{className:ne.a.single},ct==null||((Ot=ct.choices)===null||Ot===void 0)?void 0:Ot.map(function(mn,ln){return mn.is_answer&&en.push(on[ln]),v.a.createElement("ul",{key:ln},v.a.createElement("li",null,on[ln],"\u3001"),v.a.createElement("li",null,v.a.createElement(E.a,{value:mn.choice_text})))})),v.a.createElement("div",{className:ne.a.analysis},v.a.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",en.join(""),v.a.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",It[ct.difficulty])),v.a.createElement("aside",null,v.a.createElement("span",{className:ne.a.text},"\u89E3\u6790:"),v.a.createElement(E.a,{value:ct.analysis?ct.analysis:"\u6682\u65E0\u89E3\u6790"})),v.a.createElement("ul",null,v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),"".concat(J==null?void 0:J.discipline_name,"/").concat(J==null?void 0:J.sub_discipline_name)),v.a.createElement("li",null,v.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),J==null?void 0:J.tag_discipline_name))))}))},on=["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"],hn=function(J){console.log("---",J);var Me=[];J.questions.map(function(ct){return ct==null?void 0:ct.sub_item_banks.map(function(at){Me.push(at)})});var rt=0;J.type==="COMBINATION"?rt=J.questions_score/Me.length:rt=J.questions_score/J.questions_count,re.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:v.a.createElement("div",{className:ne.a.modalColumn},v.a.createElement("div",{className:ne.a.modalRow,style:{justifyContent:"flex-start"}},v.a.createElement("sup",{className:ne.a.sup},"*"),v.a.createElement("span",null,J==null?void 0:J.name,(J==null?void 0:J.type)==="COMBINATION"&&"\u4E2D\u7684\u6BCF\u5C0F\u9898","\uFF1A"),v.a.createElement($.a,{min:1,parser:Ht,defaultValue:rt,onChange:function(at){rt=at}}),v.a.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var ct=Object(W.a)(fe.a.mark(function Ot(){var en,mn;return fe.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:if(rt){tn.next=3;break}return U.b.warn("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),tn.abrupt("return",Promise.reject());case 3:J.type==="COMBINATION"?(en={type:J==null?void 0:J.type,score:rt,scoreTotal:rt*(Me==null?void 0:Me.length)},it(en)):(mn={type:J==null?void 0:J.type,score:rt,scoreTotal:rt*J.questions_count},it(mn));case 4:case"end":return tn.stop()}},Ot)}));function at(){return ct.apply(this,arguments)}return at}()})},gn=function(){var J="";re.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:v.a.createElement("div",{className:ne.a.modalColumn},v.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},v.a.createElement("img",{style:{marginRight:5},src:Q.a}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),v.a.createElement("div",{className:ne.a.modalRow,style:{marginTop:20}},v.a.createElement("sup",{className:ne.a.sup},"*"),v.a.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),v.a.createElement(T.a,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:J,onChange:function(rt){J=rt.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Me=Object(W.a)(fe.a.mark(function ct(){var at,Ot,en,mn,ln;return fe.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(J){wn.next=3;break}return U.b.warn("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),wn.abrupt("return",Promise.reject());case 3:return Ot=[],en=[],mn=[],xe==null||((at=xe.questionList)===null||at===void 0)||at.forEach(function(Sn){var Pn;(Pn=Sn.questions)===null||Pn===void 0||Pn.forEach(function(Yn){Ot.push(Yn.id),en.push(Sn.questions_score/Sn.questions_count),Sn.type==="COMBINATION"&&mn.push({id:Yn.id,sub_item_bank_ids:Yn.sub_item_banks.map(function(vn){return vn.id})})})}),console.log("-----",mn),ln={item_bank_ids:Ot,item_bank_scores:en,name:J,combination_item_banks:mn},wn.next=11,Ct(ln);case 11:case"end":return wn.stop()}},ct)}));function rt(){return Me.apply(this,arguments)}return rt}()})},En=function(J,Me,rt,ct){var at,Ot=(at=ct.questions)===null||at===void 0?void 0:at.map(function(mn){return mn.id}),en=re.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 mn=Object(W.a)(fe.a.mark(function tn(){return fe.a.wrap(function(Sn){for(;;)switch(Sn.prev=Sn.next){case 0:return en.update({cancelButtonProps:{disabled:!0}}),Sn.next=3,Ft({single_question_id:J,seleted_item_bank_ids:Ot},{type:Me,index:rt});case 3:en.update({cancelButtonProps:{disabled:!1}}),U.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898");case 5:case"end":return Sn.stop()}},tn)}));function ln(){return mn.apply(this,arguments)}return ln}()})},h=function(J){var Me,rt=(Me=J.questions)===null||Me===void 0?void 0:Me.map(function(Ot){return Ot.id}),ct=J.name,at=re.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362".concat(ct,"\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var Ot=Object(W.a)(fe.a.mark(function mn(){return fe.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return at.update({cancelButtonProps:{disabled:!0}}),tn.next=3,Ft({seleted_item_bank_ids:rt},{type:J.type});case 3:at.update({cancelButtonProps:{disabled:!1}}),U.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210".concat(ct,"\u8BD5\u9898"));case 5:case"end":return tn.stop()}},mn)}));function en(){return Ot.apply(this,arguments)}return en}()})},o=function(){var J=re.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 Me=Object(W.a)(fe.a.mark(function ct(){return fe.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:return J.update({cancelButtonProps:{disabled:!0}}),Ot.next=3,Ft();case 3:J.update({cancelButtonProps:{disabled:!1}}),U.b.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898");case 5:case"end":return Ot.stop()}},ct)}));function rt(){return Me.apply(this,arguments)}return rt}()})},a=function(J){console.log(J,"key"),Dt(J-1)},u=function(){return v.a.createElement(v.a.Fragment,null,v.a.createElement(L.a,{color:"#55575D",overlayClassName:ne.a.popover,visible:Xt,getPopupContainer:function(Me){return Me==null?void 0:Me.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"},v.a.createElement(F.a,{onMouseEnter:function(){return Gt(!0)},onMouseLeave:function(){return Gt(!1)},onClick:function(){gn()}},"\u4FDD\u5B58")),v.a.createElement(F.a,{onClick:function(){document.body.scrollIntoView(),At()}},"\u8FD4\u56DE"),v.a.createElement(F.a,{loading:Ee,onClick:function(){return Ct()},type:"primary"},"\u63D0\u4EA4"))},p=function(){var J;return v.a.createElement(v.a.Fragment,null,v.a.createElement(F.a,{onClick:At},"\u8FD4\u56DE"),Tt>0&&v.a.createElement(F.a,{onClick:function(){return a(Tt)},type:"primary"},"\u4E0A\u4E00\u4EFD"),Tt<(xe==null||((J=xe.exam)===null||J===void 0)?void 0:J.total_num)-1&&v.a.createElement(F.a,{onClick:function(){return a(Tt+2)}},"\u4E0B\u4E00\u4EFD"))},c=function(J,Me){if(console.log(J,222),Me==="SINGLE")return v.a.createElement(v.a.Fragment,null,v.a.createElement(ht,{ref:Pt,editData:J,isEdit:!0}),v.a.createElement(q.a,null));if(Me==="MULTIPLE")return v.a.createElement(v.a.Fragment,null,v.a.createElement(Be,{ref:Pt,editData:J,isEdit:!0}),v.a.createElement(q.a,null));if(Me==="JUDGMENT")return v.a.createElement(v.a.Fragment,null,v.a.createElement(Xe,{ref:Pt,editData:J,isEdit:!0}),v.a.createElement(q.a,null));if(Me==="COMPLETION")return v.a.createElement(v.a.Fragment,null,v.a.createElement(kt,{ref:Pt,editData:J,isEdit:!0}),v.a.createElement(q.a,null));if(Me==="SUBJECTIVE")return v.a.createElement(v.a.Fragment,null,v.a.createElement(Et,{ref:Pt,editData:J,isEdit:!0}),v.a.createElement(q.a,null));if(Me==="COMBINATION")return v.a.createElement(v.a.Fragment,null,v.a.createElement(St,{ref:Pt,editData:J,isEdit:!0}),v.a.createElement(q.a,null));if(Me==="PROGRAM"){var rt;X.d.push("/problems/".concat(J==null||((rt=J.program_attr)===null||rt===void 0)?void 0:rt.identifier,"/edit?type=exercises&express_id=").concat(Zt.categoryId,"&question_id=").concat(J==null?void 0:J.id,"&score=").concat(J==null?void 0:J.score,"&callback_url=").concat(location.pathname,"&select=").concat(Tt,"&exercise=true"))}},G=function(){var se=Object(W.a)(fe.a.mark(function J(Me,rt){var ct,at,Ot,en,mn,ln,tn,wn,Sn,Pn;return fe.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,(ct=Pt.current)===null||ct===void 0?void 0:ct.onSave();case 2:if(at=vn.sent,at){vn.next=5;break}return vn.abrupt("return");case 5:return Ot={question_score:rt.score,analysis:at.analysis},console.log(at,"editorData"),(Me==="SINGLE"||Me==="MULTIPLE"||Me==="JUDGMENT")&&(mn=[],ln=[],Ot.question_type=Me==="JUDGMENT"?2:1,Ot.question_title=at==null?void 0:at.name,at==null||((en=at.choices)===null||en===void 0)||en.forEach(function(Dn,pi){mn.push(Dn.choice_text),Dn!=null&&Dn.is_answer&&ln.push(pi+1)}),Ot.question_choices=mn,Ot.standard_answers=ln),Me==="COMPLETION"&&(Ot.is_ordered=at.is_ordered,Ot.question_title=at==null?void 0:at.name,Ot.question_type=3,wn=[],at==null||((tn=at.standard_answers)===null||tn===void 0)||tn.forEach(function(Dn,pi){wn.push({choice_id:Dn.position,answer_text:Dn.answer_text})}),Ot.standard_answers=wn),Me==="SUBJECTIVE"&&(Ot.question_title=at==null?void 0:at.name,Ot.question_type=3,Ot.standard_answers=at==null?void 0:at.answer_texts),Me==="COMBINATION"&&(Ot.question_title=at==null?void 0:at.name,Ot.question_type=7,Ot.sub_questions=at==null||((Sn=at.sub_item_banks)===null||Sn===void 0)?void 0:Sn.map(function(Dn,pi){return{id:Dn.id,question_title:Dn.name,question_type:1,question_choices:Dn.choices.map(function(Fn){return Fn.choice_text}),standard_answers:[Dn.choices.findIndex(function(Fn){return Fn.is_answer})+1],analysis:Dn.analysis}}),delete Ot.analysis),vn.next=13,Object(C.a)("/api/exercise_questions/".concat(rt.id,".json"),{method:"put",body:Ot});case 13:Pn=vn.sent,(Pn==null?void 0:Pn.status)===0&&(U.b.success("\u7F16\u8F91\u6210\u529F"),a(Tt+1)),gt(null);case 16:case"end":return vn.stop()}},J)}));return function(Me,rt){return se.apply(this,arguments)}}(),Ne=function(){for(var J=[],Me=0;Me<(xe==null||((rt=xe.exam)===null||rt===void 0)?void 0:rt.total_num);Me++){var rt;J.push({})}return J};console.log(Ne(),"data");var he=xe==null||((B=xe.questionList)===null||B===void 0)?void 0:B.reduce(function(se,J){return se+J.questions_score},0),wt=Ge&&(xe==null||((I=xe.exam)===null||I===void 0)?void 0:I.exercise_status)!==1;return v.a.createElement("section",{className:ne.a.wrap},v.a.createElement("div",{id:"id_left_preview",className:ne.a.left,onMouseEnter:function(J){var Me=document.getElementById("id_left_preview");Me.style.overflowY="auto"},onMouseLeave:function(J){var Me=document.getElementById("id_left_preview");Me.style.overflowY="hidden"}},v.a.createElement("div",{className:ne.a.title},v.a.createElement("div",null,v.a.createElement("b",null),v.a.createElement("span",null,"\u7B54\u9898\u5361"))),v.a.createElement("div",{className:ne.a.total},v.a.createElement("div",null,v.a.createElement("img",{src:Y.a}),v.a.createElement("span",null,"\u9898\u6570(\u9053)"),v.a.createElement("aside",null,xe==null?void 0:xe.all_questions_count)),v.a.createElement("div",{className:"mr30 ml30"},v.a.createElement("img",{src:de.a}),v.a.createElement("span",null,"\u603B\u5206(\u5206)"),v.a.createElement("aside",null,he)),v.a.createElement("div",null,v.a.createElement("img",{src:j.a}),v.a.createElement("span",null,"\u65F6\u957F(\u5206)"),v.a.createElement("aside",null,xe==null||((b=xe.exam)===null||b===void 0)?void 0:b.time))),xe==null||((x=xe.questionList)===null||x===void 0)?void 0:x.map(function(se,J){var Me;return v.a.createElement("div",{className:ne.a.list,key:J},v.a.createElement("div",{className:ne.a.name},v.a.createElement("b",null),v.a.createElement("span",null,se.name)),v.a.createElement("aside",null,v.a.createElement("div",null,"\u5171",v.a.createElement("span",{className:ne.a.b},se.questions_count),"\u9898 ",v.a.createElement("span",{className:ne.a.l},"|"),"\u5171",v.a.createElement("span",{className:ne.a.r},se.questions_score),"\u5206"),v.a.createElement("div",{className:ne.a.answerSheet},se==null||((Me=se.questions)===null||Me===void 0)?void 0:Me.map(function(rt,ct){return v.a.createElement("div",{onClick:function(){var Ot="Anchor_".concat(rt.id),en=document.getElementById(Ot);en&&setTimeout(function(){return en.scrollIntoView({block:"center",behavior:"smooth"})})},key:rt.id,className:ne.a.tag},ct+1)}))))})),v.a.createElement("div",{className:ne.a.right},v.a.createElement("div",{className:ne.a.examName,id:"examName"},v.a.createElement("div",{className:ne.a.name},v.a.createElement(me.a,{title:xe==null||((S=xe.exam)===null||S===void 0)?void 0:S.name,getPopupContainer:function(J){return J.parentNode}},v.a.createElement("span",{className:ne.a.t},xe==null||((A=xe.exam)===null||A===void 0)?void 0:A.name))),Ge?v.a.createElement(ve.a,{showTotal:function(J){return v.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"\u5171\u8BA1",v.a.createElement("span",{className:"c-light-primary"},J),"\u4EFD\u8BD5\u5377")},total:xe==null||((ae=xe.exam)===null||ae===void 0)?void 0:ae.total_num,pageSize:1,current:Tt+1,showSizeChanger:!1,onChange:a,showQuickJumper:!0,hideOnSinglePage:!1}):v.a.createElement(F.a,{onClick:o,type:"primary"},"\u968F\u673A\u66F4\u6362")),v.a.createElement("div",{className:ne.a.topWarp},xe==null||((ge=xe.questionList)===null||ge===void 0)?void 0:ge.map(function(se,J){var Me,rt;return v.a.createElement(v.a.Fragment,{key:J},v.a.createElement("div",{className:ne.a.head,style:J===0?{border:0,marginTop:-16}:{}},v.a.createElement("div",{className:ne.a.name},v.a.createElement("b",null),v.a.createElement("span",null,se.name)),v.a.createElement("div",{className:ne.a.so},"\u5171",v.a.createElement("span",{className:ne.a.b},se.questions_count," "),"\u9898 ",se.type==="COMBINATION"&&"\uFF08\u5305\u542B".concat(se==null||((Me=se.questions)===null||Me===void 0)?void 0:Me.map(function(ct){var at;return ct==null||((at=ct.sub_item_banks)===null||at===void 0)?void 0:at.length}).reduce(function(ct,at){return ct+at}),"\u5C0F\u9898\uFF09"),v.a.createElement("span",{className:ne.a.l},"|"),"\u5171",v.a.createElement("span",{className:ne.a.r},se.questions_score),"\u5206"),!Ge&&v.a.createElement("div",{className:ne.a.btn},v.a.createElement(F.a,{onClick:function(){hn(se)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),v.a.createElement(F.a,{onClick:function(){return h(se)},type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),se==null||((rt=se.questions)===null||rt===void 0)?void 0:rt.map(function(ct,at){return We===ct.id?v.a.createElement("div",{id:"Anchor_".concat(ct.id),className:ne.a.content,style:{padding:0,marginTop:10},key:ct.id},v.a.createElement("div",{style:{float:"right",marginTop:-6}},v.a.createElement(F.a,{onClick:function(){return gt(null)},className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),v.a.createElement(F.a,{onClick:function(){return G(se==null?void 0:se.type,ct)},type:"primary"},"\u4FDD\u5B58")),c(ct,se.type)):v.a.createElement("div",{id:"Anchor_".concat(ct.id),className:ne.a.content,key:ct.id},v.a.createElement("div",{className:ne.a.titleWrap},v.a.createElement(E.a,{style:{paddingRight:10},className:ne.a.titleHtml,value:at+1+"\u3001"+"".concat((ct==null?void 0:ct.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":"")+ct.name}),Ge&&v.a.createElement(F.a,{disabled:wt,onClick:function(){if(We){U.b.warn("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}gt(ct.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),v.a.createElement(F.a,{disabled:wt,onClick:function(){return En(ct.id,se.type,at,se)},type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(se.type==="SINGLE"||se.type==="JUDGMENT"||se.type==="MULTIPLE")&&bn(ct),se.type==="COMPLETION"&&oi(ct),se.type==="SUBJECTIVE"&&li(ct),se.type==="PROGRAM"&&De(ct),se.type==="COMBINATION"&&Ze(ct,at),v.a.createElement("div",null))}))})),v.a.createElement("div",{className:ne.a.btnsElse,id:"preview_btns_else"},Ge?p():u()),v.a.createElement("div",{className:ne.a.btnsWrap,id:"preview_btns"},v.a.createElement("div",{className:ne.a.btns},Ge?p():u()))))},ke=Ye.a=lt},vHTk:function(nt,Ye,y){nt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J:function(nt,Ye){function y(){this.buffer=new Array,this.length=0}y.prototype={get:function(z){var ve=Math.floor(z/8);return(this.buffer[ve]>>>7-z%8&1)==1},put:function(z,ve){for(var Z=0;Z<ve;Z++)this.putBit((z>>>ve-Z-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(z){var ve=Math.floor(this.length/8);this.buffer.length<=ve&&this.buffer.push(0),z&&(this.buffer[ve]|=128>>>this.length%8),this.length++}},nt.exports=y}}]);