(window.webpackJsonp=window.webpackJsonp||[]).push([[195,7,8],{"+NIl":function(at,Xe,V){(function(oe){oe(V("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function(Y,P){"use strict";function $(w,S){w.cmdState.push(S)}function U(w){return w.cmdState.length>0?w.cmdState[w.cmdState.length-1]:null}function I(w){var S=w.cmdState.pop();S&&S.closeBracket()}function K(w){for(var S=w.cmdState,T=S.length-1;T>=0;T--){var h=S[T];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function N(w,S,T){return function(){this.name=w,this.bracketNo=0,this.style=S,this.styles=T,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var O={};O.importmodule=N("importmodule","tag",["string","builtin"]),O.documentclass=N("documentclass","tag",["","atom"]),O.usepackage=N("usepackage","tag",["atom"]),O.begin=N("begin","tag",["atom"]),O.end=N("end","tag",["atom"]),O.label=N("label","tag",["atom"]),O.ref=N("ref","tag",["atom"]),O.eqref=N("eqref","tag",["atom"]),O.cite=N("cite","tag",["atom"]),O.bibitem=N("bibitem","tag",["atom"]),O.Bibitem=N("Bibitem","tag",["atom"]),O.RBibitem=N("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function L(w,S){w.f=S}function x(w,S){var T;if(w.match(/^\\[a-zA-Z@]+/)){var h=w.current().slice(1);return T=O.hasOwnProperty(h)?O[h]:O.DEFAULT,T=new T,$(S,T),L(S,D),T.style}if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/\\]/))return"tag";if(w.match("\\["))return L(S,function(i,c){return A(i,c,"\\]")}),"keyword";if(w.match("\\("))return L(S,function(i,c){return A(i,c,"\\)")}),"keyword";if(w.match("$$"))return L(S,function(i,c){return A(i,c,"$$")}),"keyword";if(w.match("$"))return L(S,function(i,c){return A(i,c,"$")}),"keyword";var l=w.next();if(l=="%")return w.skipToEnd(),"comment";if(l=="}"||l=="]"){if(T=U(S),T)T.closeBracket(l),L(S,D);else return"error";return"bracket"}else return l=="{"||l=="["?(T=O.DEFAULT,T=new T,$(S,T),"bracket"):/\d/.test(l)?(w.eatWhile(/[\w.%]/),"atom"):(w.eatWhile(/[\w\-_]/),T=K(S),T.name=="begin"&&(T.argument=w.current()),T.styleIdentifier())}function A(w,S,T){if(w.eatSpace())return null;if(T&&w.match(T))return L(S,x),"keyword";if(w.match(/^\\[a-zA-Z@]+/))return"tag";if(w.match(/^[a-zA-Z]+/))return"variable-2";if(w.match(/^\\[$&%#{}_]/))return"tag";if(w.match(/^\\[,;!\/]/))return"tag";if(w.match(/^[\^_&]/))return"tag";if(w.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(w.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=w.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(w.skipToEnd(),"comment"):"error"}function D(w,S){var T=w.peek(),h;return T=="{"||T=="["?(h=U(S),h.openBracket(T),w.eat(T),L(S,x),"bracket"):/[ \t\r]/.test(T)?(w.eat(T),null):(L(S,x),I(S),x(w,S))}return{startState:function(){var w=P.inMathMode?function(S,T){return A(S,T)}:x;return{cmdState:[],f:w}},copyState:function(w){return{cmdState:w.cmdState.slice(),f:w.f}},token:function(w,S){return S.f(w,S)},blankLine:function(w){w.f=x,w.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"+RXH":function(at,Xe,V){at.exports=V.p+"static/shu.46896d7d.svg"},"+yhJ":function(at,Xe,V){at.exports=V.p+"static/xixi.e1179cb8.svg"},"0eGx":function(at,Xe,V){at.exports=V.p+"static/zhong.e01397e1.svg"},"19Vz":function(at,Xe,V){(function(oe){oe(V("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(N,O,L){var x=L&&L!=oe.Init;if(O&&!x)N.on("blur",U),N.on("change",I),N.on("swapDoc",I),oe.on(N.getInputField(),"compositionupdate",N.state.placeholderCompose=function(){$(N)}),I(N);else if(!O&&x){N.off("blur",U),N.off("change",I),N.off("swapDoc",I),oe.off(N.getInputField(),"compositionupdate",N.state.placeholderCompose),Y(N);var A=N.getWrapperElement();A.className=A.className.replace(" CodeMirror-empty","")}O&&!N.hasFocus()&&U(N)});function Y(N){N.state.placeholder&&(N.state.placeholder.parentNode.removeChild(N.state.placeholder),N.state.placeholder=null)}function P(N){Y(N);var O=N.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=N.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var L=N.getOption("placeholder");typeof L=="string"&&(L=document.createTextNode(L)),O.appendChild(L),N.display.lineSpace.insertBefore(O,N.display.lineSpace.firstChild)}function $(N){setTimeout(function(){var O=!1,L=N.getInputField();L.nodeName=="TEXTAREA"?O=!L.value:N.lineCount()==1&&(O=!/[^\u200b]/.test(L.querySelector(".CodeMirror-line").textContent)),O?P(N):Y(N)},20)}function U(N){K(N)&&P(N)}function I(N){var O=N.getWrapperElement(),L=K(N);O.className=O.className.replace(" CodeMirror-empty","")+(L?" CodeMirror-empty":""),L?P(N):Y(N)}function K(N){return N.lineCount()===1&&N.getLine(0)===""}})},"1eCo":function(at,Xe,V){(function(oe){oe(V("VrN/"))})(function(oe){"use strict";var Y={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},P={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function($,U){var I=$.indentUnit,K={},N=U.htmlMode?Y:P;for(var O in N)K[O]=N[O];for(var O in U)K[O]=U[O];var L,x;function A(a,b){function g(H){return b.tokenize=H,H(a,b)}var _=a.next();if(_=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?g(S("atom","]]>")):null:a.match("--")?g(S("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),g(T(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=S("meta","?>"),"meta"):(L=a.eat("/")?"closeTag":"openTag",b.tokenize=D,"tag bracket");if(_=="&"){var k;return a.eat("#")?a.eat("x")?k=a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):k=a.eatWhile(/[\d]/)&&a.eat(";"):k=a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),k?"atom":"error"}else return a.eatWhile(/[^&<]/),null}A.isInText=!0;function D(a,b){var g=a.next();if(g==">"||g=="/"&&a.eat(">"))return b.tokenize=A,L=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return L="equals",null;if(g=="<"){b.tokenize=A,b.state=c,b.tagName=b.tagStart=null;var _=b.tokenize(a,b);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(g)?(b.tokenize=w(g),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function w(a){var b=function(g,_){for(;!g.eol();)if(g.next()==a){_.tokenize=D;break}return"string"};return b.isInAttribute=!0,b}function S(a,b){return function(g,_){for(;!g.eol();){if(g.match(b)){_.tokenize=A;break}g.next()}return a}}function T(a){return function(b,g){for(var _;(_=b.next())!=null;){if(_=="<")return g.tokenize=T(a+1),g.tokenize(b,g);if(_==">")if(a==1){g.tokenize=A;break}else return g.tokenize=T(a-1),g.tokenize(b,g)}return"meta"}}function h(a,b,g){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=g,(K.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function l(a){a.context&&(a.context=a.context.prev)}function i(a,b){for(var g;;){if(!a.context)return;if(g=a.context.tagName,!K.contextGrabbers.hasOwnProperty(g)||!K.contextGrabbers[g].hasOwnProperty(b))return;l(a)}}function c(a,b,g){return a=="openTag"?(g.tagStart=b.column(),C):a=="closeTag"?v:c}function C(a,b,g){return a=="word"?(g.tagName=b.current(),x="tag",E):K.allowMissingTagName&&a=="endTag"?(x="tag bracket",E(a,b,g)):(x="error",C)}function v(a,b,g){if(a=="word"){var _=b.current();return g.context&&g.context.tagName!=_&&K.implicitlyClosed.hasOwnProperty(g.context.tagName)&&l(g),g.context&&g.context.tagName==_||K.matchClosing===!1?(x="tag",m):(x="tag error",u)}else return K.allowMissingTagName&&a=="endTag"?(x="tag bracket",m(a,b,g)):(x="error",u)}function m(a,b,g){return a!="endTag"?(x="error",m):(l(g),c)}function u(a,b,g){return x="error",m(a,b,g)}function E(a,b,g){if(a=="word")return x="attribute",d;if(a=="endTag"||a=="selfcloseTag"){var _=g.tagName,k=g.tagStart;return g.tagName=g.tagStart=null,a=="selfcloseTag"||K.autoSelfClosers.hasOwnProperty(_)?i(g,_):(i(g,_),g.context=new h(g,_,k==g.indented)),c}return x="error",E}function d(a,b,g){return a=="equals"?f:(K.allowMissing||(x="error"),E(a,b,g))}function f(a,b,g){return a=="string"?s:a=="word"&&K.allowUnquoted?(x="string",E):(x="error",E(a,b,g))}function s(a,b,g){return a=="string"?s:E(a,b,g)}return{startState:function(a){var b={tokenize:A,state:c,indented:a||0,tagName:null,tagStart:null,context:null};return a!=null&&(b.baseIndent=a),b},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;L=null;var g=b.tokenize(a,b);return(g||L)&&g!="comment"&&(x=null,b.state=b.state(L||g,a,b),x&&(g=x=="error"?g+" error":x)),g},indent:function(a,b,g){var _=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+I;if(_&&_.noIndent)return oe.Pass;if(a.tokenize!=D&&a.tokenize!=A)return g?g.match(/^(\s*)/)[0].length:0;if(a.tagName)return K.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+I*(K.multilineTagIndentFactor||1);if(K.alignCDATA&&/$/,blockCommentStart:"",configuration:K.htmlMode?"html":"xml",helperType:K.htmlMode?"html":"xml",skipAttribute:function(a){a.state==f&&(a.state=E)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var b=[],g=a.context;g;g=g.prev)g.tagName&&b.push(g.tagName);return b.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2sxD":function(at,Xe,V){at.exports={list:"list___3_VOx",head:"head___37dUf",name:"name___1VbnU",right:"right___gDdSx",body:"body___1wO_8",top:"top___cjRoo",bottom:"bottom___O44ku",l:"l___3de2t",ListGroup:"ListGroup___22jzr",a:"a___3Rx6Z",b:"b___S9Ybp",c:"c___3CVXw",c1:"c1___3b8Zq",radio:"radio___LnwQZ",d:"d___2-cs-"}},"51dB":function(at,Xe,V){at.exports=V.p+"static/sc.e4548a72.svg"},"5MlY":function(at,Xe,V){at.exports=V.p+"static/sm.8d9933e4.svg"},"6+eU":function(at,Xe,V){"use strict";V.d(Xe,"a",function(){return m});var oe=V("wx14"),Y=V("rePB"),P=V("VTBJ"),$=V("1OyB"),U=V("vuIU"),I=V("Ji7U"),K=V("LK+K"),N=V("q1tI"),O=V.n(N),L=V("TSYQ"),x=V.n(L),A=function(E){var d,f="".concat(E.rootPrefixCls,"-item"),s=x()(f,"".concat(f,"-").concat(E.page),(d={},Object(Y.a)(d,"".concat(f,"-active"),E.active),Object(Y.a)(d,E.className,!!E.className),Object(Y.a)(d,"".concat(f,"-disabled"),!E.page),d)),a=function(){E.onClick(E.page)},b=function(_){E.onKeyPress(_,E.onClick,E.page)};return O.a.createElement("li",{title:E.showTitle?E.page:null,className:s,onClick:a,onKeyPress:b,tabIndex:"0"},E.itemRender(E.page,"page",O.a.createElement("a",{rel:"nofollow"},E.page)))},D=A,w={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},S=function(u){Object(I.a)(d,u);var E=Object(K.a)(d);function d(){var f;Object($.a)(this,d);for(var s=arguments.length,a=new Array(s),b=0;b=0||g.relatedTarget.className.indexOf("".concat(z,"-next"))>=0))return;f.setState({goInputText:""}),H(f.getValidValue())},f.go=function(g){var _=f.state.goInputText;if(_==="")return;(g.keyCode===w.ENTER||g.type==="click")&&(f.setState({goInputText:""}),f.props.quickGo(f.getValidValue()))},f}return Object(U.a)(d,[{key:"getValidValue",value:function(){var s=this.state,a=s.goInputText,b=s.current;return!a||isNaN(a)?b:Number(a)}},{key:"getPageSizeOptions",value:function(){var s=this.props,a=s.pageSize,b=s.pageSizeOptions;return b.some(function(g){return g.toString()===a.toString()})?b:b.concat([a.toString()]).sort(function(g,_){var k=isNaN(Number(g))?0:Number(g),H=isNaN(Number(_))?0:Number(_);return k-H})}},{key:"render",value:function(){var s=this,a=this.props,b=a.pageSize,g=a.locale,_=a.rootPrefixCls,k=a.changeSize,H=a.quickGo,z=a.goButton,Z=a.selectComponentClass,G=a.buildOptionText,B=a.selectPrefixCls,te=a.disabled,ce=this.state.goInputText,pe="".concat(_,"-options"),ye=Z,Ce=null,_e=null,le=null;if(!k&&!H)return null;var se=this.getPageSizeOptions();if(k&&ye){var ge=se.map(function(ie,q){return O.a.createElement(ye.Option,{key:q,value:ie.toString()},(G||s.buildOptionText)(ie))});Ce=O.a.createElement(ye,{disabled:te,prefixCls:B,showSearch:!1,className:"".concat(pe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(b||se[0]).toString(),onChange:this.changeSize,getPopupContainer:function(q){return q.parentNode}},ge)}return H&&(z&&(le=typeof z=="boolean"?O.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:te,className:"".concat(pe,"-quick-jumper-button")},g.jump_to_confirm):O.a.createElement("span",{onClick:this.go,onKeyUp:this.go},z)),_e=O.a.createElement("div",{className:"".concat(pe,"-quick-jumper")},g.jump_to,O.a.createElement("input",{disabled:te,type:"text",value:ce,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,le)),O.a.createElement("li",{className:"".concat(pe)},Ce,_e)}}]),d}(O.a.Component);S.defaultProps={pageSizeOptions:["10","20","50","100"]};var T=S,h=V("N2Kk");function l(){}function i(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}function c(u,E,d){return d}function C(u,E,d){var f=typeof u=="undefined"?E.pageSize:u;return Math.floor((d.total-1)/f)+1}var v=function(u){Object(I.a)(d,u);var E=Object(K.a)(d);function d(f){var s;Object($.a)(this,d),s=E.call(this,f),s.getJumpPrevPage=function(){return Math.max(1,s.state.current-(s.props.showLessItems?3:5))},s.getJumpNextPage=function(){return Math.min(C(void 0,s.state,s.props),s.state.current+(s.props.showLessItems?3:5))},s.getItemIcon=function(k,H){var z=s.props.prefixCls,Z=k||O.a.createElement("button",{type:"button","aria-label":H,className:"".concat(z,"-item-link")});return typeof k=="function"&&(Z=O.a.createElement(k,Object(P.a)({},s.props))),Z},s.savePaginationNode=function(k){s.paginationNode=k},s.isValid=function(k){return i(k)&&k!==s.state.current},s.shouldDisplayQuickJumper=function(){var k=s.props,H=k.showQuickJumper,z=k.pageSize,Z=k.total;return Z<=z?!1:H},s.handleKeyDown=function(k){(k.keyCode===w.ARROW_UP||k.keyCode===w.ARROW_DOWN)&&k.preventDefault()},s.handleKeyUp=function(k){var H=s.getValidValue(k),z=s.state.currentInputValue;H!==z&&s.setState({currentInputValue:H}),k.keyCode===w.ENTER?s.handleChange(H):k.keyCode===w.ARROW_UP?s.handleChange(H-1):k.keyCode===w.ARROW_DOWN&&s.handleChange(H+1)},s.changePageSize=function(k){var H=s.state.current,z=C(k,s.state,s.props);H=H>z?z:H,z===0&&(H=s.state.current),typeof k=="number"&&("pageSize"in s.props||s.setState({pageSize:k}),"current"in s.props||s.setState({current:H,currentInputValue:H})),s.props.onShowSizeChange(H,k),"onChange"in s.props&&s.props.onChange&&s.props.onChange(H,k)},s.handleChange=function(k){var H=s.props.disabled,z=k;if(s.isValid(z)&&!H){var Z=C(void 0,s.state,s.props);z>Z?z=Z:z<1&&(z=1),"current"in s.props||s.setState({current:z,currentInputValue:z});var G=s.state.pageSize;return s.props.onChange(z,G),z}return s.state.current},s.prev=function(){s.hasPrev()&&s.handleChange(s.state.current-1)},s.next=function(){s.hasNext()&&s.handleChange(s.state.current+1)},s.jumpPrev=function(){s.handleChange(s.getJumpPrevPage())},s.jumpNext=function(){s.handleChange(s.getJumpNextPage())},s.hasPrev=function(){return s.state.current>1},s.hasNext=function(){return s.state.current2?z-2:0),G=2;G=b?_=b:_=Number(a),_}},{key:"getShowSizeChanger",value:function(){var s=this.props,a=s.showSizeChanger,b=s.total,g=s.totalBoundaryShowSizeChanger;return typeof a!="undefined"?a:b>g}},{key:"renderPrev",value:function(s){var a=this.props,b=a.prevIcon,g=a.itemRender,_=g(s,"prev",this.getItemIcon(b,"prev page")),k=!this.hasPrev();return Object(N.isValidElement)(_)?Object(N.cloneElement)(_,{disabled:k}):_}},{key:"renderNext",value:function(s){var a=this.props,b=a.nextIcon,g=a.itemRender,_=g(s,"next",this.getItemIcon(b,"next page")),k=!this.hasNext();return Object(N.isValidElement)(_)?Object(N.cloneElement)(_,{disabled:k}):_}},{key:"render",value:function(){var s=this,a=this.props,b=a.prefixCls,g=a.className,_=a.style,k=a.disabled,H=a.hideOnSinglePage,z=a.total,Z=a.locale,G=a.showQuickJumper,B=a.showLessItems,te=a.showTitle,ce=a.showTotal,pe=a.simple,ye=a.itemRender,Ce=a.showPrevNextJumpers,_e=a.jumpPrevIcon,le=a.jumpNextIcon,se=a.selectComponentClass,ge=a.selectPrefixCls,ie=a.pageSizeOptions,q=this.state,Ee=q.current,Me=q.pageSize,Ne=q.currentInputValue;if(H===!0&&z<=Me)return null;var Pe=C(void 0,this.state,this.props),Be=[],Ae=null,De=null,Fe=null,ze=null,qe=null,He=G&&G.goButton,Oe=B?1:2,lt=Ee-1>0?Ee-1:0,tt=Ee+1=Oe*2&&Ee!==1+2&&(Be[0]=Object(N.cloneElement)(Be[0],{className:"".concat(b,"-item-after-jump-prev")}),Be.unshift(Ae)),Pe-Ee>=Oe*2&&Ee!==Pe-2&&(Be[Be.length-1]=Object(N.cloneElement)(Be[Be.length-1],{className:"".concat(b,"-item-before-jump-next")}),Be.push(De)),Dt!==1&&Be.unshift(Fe),Tt!==Pe&&Be.push(ze)}var xe=null;ce&&(xe=O.a.createElement("li",{className:"".concat(b,"-total-text")},ce(z,[z===0?0:(Ee-1)*Me+1,Ee*Me>z?z:Ee*Me])));var fe=!this.hasPrev()||!Pe,be=!this.hasNext()||!Pe;return O.a.createElement("ul",Object(oe.a)({className:x()(b,g,Object(Y.a)({},"".concat(b,"-disabled"),k)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},ft),xe,O.a.createElement("li",{title:te?Z.prev_page:null,onClick:this.prev,tabIndex:fe?null:0,onKeyPress:this.runIfEnterPrev,className:x()("".concat(b,"-prev"),Object(Y.a)({},"".concat(b,"-disabled"),fe)),"aria-disabled":fe},this.renderPrev(lt)),Be,O.a.createElement("li",{title:te?Z.next_page:null,onClick:this.next,tabIndex:be?null:0,onKeyPress:this.runIfEnterNext,className:x()("".concat(b,"-next"),Object(Y.a)({},"".concat(b,"-disabled"),be)),"aria-disabled":be},this.renderNext(tt)),O.a.createElement(T,{disabled:k,locale:Z,rootPrefixCls:b,selectComponentClass:se,selectPrefixCls:ge,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Ee,pageSize:Me,pageSizeOptions:ie,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:He}))}}],[{key:"getDerivedStateFromProps",value:function(s,a){var b={};if("current"in s&&(b.current=s.current,s.current!==a.current&&(b.currentInputValue=b.current)),"pageSize"in s&&s.pageSize!==a.pageSize){var g=a.current,_=C(s.pageSize,a,s);g=g>_?_:g,"current"in s||(b.current=g,b.currentInputValue=g),b.pageSize=s.pageSize}return b}}]),d}(O.a.Component);v.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:l,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:l,locale:h.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var m=v},"6K3P":function(at,Xe,V){at.exports=V.p+"static/jinshi.4887ef37.svg"},"7Cbv":function(at,Xe,V){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Y=new Uint8Array(16);function P(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe(Y)}var $=/^(?:[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 U(D){return typeof D=="string"&&$.test(D)}for(var I=U,K=[],N=0;N<256;++N)K.push((N+256).toString(16).substr(1));function O(D){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,S=(K[D[w+0]]+K[D[w+1]]+K[D[w+2]]+K[D[w+3]]+"-"+K[D[w+4]]+K[D[w+5]]+"-"+K[D[w+6]]+K[D[w+7]]+"-"+K[D[w+8]]+K[D[w+9]]+"-"+K[D[w+10]]+K[D[w+11]]+K[D[w+12]]+K[D[w+13]]+K[D[w+14]]+K[D[w+15]]).toLowerCase();if(!I(S))throw TypeError("Stringified UUID is invalid");return S}var L=O;function x(D,w,S){D=D||{};var T=D.random||(D.rng||P)();if(T[6]=T[6]&15|64,T[8]=T[8]&63|128,w){S=S||0;for(var h=0;h<16;++h)w[S+h]=T[h];return w}return L(T)}var A=Xe.a=x},"7ahc":function(at,Xe,V){"use strict";V.d(Xe,"a",function(){return C});var oe=V("k1fw"),Y=V("0Owb"),P=V("+L6B"),$=V("2/Rp"),U=V("y8nQ"),I=V("Vl3Y"),K=V("tJVT"),N=V("OaEy"),O=V("2fM7"),L=V("q1tI"),x=V.n(L),A=V("VrN/"),D=V.n(A),w=V("p77/"),S=V.n(w),T=V("c5Ni"),h=V.n(T),l=O.a.Option,i={labelCol:{span:4},wrapperCol:{span:20}},c={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Xe.b=function(v){var m=v.callback,u=v.onCancel,E=Object(L.useState)("python"),d=Object(K.a)(E,2),f=d[0],s=d[1];function a(g){s(c[g][1])}function b(g){m(g)}return x.a.createElement(I.a,Object(Y.a)({},i,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),x.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},x.a.createElement(O.a,{onChange:a},Object.keys(c).map(function(g){return x.a.createElement(l,{key:g,value:g},c[g][0])}))),x.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},x.a.createElement(C,{mode:f})),x.a.createElement("div",{className:"flex-container flex-end"},x.a.createElement($.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),x.a.createElement($.a,{type:"ghost",onClick:u},"\u53D6\u6D88")))};function C(v){var m=v.value,u=v.onChange,E=v.mode,d=v.options,f=d===void 0?{}:d,s=Object(L.useRef)(),a=Object(L.useState)(),b=Object(K.a)(a,2),g=b[0],_=b[1];return Object(L.useEffect)(function(){if(g){function k(H){var z=H.getValue();u&&u(z)}return g.on("change",k),function(){g.off("change",k)}}},[g,u]),Object(L.useEffect)(function(){g&&g.setOption("mode",E)},[g,E]),Object(L.useEffect)(function(){g&&((m!==g.getValue()||m==="")&&setTimeout(function(){g.setValue(m||" ")},300))},[g,m]),Object(L.useEffect)(function(){if(s.current&&!g){var k=D.a.fromTextArea(s.current,Object(oe.a)({mode:E,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},f));_(k)}},[s.current,g]),x.a.createElement("div",{className:"my-codemirror-container"},x.a.createElement("textarea",{ref:s}))}},"7ixt":function(at,Xe,V){"use strict";V.d(Xe,"a",function(){return P});var oe={adjustX:1,adjustY:1},Y=[0,0],P={left:{points:["cr","cl"],overflow:oe,offset:[-4,0],targetOffset:Y},right:{points:["cl","cr"],overflow:oe,offset:[4,0],targetOffset:Y},top:{points:["bc","tc"],overflow:oe,offset:[0,-4],targetOffset:Y},bottom:{points:["tc","bc"],overflow:oe,offset:[0,4],targetOffset:Y},topLeft:{points:["bl","tl"],overflow:oe,offset:[0,-4],targetOffset:Y},leftTop:{points:["tr","tl"],overflow:oe,offset:[-4,0],targetOffset:Y},topRight:{points:["br","tr"],overflow:oe,offset:[0,-4],targetOffset:Y},rightTop:{points:["tl","tr"],overflow:oe,offset:[4,0],targetOffset:Y},bottomRight:{points:["tr","br"],overflow:oe,offset:[0,4],targetOffset:Y},rightBottom:{points:["bl","br"],overflow:oe,offset:[4,0],targetOffset:Y},bottomLeft:{points:["tl","bl"],overflow:oe,offset:[0,4],targetOffset:Y},leftBottom:{points:["br","bl"],overflow:oe,offset:[-4,0],targetOffset:Y}},$=P},"7qnI":function(at,Xe,V){"use strict";var oe=V("5Dmo"),Y=V("3S7+"),P=V("fWQN"),$=V("mtLc"),U=V("yKVA"),I=V("879j"),K=V("5NDa"),N=V("5rEg"),O=V("q1tI"),L=V.n(O),x=V("O2Wb"),A=V.n(x),D=N.a.TextArea,w=function(S){Object(U.a)(h,S);var T=Object(I.a)(h);function h(){return Object(P.a)(this,h),T.apply(this,arguments)}return Object($.a)(h,[{key:"render",value:function(){var i=this,c=this.props,C=c.index,v=c.onAnswerChange,m=c.addChildAnswer,u=c.exerciseIsPublish,E=c.answers,d=c.activeOptionErrorIndex,f=c.flex,s=f===void 0?"0 0 1000px":f;return L.a.createElement("div",{className:A.a.flex},L.a.createElement("div",{className:"".concat(A.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",C+1,"):"),L.a.createElement("div",{className:"".concat(A.a.flex," ").concat(A.a.flex1),style:{flexDirection:"column"}},E.map(function(a,b){var g="".concat(C,"-").concat(b);return L.a.createElement("div",{className:"".concat(A.a.flex," ").concat(A.a.flex1),key:b},L.a.createElement("div",{className:A.a.flex1,style:{flex:s}},L.a.createElement("div",null,L.a.createElement(D,{className:g===d?A.a.error:"",spellCheck:!1,rows:4,value:a||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(b==0?"":"(\u53EF\u9009)"),onChange:function(k){return v(C,b,k.target.value)},style:{minHeight:95}}))),!u&&L.a.createElement(L.a.Fragment,null,b!=0&&L.a.createElement(Y.a,{title:"\u5220\u9664"},L.a.createElement("i",{className:"".concat(A.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return i.props.deleteChildAnswer(C,b)},style:{float:"right"}})),b===0&&L.a.createElement(Y.a,{title:"\u5220\u9664"},L.a.createElement("i",{className:"".concat(A.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return i.props.deleteChildAnswermain(C,b)},style:{float:"right"}})),L.a.createElement(Y.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},L.a.createElement("i",{className:"".concat(A.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return m(C)},style:{float:"right",visibility:b==E.length-1?"":"hidden"}}))))})))}}]),h}(O.Component);Xe.a=w},"815F":function(at,Xe,V){"use strict";V.d(Xe,"e",function(){return K}),V.d(Xe,"c",function(){return O}),V.d(Xe,"d",function(){return L}),V.d(Xe,"a",function(){return A}),V.d(Xe,"f",function(){return D}),V.d(Xe,"b",function(){return w});var oe=V("KQm4"),Y=V("VTBJ"),P=V("Ff2n"),$=V("Zm9Q"),U=V("Kwbf"),I=V("OZM5");function K(S,T){return S!=null?S:T}function N(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],T=new Map;function h(l){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(l||[]).forEach(function(c){var C=c.key,v=c.children;Object(U.a)(C!=null,"Tree node must have a certain key: [".concat(i).concat(C,"]"));var m=String(C);Object(U.a)(!T.has(m)||C===null||C===void 0,"Same 'key' exist in the Tree: ".concat(m)),T.set(m,!0),h(v,"".concat(i).concat(m," > "))})}h(S)}function O(S){function T(h){var l=Object($.a)(h);return l.map(function(i){if(!Object(I.i)(i))return Object(U.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var c=i.key,C=i.props,v=C.children,m=Object(P.a)(C,["children"]),u=Object(Y.a)({key:c},m),E=T(v);return E.length&&(u.children=E),u}).filter(function(i){return i})}return T(S)}function L(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],h=new Set(T===!0?[]:T),l=[];function i(c){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return c.map(function(v,m){var u=Object(I.h)(C?C.pos:"0",m),E=K(v.key,u),d=Object(Y.a)(Object(Y.a)({},v),{},{parent:C,pos:u,children:null,data:v,isStart:[].concat(Object(oe.a)(C?C.isStart:[]),[m===0]),isEnd:[].concat(Object(oe.a)(C?C.isEnd:[]),[m===c.length-1])});return l.push(d),T===!0||h.has(E)?d.children=i(v.children||[],d):d.children=[],d})}return i(S),l}function x(S,T,h){var l;h?typeof h=="string"?l=function(C){return C[h]}:typeof h=="function"&&(l=function(C){return h(C)}):l=function(C,v){return K(C.key,v)};function i(c,C,v){var m=c?c.children:S,u=c?Object(I.h)(v.pos,C):"0";if(c){var E=l(c,u),d={node:c,index:C,pos:u,key:E,parentPos:v.node?v.pos:null,level:v.level+1};T(d)}m&&m.forEach(function(f,s){i(f,s,{node:c,pos:u,level:v?v.level+1:-1})})}i(null)}function A(S){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=T.initWrapper,l=T.processEntity,i=T.onProcessFinished,c=arguments.length>2?arguments[2]:void 0,C={},v={},m={posEntities:C,keyEntities:v};return h&&(m=h(m)||m),x(S,function(u){var E=u.node,d=u.index,f=u.pos,s=u.key,a=u.parentPos,b=u.level,g={node:E,index:d,key:s,pos:f,level:b},_=K(s,f);C[f]=g,v[_]=g,g.parent=C[a],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),l&&l(g,m)},c),i&&i(m),m}function D(S,T){var h=T.expandedKeys,l=T.selectedKeys,i=T.loadedKeys,c=T.loadingKeys,C=T.checkedKeys,v=T.halfCheckedKeys,m=T.dragOverNodeKey,u=T.dropPosition,E=T.keyEntities,d=E[S],f={eventKey:S,expanded:h.indexOf(S)!==-1,selected:l.indexOf(S)!==-1,loaded:i.indexOf(S)!==-1,loading:c.indexOf(S)!==-1,checked:C.indexOf(S)!==-1,halfChecked:v.indexOf(S)!==-1,pos:String(d?d.pos:""),dragOver:m===S&&u===0,dragOverGapTop:m===S&&u===-1,dragOverGapBottom:m===S&&u===1};return f}function w(S){var T=S.data,h=S.expanded,l=S.selected,i=S.checked,c=S.loaded,C=S.loading,v=S.halfChecked,m=S.dragOver,u=S.dragOverGapTop,E=S.dragOverGapBottom,d=S.pos,f=S.active,s=Object(Y.a)(Object(Y.a)({},T),{},{expanded:h,selected:l,checked:i,loaded:c,loading:C,halfChecked:v,dragOver:m,dragOverGapTop:u,dragOverGapBottom:E,pos:d,active:f});return"props"in s||Object.defineProperty(s,"props",{get:function(){return Object(U.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),S}}),s}},"8EBN":function(at,Xe,V){(function(oe){oe(V("VrN/"))})(function(oe){"use strict";oe.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 Y=0;Y-1&&$.substring(K+1,$.length);if(N)return oe.findModeByExtension(N)},oe.findModeByName=function($){$=$.toLowerCase();for(var U=0;U=M.length?Q.slice(M.length):Q}).join(`
`)}var h=[],l=[""],i=new w.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){h.length=0,l=[""]}var v={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(F,p,y,M){if(p>=F.length||F[p].level<=y)return p;var Q=F[p];M.push("- "+Q.text+""),p++;var W=[];return p=m(F,p,Q.level,W),W.length>0&&(M.push("
"),W.forEach(function(me){M.push(me)}),M.push("
")),M.push(" "),p=m(F,p,y,M),p}function u(){return m(h,0,0,l),l.push("
"),l.join("")}var E={heading:function(p){var y=c.exec(p);if(y)return{type:"heading",raw:y[0],depth:y[1].length,text:y[2]}},fences:function(p){var y=this.rules.block.fences.exec(p);if(y){var M=y[0],Q=T(M,y[3]||""),W=y[2]?y[2].trim():y[2];if(["latex","katex","math"].indexOf(W)>=0){var me=s(),$e=Q;Q=me,a[me]={type:"block",expression:$e}}return{type:"code",raw:M,lang:W,text:Q}}}},d=/(?:\${2})([^\n`]+?)(?:\${2})/gi,f=0,s=function(){return"__special_katext_id_".concat(f++,"__")},a={};function b(){return a}function g(){f=0,a={}}function _(F){return F=F.replace(d,function(p,y){var M=s();return a[M]={type:"inline",expression:y},M}),F}var k=i.listitem;i.listitem=function(F){return k(_(F))};var H=i.paragraph;i.paragraph=function(F){return H(_(F))};var z=i.tablecell;i.tablecell=function(F,p){return z(_(F),p)},i.code=function(F,p,y){var M=(p||"").match(/\S*/)[0];return M?["latex","katex","math"].indexOf(M)>=0?"".concat(F,"
"):'
').concat(y?F:Object(S.escape)(F,!0),`
`):''+(y?F:Object(S.escape)(F,!0))+"
"},i.heading=function(F,p,y){var M=this.options.headerPrefix+y.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:M,level:p,text:F}),"'+F+""},w.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),w.a.use({tokenizer:E,renderer:i});var Z=w.a,G=V("SJMd"),B=V("ulZh"),te=V.n(B),ce=V("m3rI"),pe=V("Oy/b"),ye=V("p5ED"),Ce=V("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var _e=function(F,p){return(_e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,M){y.__proto__=M}||function(y,M){for(var Q in M)Object.prototype.hasOwnProperty.call(M,Q)&&(y[Q]=M[Q])})(F,p)};function le(F,p){function y(){this.constructor=F}_e(F,p),F.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}function se(F,p,y,M){return new(y||(y=Promise))(function(Q,W){function me(jt){try{ct(M.next(jt))}catch(Qe){W(Qe)}}function $e(jt){try{ct(M.throw(jt))}catch(Qe){W(Qe)}}function ct(jt){var Qe;jt.done?Q(jt.value):(Qe=jt.value,Qe instanceof y?Qe:new y(function(Vt){Vt(Qe)})).then(me,$e)}ct((M=M.apply(F,p||[])).next())})}function ge(F,p){var y,M,Q,W,me={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return W={next:$e(0),throw:$e(1),return:$e(2)},typeof Symbol=="function"&&(W[Symbol.iterator]=function(){return this}),W;function $e(ct){return function(jt){return function(Qe){if(y)throw new TypeError("Generator is already executing.");for(;me;)try{if(y=1,M&&(Q=2&Qe[0]?M.return:Qe[0]?M.throw||((Q=M.return)&&Q.call(M),0):M.next)&&!(Q=Q.call(M,Qe[1])).done)return Q;switch(M=0,Q&&(Qe=[2&Qe[0],Q.value]),Qe[0]){case 0:case 1:Q=Qe;break;case 4:return me.label++,{value:Qe[1],done:!1};case 5:me.label++,M=Qe[1],Qe=[0];continue;case 7:Qe=me.ops.pop(),me.trys.pop();continue;default:if(!(Q=me.trys,(Q=Q.length>0&&Q[Q.length-1])||Qe[0]!==6&&Qe[0]!==2)){me=0;continue}if(Qe[0]===3&&(!Q||Qe[1]>Q[0]&&Qe[1]',"select"),this.addActionButton(M,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(M,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(M,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(M,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(M,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(M,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(M,'',"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(W){var me=document.createElement("div");me.className=""+y.toolbarButtonStyleClass.name,me.setAttribute("data-type-name",W.typeName),me.innerHTML=W.icon,me.addEventListener("click",function(){y.markerToolbarButtonClicked(me,W)}),y.buttons.push(me),y.markerButtons.push(me)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Q=document.createElement("div");Q.className=this.toolbarBlockStyleClass.name,Q.style.whiteSpace="nowrap",Q.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Q),this.addActionButton(Q,'',"render"),this.addActionButton(Q,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},F.prototype.addButtonClickListener=function(p){this.buttonClickListeners.push(p)},F.prototype.removeButtonClickListener=function(p){this.buttonClickListeners.indexOf(p)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(p),1)},F.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},F.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var p=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var y=0;y0&&this.buttonClickListeners.forEach(function(M){return M("marker",y)}),this.markerButtonOverflowBlock.style.display="none"},F.prototype.actionToolbarButtonClicked=function(p,y){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("action",y)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},F.prototype.setActiveButton=function(p){this.resetButtonStyles(),p.className=p.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),p.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},F.prototype.setActiveMarkerButton=function(p){var y=this.markerButtons.find(function(M){return M.getAttribute("data-type-name")===p});y&&this.setActiveButton(y)},F.prototype.setCurrentMarker=function(p){var y=this;this.currentMarker=p,this.buttons.filter(function(M){return/delete|notes/.test(M.getAttribute("data-action"))}).forEach(function(M){y.currentMarker===void 0?(M.style.fillOpacity="0.4",M.style.pointerEvents="none"):(M.style.fillOpacity="1",M.style.pointerEvents="all")})},F}(),Fe=function(){function F(p,y,M,Q){this.panels=[],this.panelButtons=[],this.markerjsContainer=p,this.displayMode=y,this.uiStyleSettings=M,this.styles=Q,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return F.prototype.addStyles=function(){var p;this.toolboxStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var y=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ae("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ae("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ae("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 Ae("toolbox-panel-row_colors",`
background-color: `+((p=this.uiStyleSettings.toolboxBackgroundColor)!==null&&p!==void 0?p:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ae("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*y)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*y)+`px;
padding: `+y+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ae("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Be("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Be("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},F.prototype.show=function(p){var y;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=p,this.uiContainer.className=this.toolboxStyleClass.name+" "+((y=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&y!==void 0?y:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},F.prototype.setPanelButtons=function(p){var y,M,Q=this;this.panels=p,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((y=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&y!==void 0?y:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(W){var me;W.uiStyleSettings=Q.uiStyleSettings;var $e=document.createElement("div");$e.className=Q.toolboxButtonStyleClass.name+" "+((me=Q.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&me!==void 0?me:Q.toolboxButtonStyleColorsClass.name),$e.innerHTML=W.icon,$e.title=W.title,$e.addEventListener("click",function(){Q.panelButtonClick(W)}),Q.panelButtons.push($e),Q.buttonRow.appendChild($e)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},F.prototype.panelButtonClick=function(p){var y=this,M=-1;if(p!==this.activePanel){M=this.panels.indexOf(p),this.panelRow.innerHTML="";var Q=p.getUi();Q.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Q),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=p}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){y.displayMode==="inline"?y.panelRow.style.display="none":y.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(W,me){var $e,ct;W.className=y.toolboxButtonStyleClass.name+" "+(me===M?""+(($e=y.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&$e!==void 0?$e:y.toolboxActiveButtonStyleColorsClass.name):""+((ct=y.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ct!==void 0?ct:y.toolboxButtonStyleColorsClass.name))})},F}(),ze=function(F,p){this.title=F,this.icon=p},qe=function(F){function p(y,M,Q,W){var me=F.call(this,y,W||'')||this;return me.colors=[],me.addTransparent=!1,me.colorBoxes=[],me.colors=M,me.currentColor=Q,me.setCurrentColor=me.setCurrentColor.bind(me),me.getColorBox=me.getColorBox.bind(me),me}return le(p,F),p.prototype.getUi=function(){var y=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.whiteSpace="nowrap",this.colors.forEach(function(Q){var W=y.getColorBox(Q);M.appendChild(W),y.colorBoxes.push(W)}),M},p.prototype.getColorBox=function(y){var M=this,Q=this.uiStyleSettings.toolbarHeight/4,W=this.uiStyleSettings.toolbarHeight-Q,me=document.createElement("div");me.style.display="inline-block",me.style.boxSizing="content-box",me.style.width=W-2+"px",me.style.height=W-2+"px",me.style.padding="1px",me.style.marginRight="2px",me.style.marginBottom="2px",me.style.borderWidth="2px",me.style.borderStyle="solid",me.style.borderRadius=(W+2)/2+"px",me.style.borderColor=y===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",me.addEventListener("click",function(){M.setCurrentColor(y,me)});var $e=document.createElement("div");return $e.style.display="inline-block",$e.style.width=W-2+"px",$e.style.height=W-2+"px",$e.style.backgroundColor=y,$e.style.borderRadius=W/2+"px",y==="transparent"&&($e.style.fill=this.uiStyleSettings.toolboxAccentColor,$e.innerHTML=``),me.appendChild($e),me},p.prototype.setCurrentColor=function(y,M){var Q=this;this.currentColor=y,this.colorBoxes.forEach(function(W){W.style.borderColor=W===M?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(y)},p}(ze),He=function(){function F(p,y,M){this._state="new",this._isSelected=!1,this._container=p,this._overlayContainer=y,this.globalSettings=M,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(F.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),F.prototype.ownsTarget=function(p){return!1},Object.defineProperty(F.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),F.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},F.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},F.prototype.pointerDown=function(p,y){},F.prototype.dblClick=function(p,y){},F.prototype.manipulate=function(p){},F.prototype.pointerUp=function(p){this.stateChanged()},F.prototype.dispose=function(){},F.prototype.addMarkerVisualToContainer=function(p){this.container.childNodes.length>0?this.container.insertBefore(p,this.container.childNodes[0]):this.container.appendChild(p)},F.prototype.getState=function(){return{typeName:F.typeName,state:this.state,notes:this.notes}},F.prototype.restoreState=function(p){this._state=p.state,this.notes=p.notes},F.prototype.scale=function(p,y){},F.prototype.colorChanged=function(p){this.onColorChanged&&this.onColorChanged(p),this.stateChanged()},F.prototype.fillColorChanged=function(p){this.onFillColorChanged&&this.onFillColorChanged(p),this.stateChanged()},F.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var p=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),p.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(p)&&this.onStateChanged(this)}},F.typeName="MarkerBase",F}(),Oe=function(){function F(){this.findGripByVisual=this.findGripByVisual.bind(this)}return F.prototype.findGripByVisual=function(p){return this.topLeft.ownsTarget(p)?this.topLeft:this.topCenter.ownsTarget(p)?this.topCenter:this.topRight.ownsTarget(p)?this.topRight:this.centerLeft.ownsTarget(p)?this.centerLeft:this.centerRight.ownsTarget(p)?this.centerRight:this.bottomLeft.ownsTarget(p)?this.bottomLeft:this.bottomCenter.ownsTarget(p)?this.bottomCenter:this.bottomRight.ownsTarget(p)?this.bottomRight:void 0},F}(),lt=function(){function F(){this.GRIP_SIZE=10,this.visual=q.createGroup(),this.visual.appendChild(q.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(q.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(p){return p===this.visual||p===this.visual.childNodes[0]||p===this.visual.childNodes[1]},F}(),tt=function(){function F(){}return F.toITransformMatrix=function(p){return{a:p.a,b:p.b,c:p.c,d:p.d,e:p.e,f:p.f}},F.toSVGMatrix=function(p,y){return p.a=y.a,p.b=y.b,p.c=y.c,p.d=y.d,p.e=y.e,p.f=y.f,p},F}(),ft=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.left=0,W.top=0,W.width=0,W.height=0,W.defaultSize={x:50,y:20},W.offsetX=0,W.offsetY=0,W.rotationAngle=0,W.CB_DISTANCE=10,W._suppressMarkerCreateEvent=!1,W.container.transform.baseVal.appendItem(q.createTransform()),W.setupControlBox(),W}return le(p,F),Object.defineProperty(p.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"visual",{get:function(){return this._visual},set:function(y){this._visual=y;var M=q.createTransform();this._visual.transform.baseVal.appendItem(M)},enumerable:!1,configurable:!0}),p.prototype.ownsTarget=function(y){return!!F.prototype.ownsTarget.call(this,y)||!!(this.controlGrips.findGripByVisual(y)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(y))},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.state==="new"&&(this.left=y.x,this.top=y.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Q=this.unrotatePoint(y);if(this.manipulationStartX=Q.x,this.manipulationStartY=Q.y,this.offsetX=Q.x-this.left,this.offsetY=Q.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(M),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M)){this.activeGrip=this.rotatorGrip;var W=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=W.x-this.width/2,this.top=W.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var me=this.container.transform.baseVal.getItem(0);me.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(me,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},p.prototype.pointerUp=function(y){var M=this.state;F.prototype.pointerUp.call(this,y),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(y),this._state="select",M==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},p.prototype.moveVisual=function(y){this.visual.style.transform="translate("+y.x+"px, "+y.y+"px)"},p.prototype.manipulate=function(y){var M=this.unrotatePoint(y);this.state==="creating"?this.resize(y):this.state==="move"?(this.left=this.manipulationStartLeft+(M.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(M.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(M):this.state==="rotate"&&this.rotate(y)},p.prototype.resize=function(y){var M=this.manipulationStartLeft,Q=this.manipulationStartWidth,W=this.manipulationStartTop,me=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:M=this.manipulationStartLeft+y.x-this.manipulationStartX,Q=this.manipulationStartWidth+this.manipulationStartLeft-M;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Q=this.manipulationStartWidth+y.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:W=this.manipulationStartTop+y.y-this.manipulationStartY,me=this.manipulationStartHeight+this.manipulationStartTop-W;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:me=this.manipulationStartHeight+y.y-this.manipulationStartY}Q>=0?(this.left=M,this.width=Q):(this.left=M+Q,this.width=-Q),me>=0?(this.top=W,this.height=me):(this.top=W+me,this.height=-me),this.setSize()},p.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},p.prototype.rotate=function(y){if(Math.abs(y.x-this.centerX)>.1){var M=Math.sign(y.x-this.centerX);this.rotationAngle=180*Math.atan((y.y-this.centerY)/(y.x-this.centerX))/Math.PI+90*M,this.applyRotation()}},p.prototype.applyRotation=function(){var y=this.container.transform.baseVal.getItem(0);y.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(y,0)},p.prototype.rotatePoint=function(y){if(this.rotationAngle===0)return y;var M=this.container.getCTM(),Q=q.createPoint(y.x,y.y);return{x:(Q=Q.matrixTransform(M)).x,y:Q.y}},p.prototype.unrotatePoint=function(y){if(this.rotationAngle===0)return y;var M=this.container.getCTM();M=M.inverse();var Q=q.createPoint(y.x,y.y);return{x:(Q=Q.matrixTransform(M)).x,y:Q.y}},p.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},p.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},p.prototype.setupControlBox=function(){this.controlBox=q.createGroup();var y=q.createTransform();y.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(y),this.container.appendChild(this.controlBox),this.controlRect=q.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=q.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 Oe,this.addControlGrips(),this.controlBox.style.display="none"},p.prototype.adjustControlBox=function(){var y=this.controlBox.transform.baseVal.getItem(0);y.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(y,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()},p.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()},p.prototype.createGrip=function(){var y=new lt;return y.visual.transform.baseVal.appendItem(q.createTransform()),this.controlBox.appendChild(y.visual),y},p.prototype.positionGrips=function(){var y=this.controlGrips.topLeft.GRIP_SIZE,M=-y/2,Q=M,W=(this.width+this.CB_DISTANCE)/2-y/2,me=(this.height+this.CB_DISTANCE)/2-y/2,$e=this.height+this.CB_DISTANCE-y/2,ct=this.width+this.CB_DISTANCE-y/2;this.positionGrip(this.controlGrips.topLeft.visual,M,Q),this.positionGrip(this.controlGrips.topCenter.visual,W,Q),this.positionGrip(this.controlGrips.topRight.visual,ct,Q),this.positionGrip(this.controlGrips.centerLeft.visual,M,me),this.positionGrip(this.controlGrips.centerRight.visual,ct,me),this.positionGrip(this.controlGrips.bottomLeft.visual,M,$e),this.positionGrip(this.controlGrips.bottomCenter.visual,W,$e),this.positionGrip(this.controlGrips.bottomRight.visual,ct,$e),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,W,Q-3*this.CB_DISTANCE)},p.prototype.positionGrip=function(y,M,Q){var W=y.transform.baseVal.getItem(0);W.setTranslate(M,Q),y.transform.baseVal.replaceItem(W,0)},p.prototype.hideControlBox=function(){this.controlBox.style.display="none"},p.prototype.showControlBox=function(){this.controlBox.style.display=""},p.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:tt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:tt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},F.prototype.getState.call(this))},p.prototype.restoreState=function(y){F.prototype.restoreState.call(this,y);var M=y;this.left=M.left,this.top=M.top,this.width=M.width,this.height=M.height,this.rotationAngle=M.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(tt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,M.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(tt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,M.containerTransformMatrix))},p.prototype.scale=function(y,M){F.prototype.scale.call(this,y,M);var Q=this.rotatePoint({x:this.left,y:this.top}),W=this.unrotatePoint({x:Q.x*y,y:Q.y*M});this.left=W.x,this.top=W.y,this.width=this.width*y,this.height=this.height*M,this.adjustControlBox()},p}(He),nt=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.fillColor="transparent",W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.opacity=1,W.setStrokeColor=W.setStrokeColor.bind(W),W.setFillColor=W.setFillColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.createVisual=W.createVisual.bind(W),W}return le(p,F),p.prototype.ownsTarget=function(y){return!(!F.prototype.ownsTarget.call(this,y)&&y!==this.visual)},p.prototype.createVisual=function(){this.visual=q.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)},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.state==="new"&&(this.createVisual(),this.moveVisual(y),this._state="creating")},p.prototype.manipulate=function(y){F.prototype.manipulate.call(this,y)},p.prototype.resize=function(y){F.prototype.resize.call(this,y),this.setSize()},p.prototype.setSize=function(){F.prototype.setSize.call(this),q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},p.prototype.pointerUp=function(y){F.prototype.pointerUp.call(this,y),this.setSize()},p.prototype.setStrokeColor=function(y){this.strokeColor=y,this.visual&&q.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(y),this.stateChanged()},p.prototype.setFillColor=function(y){this.fillColor=y,this.visual&&q.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},p.prototype.setStrokeWidth=function(y){this.strokeWidth=y,this.visual&&q.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},p.prototype.setStrokeDasharray=function(y){this.strokeDasharray=y,this.visual&&q.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},p.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this))},p.prototype.restoreState=function(y){var M=y;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),F.prototype.restoreState.call(this,y),this.setSize()},p.prototype.scale=function(y,M){F.prototype.scale.call(this,y,M),this.setSize()},p.title="Rectangle marker",p}(ft),St=function(F){function p(y,M,Q,W){var me=F.call(this,y,W||'')||this;return me.widths=[],me.widthBoxes=[],me.widths=M,me.currentWidth=Q,me.setCurrentWidth=me.setCurrentWidth.bind(me),me}return le(p,F),p.prototype.getUi=function(){var y=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.widths.forEach(function(Q){var W=document.createElement("div");W.style.display="flex",W.style.flexGrow="2",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.borderColor=Q===y.currentWidth?y.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){y.setCurrentWidth(Q,W)}),M.appendChild(W);var me=document.createElement("div");me.innerText=Q.toString(),me.style.marginRight="5px",W.appendChild(me);var $e=document.createElement("div");$e.style.minHeight="20px",$e.style.flexGrow="2",$e.style.display="flex",$e.style.alignItems="center";var ct=document.createElement("hr");ct.style.minWidth="20px",ct.style.border="0px",ct.style.borderTop=Q+"px solid "+y.uiStyleSettings.toolboxColor,ct.style.flexGrow="2",$e.appendChild(ct),W.appendChild($e),y.widthBoxes.push(W)}),M},p.prototype.setCurrentWidth=function(y,M){var Q=this;this.currentWidth=y,this.widthBoxes.forEach(function(W){W.style.borderColor=W===M?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},p}(ze),ht=function(F){function p(y,M,Q,W){var me=F.call(this,y,W||'')||this;return me.styles=[],me.styleBoxes=[],me.styles=M,me.currentStyle=Q,me.setCurrentStyle=me.setCurrentStyle.bind(me),me}return le(p,F),p.prototype.getUi=function(){var y=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.styles.forEach(function(Q){var W=document.createElement("div");W.style.display="flex",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.overflow="hidden",W.style.maxWidth=100/y.styles.length-5+"%",W.style.borderColor=Q===y.currentStyle?y.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){y.setCurrentStyle(Q,W)}),M.appendChild(W);var me=document.createElement("div");me.style.minHeight="20px",me.style.flexGrow="2",me.style.overflow="hidden";var $e=``;me.innerHTML=$e,W.appendChild(me),y.styleBoxes.push(W)}),M},p.prototype.setCurrentStyle=function(y,M){var Q=this;this.currentStyle=y,this.styleBoxes.forEach(function(W){W.style.borderColor=W===M?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},p}(ze),yt=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.strokeColor=Q.defaultColor,W.strokeWidth=Q.defaultStrokeWidth,W.strokeDasharray=Q.defaultStrokeDasharray,W.strokePanel=new qe("Line color",Q.defaultColorSet,Q.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new St("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new ht("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}return le(p,F),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=F.prototype.getState.call(this);return y.typeName=p.typeName,y},p.typeName="FrameMarker",p.title="Frame marker",p.icon='',p}(nt),ke=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Dt=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.x1=0,W.y1=0,W.x2=0,W.y2=0,W.defaultLength=50,W.manipulationStartX=0,W.manipulationStartY=0,W.manipulationStartX1=0,W.manipulationStartY1=0,W.manipulationStartX2=0,W.manipulationStartY2=0,W.setupControlBox(),W}return le(p,F),p.prototype.ownsTarget=function(y){return!!F.prototype.ownsTarget.call(this,y)||!(!this.grip1.ownsTarget(y)&&!this.grip2.ownsTarget(y))},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.manipulationStartX=y.x,this.manipulationStartY=y.y,this.state==="new"&&(this.x1=y.x,this.y1=y.y,this.x2=y.x,this.y2=y.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(M)?this.activeGrip=this.grip1:this.grip2.ownsTarget(M)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},p.prototype.pointerUp=function(y){var M=this.state;F.prototype.pointerUp.call(this,y),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(y),this._state="select",M==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},p.prototype.adjustVisual=function(){},p.prototype.manipulate=function(y){this.state==="creating"?this.resize(y):this.state==="move"?(this.x1=this.manipulationStartX1+y.x-this.manipulationStartX,this.y1=this.manipulationStartY1+y.y-this.manipulationStartY,this.x2=this.manipulationStartX2+y.x-this.manipulationStartX,this.y2=this.manipulationStartY2+y.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(y)},p.prototype.resize=function(y){switch(this.activeGrip){case this.grip1:this.x1=y.x,this.y1=y.y;break;case this.grip2:case void 0:this.x2=y.x,this.y2=y.y}this.adjustVisual(),this.adjustControlBox()},p.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},p.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},p.prototype.setupControlBox=function(){this.controlBox=q.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},p.prototype.adjustControlBox=function(){this.positionGrips()},p.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},p.prototype.createGrip=function(){var y=new lt;return y.visual.transform.baseVal.appendItem(q.createTransform()),this.controlBox.appendChild(y.visual),y},p.prototype.positionGrips=function(){var y=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-y/2,this.y1-y/2),this.positionGrip(this.grip2.visual,this.x2-y/2,this.y2-y/2)},p.prototype.positionGrip=function(y,M,Q){var W=y.transform.baseVal.getItem(0);W.setTranslate(M,Q),y.transform.baseVal.replaceItem(W,0)},p.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},F.prototype.getState.call(this))},p.prototype.restoreState=function(y){F.prototype.restoreState.call(this,y);var M=y;this.x1=M.x1,this.y1=M.y1,this.x2=M.x2,this.y2=M.y2},p.prototype.scale=function(y,M){F.prototype.scale.call(this,y,M),this.x1=this.x1*y,this.y1=this.y1*M,this.x2=this.x2*y,this.y2=this.y2*M,this.adjustVisual(),this.adjustControlBox()},p}(He),Tt=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.setStrokeColor=W.setStrokeColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.strokeColor=Q.defaultColor,W.strokeWidth=Q.defaultStrokeWidth,W.strokeDasharray=Q.defaultStrokeDasharray,W.strokePanel=new qe("Line color",Q.defaultColorSet,Q.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new St("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new ht("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}return le(p,F),p.prototype.ownsTarget=function(y){return!(!F.prototype.ownsTarget.call(this,y)&&y!==this.visual&&y!==this.selectorLine&&y!==this.visibleLine)},p.prototype.createVisual=function(){this.visual=q.createGroup(),this.selectorLine=q.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=q.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)},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},p.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()),q.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),q.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),q.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},p.prototype.setStrokeColor=function(y){this.strokeColor=y,this.adjustVisual(),this.colorChanged(y)},p.prototype.setStrokeWidth=function(y){this.strokeWidth=y,this.adjustVisual()},p.prototype.setStrokeDasharray=function(y){this.strokeDasharray=y,this.adjustVisual(),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},F.prototype.getState.call(this));return y.typeName=p.typeName,y},p.prototype.restoreState=function(y){F.prototype.restoreState.call(this,y);var M=y;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.createVisual(),this.adjustVisual()},p.typeName="LineMarker",p.title="Line marker",p.icon='',p}(Dt),Ue=function(F){function p(y,M,Q,W){var me=F.call(this,y,W||'')||this;return me.fonts=[],me.fontBoxes=[],me.fonts=M,me.currentFont=Q,me.setCurrentFont=me.setCurrentFont.bind(me),me}return le(p,F),p.prototype.getUi=function(){var y=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.flexGrow="2",this.fonts.forEach(function(Q){var W=document.createElement("div");W.style.display="inline-block",W.style.alignItems="center",W.style.justifyContent="space-between",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.overflow="hidden",W.style.maxWidth=100/y.fonts.length-5+"%",W.style.borderColor=Q===y.currentFont?y.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){y.setCurrentFont(Q,W)}),M.appendChild(W);var me=document.createElement("div");me.style.display="flex",me.style.minHeight="20px",me.style.flexGrow="2",me.style.fontFamily=Q,me.style.overflow="hidden";var $e=document.createElement("div");$e.style.whiteSpace="nowrap",$e.style.overflow="hidden",$e.style.textOverflow="ellipsis",$e.innerHTML="The quick brown fox jumps over the lazy dog",me.appendChild($e),W.appendChild(me),y.fontBoxes.push(W)}),M},p.prototype.setCurrentFont=function(y,M){var Q=this;this.currentFont=y,this.fontBoxes.forEach(function(W){W.style.borderColor=W===M?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},p}(ze),Ze=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.color="transparent",W.padding=5,W.DEFAULT_TEXT="your text here",W.text=W.DEFAULT_TEXT,W.isMoved=!1,W.color=Q.defaultColor,W.fontFamily=Q.defaultFontFamily,W.defaultSize={x:100,y:30},W.setColor=W.setColor.bind(W),W.setFont=W.setFont.bind(W),W.renderText=W.renderText.bind(W),W.sizeText=W.sizeText.bind(W),W.textEditDivClicked=W.textEditDivClicked.bind(W),W.showTextEditor=W.showTextEditor.bind(W),W.setSize=W.setSize.bind(W),W.positionTextEditor=W.positionTextEditor.bind(W),W.colorPanel=new qe("Color",Q.defaultColorSet,Q.defaultColor),W.colorPanel.onColorChanged=W.setColor,W.fontFamilyPanel=new Ue("Font",Q.defaultFontFamilies,Q.defaultFontFamily),W.fontFamilyPanel.onFontChanged=W.setFont,W}return le(p,F),p.prototype.ownsTarget=function(y){if(F.prototype.ownsTarget.call(this,y)||y===this.visual||y===this.textElement||y===this.bgRectangle)return!0;var M=!1;return this.textElement.childNodes.forEach(function(Q){Q===y&&(M=!0)}),M},p.prototype.createVisual=function(){this.visual=q.createGroup(),this.bgRectangle=q.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=q.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(q.createTransform()),this.textElement.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.isMoved=!1,this.pointerDownPoint=y,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(y),this._state="creating")},p.prototype.renderText=function(){var y=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(M){y.textElement.appendChild(q.createTSpan(M.trim()===""?" ":M.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},p.prototype.getTextScale=function(){var y=this.textElement.getBBox(),M=1;if(y.width>0&&y.height>0){var Q=(1*this.width-this.width*this.padding*2/100)/y.width,W=(1*this.height-this.height*this.padding*2/100)/y.height;M=Math.min(Q,W)}return M},p.prototype.getTextPosition=function(y){var M=this.textElement.getBBox(),Q=0,W=0;return M.width>0&&M.height>0&&(Q=(this.width-M.width*y)/2,W=this.height/2-M.height*y/2),{x:Q,y:W}},p.prototype.sizeText=function(){var y=this.textElement.getBBox(),M=this.getTextScale(),Q=this.getTextPosition(M);Q.y-=y.y*M,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Q.x+"px, "+Q.y+"px) scale("+M+", "+M+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Q.x,Q.y),this.textElement.transform.baseVal.getItem(1).setScale(M,M))},p.prototype.manipulate=function(y){F.prototype.manipulate.call(this,y),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(y.x-this.pointerDownPoint.x)>5||Math.abs(y.y-this.pointerDownPoint.y)>5)},p.prototype.resize=function(y){F.prototype.resize.call(this,y),this.isMoved=!0,this.setSize(),this.sizeText()},p.prototype.setSize=function(){F.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},p.prototype.pointerUp=function(y){var M=this.state;M==="creating"&&(this._suppressMarkerCreateEvent=!0),F.prototype.pointerUp.call(this,y),this.setSize(),(M==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},p.prototype.showTextEditor=function(){var y=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(M){M.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var M=Number.parseFloat(y.textEditor.style.fontSize);y.textEditor.clientWidth>=Number.parseInt(y.textEditor.style.maxWidth)&&M>.9;)M-=.1,y.textEditor.style.fontSize=Math.max(M,.9)+"em"}),this.textEditor.addEventListener("keyup",function(M){M.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(M){if(M.clipboardData){var Q=M.clipboardData.getData("text"),W=window.getSelection();if(!W.rangeCount)return!1;W.deleteFromDocument(),W.getRangeAt(0).insertNode(document.createTextNode(Q)),M.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){y.textEditDivClicked(y.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},p.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var y=this.getTextScale(),M=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Q=this.textElement.getBBox(),W={x:Q.width*y,y:Q.height*y};M.x-=W.x/2,M.y-=W.y/2,this.textEditor.style.top=M.y+"px",this.textEditor.style.left=M.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-M.x+"px",this.textEditor.style.fontSize=Math.max(16*y,12)+"px",this.textElement.style.display="none"}},p.prototype.textEditDivClicked=function(y){this.text=y.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},p.prototype.select=function(){F.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},p.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),F.prototype.deselect.call(this)},p.prototype.dblClick=function(y,M){F.prototype.dblClick.call(this,y,M),this.showTextEditor()},p.prototype.setColor=function(y){this.textElement&&q.setAttributes(this.textElement,[["fill",y]]),this.color=y,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(y)},p.prototype.setFont=function(y){this.textElement&&q.setAttributes(this.textElement,[["font-family",y]]),this.fontFamily=y,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},p.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},p.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},F.prototype.getState.call(this));return y.typeName=p.typeName,y},p.prototype.restoreState=function(y){var M=y;this.color=M.color,this.fontFamily=M.fontFamily,this.padding=M.padding,this.text=M.text,this.createVisual(),F.prototype.restoreState.call(this,y),this.setSize()},p.prototype.scale=function(y,M){F.prototype.scale.call(this,y,M),this.setSize(),this.sizeText(),this.positionTextEditor()},p.typeName="TextMarker",p.title="Text marker",p.icon='',p}(ft),xe=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.color="transparent",W.lineWidth=3,W.drawing=!1,W.pixelRatio=1,W.color=Q.defaultColor,W.lineWidth=Q.defaultStrokeWidth,W.pixelRatio=Q.freehandPixelRatio,W.setColor=W.setColor.bind(W),W.addCanvas=W.addCanvas.bind(W),W.finishCreation=W.finishCreation.bind(W),W.setLineWidth=W.setLineWidth.bind(W),W.colorPanel=new qe("Color",Q.defaultColorSet,Q.defaultColor),W.colorPanel.onColorChanged=W.setColor,W.lineWidthPanel=new St("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),W.lineWidthPanel.onWidthChanged=W.setLineWidth,W}return le(p,F),p.prototype.ownsTarget=function(y){return!(!F.prototype.ownsTarget.call(this,y)&&y!==this.visual&&y!==this.drawingImage)},p.prototype.createVisual=function(){this.visual=q.createGroup(),this.drawingImage=q.createImage(),this.visual.appendChild(this.drawingImage);var y=q.createTransform();this.visual.transform.baseVal.appendItem(y),this.addMarkerVisualToContainer(this.visual)},p.prototype.pointerDown=function(y,M){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(y.x,y.y),this.drawing=!0):F.prototype.pointerDown.call(this,y,M)},p.prototype.manipulate=function(y){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(y.x,y.y),this.canvasContext.stroke()):F.prototype.manipulate.call(this,y)},p.prototype.resize=function(y){F.prototype.resize.call(this,y),q.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},p.prototype.pointerUp=function(y){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):F.prototype.pointerUp.call(this,y)},p.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)},p.prototype.select=function(){this.state==="creating"&&this.finishCreation(),F.prototype.select.call(this)},p.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),F.prototype.deselect.call(this)},p.prototype.finishCreation=function(){for(var y=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),M=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Q=M[0],W=M[1],me=M[2],$e=M[3],ct=!1,jt=0;jt0&&(ct=!0,jt$e&&($e=jt),Qe>me&&(me=Qe));if(ct){this.left=Q/this.pixelRatio,this.top=W/this.pixelRatio,this.width=(me-Q)/this.pixelRatio,this.height=($e-W)/this.pixelRatio;var Vt=document.createElement("canvas");Vt.width=me-Q,Vt.height=$e-W,Vt.getContext("2d").putImageData(this.canvasContext.getImageData(Q,W,me-Q,$e-W),0,0),this.drawingImgUrl=Vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},p.prototype.setDrawingImage=function(){q.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),q.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},p.prototype.setColor=function(y){this.color=y,this.colorChanged(y)},p.prototype.setLineWidth=function(y){this.lineWidth=y},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=Object.assign({drawingImgUrl:this.drawingImgUrl},F.prototype.getState.call(this));return y.typeName=p.typeName,y},p.prototype.restoreState=function(y){this.createVisual(),F.prototype.restoreState.call(this,y),this.drawingImgUrl=y.drawingImgUrl,this.setDrawingImage()},p.prototype.scale=function(y,M){F.prototype.scale.call(this,y,M),this.setDrawingImage()},p.typeName="FreehandMarker",p.title="Freehand marker",p.icon='',p}(ft),fe=function(F){function p(y,M,Q){var W=F.call(this,y,Q||'')||this;return W.typeBoxes=[],W.currentType=M,W.setCurrentType=W.setCurrentType.bind(W),W}return le(p,F),p.prototype.getUi=function(){var y=this,M=document.createElement("div");M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2";for(var Q=function($e){var ct="both";switch($e){case 0:ct="both";break;case 1:ct="start";break;case 2:ct="end";break;case 3:ct="none"}var jt=document.createElement("div");if(jt.style.display="flex",jt.style.flexGrow="2",jt.style.alignItems="center",jt.style.justifyContent="space-between",jt.style.padding="5px",jt.style.borderWidth="2px",jt.style.borderStyle="solid",jt.style.borderColor=ct===W.currentType?W.uiStyleSettings.toolboxAccentColor:"transparent",jt.addEventListener("click",function(){y.setCurrentType(ct,jt)}),M.appendChild(jt),ct==="both"||ct==="start"){var Qe=document.createElement("div");Qe.style.display="flex",Qe.style.alignItems="center",Qe.style.minHeight="20px",Qe.innerHTML=``,Qe.style.marginLeft="5px",jt.appendChild(Qe)}var Vt=document.createElement("div");Vt.style.display="flex",Vt.style.alignItems="center",Vt.style.minHeight="20px",Vt.style.flexGrow="2";var hn=document.createElement("hr");if(hn.style.minWidth="20px",hn.style.border="0px",hn.style.borderTop="3px solid "+(W.uiStyleSettings!==void 0?W.uiStyleSettings.toolboxColor:"#eeeeee"),hn.style.flexGrow="2",Vt.appendChild(hn),jt.appendChild(Vt),ct==="both"||ct==="end"){var Rn=document.createElement("div");Rn.style.display="flex",Rn.style.alignItems="center",Rn.style.minHeight="20px",Rn.innerHTML=``,Rn.style.marginRight="5px",jt.appendChild(Rn)}W.typeBoxes.push(jt)},W=this,me=0;me<4;me++)Q(me);return M},p.prototype.setCurrentType=function(y,M){var Q=this;this.currentType=y,this.typeBoxes.forEach(function(W){W.style.borderColor=W===M?Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},p}(ze),be=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.arrowType="end",W.arrowBaseHeight=10,W.arrowBaseWidth=10,W.getArrowPoints=W.getArrowPoints.bind(W),W.setArrowType=W.setArrowType.bind(W),W.arrowTypePanel=new fe("Arrow type","end"),W.arrowTypePanel.onArrowTypeChanged=W.setArrowType,W}return le(p,F),p.prototype.ownsTarget=function(y){return!(!F.prototype.ownsTarget.call(this,y)&&y!==this.arrow1&&y!==this.arrow2)},p.prototype.getArrowPoints=function(y,M){var Q=this.arrowBaseWidth+2*this.strokeWidth,W=this.arrowBaseHeight+2*this.strokeWidth;return y-Q/2+","+(M+W/2)+" "+y+","+(M-W/2)+" "+(y+Q/2)+","+(M+W/2)},p.prototype.createTips=function(){this.arrow1=q.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=q.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(q.createTransform()),this.visual.appendChild(this.arrow2)},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.state==="creating"&&this.createTips()},p.prototype.adjustVisual=function(){if(F.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",q.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),q.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var y=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.arrow1.transform.baseVal.getItem(0);M.setRotate(y,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(M,0);var Q=this.arrow2.transform.baseVal.getItem(0);Q.setRotate(y+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Q,0)}},p.prototype.setArrowType=function(y){this.arrowType=y,this.adjustVisual(),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=Object.assign({arrowType:this.arrowType},F.prototype.getState.call(this));return y.typeName=p.typeName,y},p.prototype.restoreState=function(y){F.prototype.restoreState.call(this,y);var M=y;this.arrowType=M.arrowType,this.createTips(),this.adjustVisual()},p.typeName="ArrowMarker",p.title="Arrow marker",p.icon='',p}(Tt),ne=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.fillColor=Q.defaultFillColor,W.strokeWidth=0,W.fillPanel=new qe("Color",Q.defaultColorSet,Q.defaultFillColor),W.fillPanel.onColorChanged=W.setFillColor,W}return le(p,F),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=F.prototype.getState.call(this);return y.typeName=p.typeName,y},p.typeName="CoverMarker",p.title="Cover marker",p.icon='',p}(nt),re=function(F){function p(y,M,Q,W){var me=F.call(this,y,W||'')||this;return me.opacities=[],me.opacityBoxes=[],me.opacities=M,me.currentOpacity=Q,me.setCurrentOpacity=me.setCurrentOpacity.bind(me),me}return le(p,F),p.prototype.getUi=function(){var y=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",M.style.justifyContent="space-between",this.opacities.forEach(function(Q){var W=document.createElement("div");W.style.display="flex",W.style.alignItems="center",W.style.justifyContent="center",W.style.padding="5px",W.style.borderWidth="2px",W.style.borderStyle="solid",W.style.borderColor=Q===y.currentOpacity?y.uiStyleSettings.toolboxAccentColor:"transparent",W.addEventListener("click",function(){y.setCurrentOpacity(Q,W)}),M.appendChild(W);var me=document.createElement("div");me.innerText=100*Q+"%",W.appendChild(me),y.opacityBoxes.push(W)}),M},p.prototype.setCurrentOpacity=function(y,M){var Q=this;this.currentOpacity=y,this.opacityBoxes.forEach(function(W){W.style.borderColor=W===M?Q.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},p}(ze),ae=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.setOpacity=W.setOpacity.bind(W),W.fillColor=Q.defaultHighlightColor,W.strokeWidth=0,W.opacity=Q.defaultHighlightOpacity,W.fillPanel=new qe("Color",Q.defaultColorSet,W.fillColor),W.fillPanel.onColorChanged=W.setFillColor,W.opacityPanel=new re("Opacity",Q.defaultOpacitySteps,W.opacity),W.opacityPanel.onOpacityChanged=W.setOpacity,W}return le(p,F),p.prototype.setOpacity=function(y){this.opacity=y,this.visual&&q.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=F.prototype.getState.call(this);return y.typeName=p.typeName,y},p.typeName="HighlightMarker",p.title="Highlight marker",p.icon='',p}(ne),de='',ue=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.bgColor="transparent",W.tipPosition={x:0,y:0},W.tipBase1Position={x:0,y:0},W.tipBase2Position={x:0,y:0},W.tipMoving=!1,W.color=Q.defaultStrokeColor,W.bgColor=Q.defaultFillColor,W.fontFamily=Q.defaultFontFamily,W.defaultSize={x:100,y:30},W.setBgColor=W.setBgColor.bind(W),W.getTipPoints=W.getTipPoints.bind(W),W.positionTip=W.positionTip.bind(W),W.setTipPoints=W.setTipPoints.bind(W),W.colorPanel=new qe("Text color",Q.defaultColorSet,W.color,''),W.colorPanel.onColorChanged=W.setColor,W.bgColorPanel=new qe("Fill color",Q.defaultColorSet,W.bgColor,de),W.bgColorPanel.onColorChanged=W.setBgColor,W.fontFamilyPanel=new Ue("Font",Q.defaultFontFamilies,Q.defaultFontFamily),W.fontFamilyPanel.onFontChanged=W.setFont,W.tipGrip=new lt,W.tipGrip.visual.transform.baseVal.appendItem(q.createTransform()),W.controlBox.appendChild(W.tipGrip.visual),W}return le(p,F),p.prototype.ownsTarget=function(y){return F.prototype.ownsTarget.call(this,y)||this.tipGrip.ownsTarget(y)||this.tip===y},p.prototype.createTip=function(){q.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=q.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},p.prototype.pointerDown=function(y,M){this.state==="new"&&F.prototype.pointerDown.call(this,y,M),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(M)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):F.prototype.pointerDown.call(this,y,M)},p.prototype.pointerUp=function(y){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,F.prototype.pointerUp.call(this,y);else{var M=this.state==="creating";F.prototype.pointerUp.call(this,y),this.setTipPoints(M),this.positionTip()}},p.prototype.manipulate=function(y){if(this.tipMoving){var M=this.unrotatePoint(y);this.tipPosition={x:M.x-this.manipulationStartLeft,y:M.y-this.manipulationStartTop},this.positionTip()}else F.prototype.manipulate.call(this,y)},p.prototype.setBgColor=function(y){this.bgRectangle&&this.tip&&(q.setAttributes(this.bgRectangle,[["fill",y]]),q.setAttributes(this.tip,[["fill",y]])),this.bgColor=y,this.fillColorChanged(y)},p.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},p.prototype.setTipPoints=function(y){y===void 0&&(y=!1);var M=Math.min(this.height/2,15),Q=this.height/5;y&&(this.tipPosition={x:M+Q/2,y:this.height+20});var W=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?W',p}(Ze),we=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.fillColor="transparent",W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.opacity=1,W.strokeColor=Q.defaultColor,W.strokeWidth=Q.defaultStrokeWidth,W.strokeDasharray=Q.defaultStrokeDasharray,W.fillColor=Q.defaultFillColor,W.setStrokeColor=W.setStrokeColor.bind(W),W.setFillColor=W.setFillColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.setOpacity=W.setOpacity.bind(W),W.createVisual=W.createVisual.bind(W),W.strokePanel=new qe("Line color",ie(Q.defaultColorSet,["transparent"]),Q.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.fillPanel=new qe("Fill color",ie(Q.defaultColorSet,["transparent"]),W.fillColor,de),W.fillPanel.onColorChanged=W.setFillColor,W.strokeWidthPanel=new St("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new ht("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W.opacityPanel=new re("Opacity",Q.defaultOpacitySteps,W.opacity),W.opacityPanel.onOpacityChanged=W.setOpacity,W}return le(p,F),p.prototype.ownsTarget=function(y){return!(!F.prototype.ownsTarget.call(this,y)&&y!==this.visual)},p.prototype.createVisual=function(){this.visual=q.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)},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.state==="new"&&(this.createVisual(),this.moveVisual(y),this._state="creating")},p.prototype.manipulate=function(y){F.prototype.manipulate.call(this,y)},p.prototype.resize=function(y){F.prototype.resize.call(this,y),this.setSize()},p.prototype.setSize=function(){F.prototype.setSize.call(this),q.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},p.prototype.pointerUp=function(y){F.prototype.pointerUp.call(this,y),this.setSize()},p.prototype.setStrokeColor=function(y){this.strokeColor=y,this.visual&&q.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(y),this.stateChanged()},p.prototype.setFillColor=function(y){this.fillColor=y,this.visual&&q.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(y),this.stateChanged()},p.prototype.setStrokeWidth=function(y){this.strokeWidth=y,this.visual&&q.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},p.prototype.setStrokeDasharray=function(y){this.strokeDasharray=y,this.visual&&q.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},p.prototype.setOpacity=function(y){this.opacity=y,this.visual&&q.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this));return y.typeName=p.typeName,y},p.prototype.restoreState=function(y){var M=y;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),F.prototype.restoreState.call(this,y),this.setSize()},p.prototype.scale=function(y,M){F.prototype.scale.call(this,y,M),this.setSize()},p.typeName="EllipseMarker",p.title="Ellipse marker",p.icon='',p}(ft),Le=function(F){function p(y,M,Q){return F.call(this,y,M,Q)||this}return le(p,F),Object.defineProperty(p.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),p.prototype.ownsTarget=function(y){return!(!F.prototype.ownsTarget.call(this,y)&&y!==this.tip1&&y!==this.tip2)},p.prototype.createTips=function(){this.tip1=q.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(q.createTransform()),this.visual.appendChild(this.tip1),this.tip2=q.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(q.createTransform()),this.visual.appendChild(this.tip2)},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.state==="creating"&&this.createTips()},p.prototype.adjustVisual=function(){if(F.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(q.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()]]),q.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 y=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),M=this.tip1.transform.baseVal.getItem(0);M.setRotate(y,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(M,0);var Q=this.tip2.transform.baseVal.getItem(0);Q.setRotate(y+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Q,0)}},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=F.prototype.getState.call(this);return y.typeName=p.typeName,y},p.prototype.restoreState=function(y){F.prototype.restoreState.call(this,y),this.createTips(),this.adjustVisual()},p.typeName="MeasurementMarker",p.title="Measurement marker",p.icon='',p}(Tt),rt=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.strokePanel.colors=Q.defaultColorSet,W.fillColor="transparent",W}return le(p,F),Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=F.prototype.getState.call(this);return y.typeName=p.typeName,y},p.typeName="EllipseFrameMarker",p.title="Ellipse frame marker",p.icon='',p}(we),je=function(){function F(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),F.prototype.addUndoStep=function(p){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(p)||(this.undoStack.push(p),JSON.stringify(this.lastRedoStep)!==JSON.stringify(p)&&this.redoStack.splice(0,this.redoStack.length))},F.prototype.replaceLastUndoStep=function(p){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=p)},F.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},F.prototype.undo=function(){if(this.undoStack.length>1){var p=this.undoStack.pop();return p!==void 0&&this.redoStack.push(p),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},F.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},F}(),Ye=function(F){function p(y,M,Q){var W=F.call(this,y,M,Q)||this;return W.strokeColor="transparent",W.strokeWidth=0,W.strokeDasharray="",W.curveX=0,W.curveY=0,W.manipulationStartCurveX=0,W.manipulationStartCurveY=0,W.setStrokeColor=W.setStrokeColor.bind(W),W.setStrokeWidth=W.setStrokeWidth.bind(W),W.setStrokeDasharray=W.setStrokeDasharray.bind(W),W.positionGrips=W.positionGrips.bind(W),W.addControlGrips=W.addControlGrips.bind(W),W.adjustVisual=W.adjustVisual.bind(W),W.setupControlBox=W.setupControlBox.bind(W),W.resize=W.resize.bind(W),W.strokeColor=Q.defaultColor,W.strokeWidth=Q.defaultStrokeWidth,W.strokeDasharray=Q.defaultStrokeDasharray,W.strokePanel=new qe("Line color",Q.defaultColorSet,Q.defaultColor),W.strokePanel.onColorChanged=W.setStrokeColor,W.strokeWidthPanel=new St("Line width",Q.defaultStrokeWidths,Q.defaultStrokeWidth),W.strokeWidthPanel.onWidthChanged=W.setStrokeWidth,W.strokeStylePanel=new ht("Line style",Q.defaultStrokeDasharrays,Q.defaultStrokeDasharray),W.strokeStylePanel.onStyleChanged=W.setStrokeDasharray,W}return le(p,F),p.prototype.ownsTarget=function(y){return!(!F.prototype.ownsTarget.call(this,y)&&y!==this.visual&&y!==this.selectorCurve&&y!==this.visibleCurve&&!this.curveGrip.ownsTarget(y))},p.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},p.prototype.createVisual=function(){this.visual=q.createGroup(),this.selectorCurve=q.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=q.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)},p.prototype.pointerDown=function(y,M){F.prototype.pointerDown.call(this,y,M),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=y.x,this.curveY=y.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(M)&&(this.activeGrip=this.curveGrip,this._state="resize")},p.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),q.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),q.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),q.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},p.prototype.setupControlBox=function(){F.prototype.setupControlBox.call(this),this.curveControlLine1=q.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=q.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)},p.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,F.prototype.addControlGrips.call(this)},p.prototype.positionGrips=function(){F.prototype.positionGrips.call(this);var y=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-y/2,this.curveY-y/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()))},p.prototype.manipulate=function(y){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+y.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+y.y-this.manipulationStartY),F.prototype.manipulate.call(this,y)},p.prototype.resize=function(y){this.activeGrip===this.curveGrip&&(this.curveX=y.x,this.curveY=y.y),F.prototype.resize.call(this,y),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},p.prototype.setStrokeColor=function(y){this.strokeColor=y,this.adjustVisual(),this.colorChanged(y)},p.prototype.setStrokeWidth=function(y){this.strokeWidth=y,this.adjustVisual()},p.prototype.setStrokeDasharray=function(y){this.strokeDasharray=y,this.adjustVisual()},p.prototype.scale=function(y,M){this.curveX=this.curveX*y,this.curveY=this.curveY*M,F.prototype.scale.call(this,y,M)},Object.defineProperty(p.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),p.prototype.getState=function(){var y=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},F.prototype.getState.call(this));return y.typeName=p.typeName,y},p.prototype.restoreState=function(y){F.prototype.restoreState.call(this,y);var M=y;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.curveX=M.curveX,this.curveY=M.curveY,this.createVisual(),this.adjustVisual()},p.typeName="CurveMarker",p.title="Curve marker",p.icon='',p}(Dt),Pt=function(){function F(p,y){y===void 0&&(y=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=p,this.cancelable=y}return Object.defineProperty(F.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),F.prototype.preventDefault=function(){this._defaultPrevented=!0},F}(),ut=function(F){function p(y,M,Q){var W=F.call(this,y,!1)||this;return W.dataUrl=M,W.state=Q,W}return le(p,F),p}(Pt),mt=function(F){function p(y,M,Q){Q===void 0&&(Q=!1);var W=F.call(this,y,Q)||this;return W.marker=M,W}return le(p,F),p}(Pt),zt=function(){function F(){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 F.prototype.addEventListener=function(p,y){this[p].push(y)},F.prototype.removeEventListener=function(p,y){var M=this[p].indexOf(y);M>-1&&this[p].splice(M,1)},F}(),Je=function(){function F(p){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ke,this._isOpen=!1,this.undoRedoManager=new je,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 zt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=F.instanceCounter++,this.styles=new Pe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=p,this.targetRoot=document.body,this.width=p.clientWidth,this.height=p.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(F.prototype,"ALL_MARKER_TYPES",{get:function(){return[yt,xe,be,Ze,rt,we,ae,ue,Le,ne,Tt,Ye]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[yt,xe,be,Ze,we,ae,ue]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"BASIC_MARKER_TYPES",{get:function(){return[yt,xe,be,Ze,ae]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(p){var y=this;this._availableMarkerTypes.splice(0),p.forEach(function(M){if(typeof M=="string"){var Q=y.ALL_MARKER_TYPES.find(function(W){return W.typeName===M});Q!==void 0&&y._availableMarkerTypes.push(Q)}else y._availableMarkerTypes.push(M)})},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(p){this._zoomLevel=p,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(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),F.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Ee.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},F.prototype.show=function(){var p=this;this.styles.styleSheetRoot===void 0&&Ne.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ne.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(y){return y(new Pt(p))})},F.prototype.render=function(){return se(this,void 0,void 0,function(){var p;return ge(this,function(y){switch(y.label){case 0:return this.setCurrentMarker(),(p=new Me).naturalSize=this.renderAtNaturalSize,p.imageType=this.renderImageType,p.imageQuality=this.renderImageQuality,p.markersOnly=this.renderMarkersOnly,p.width=this.renderWidth,p.height=this.renderHeight,[4,p.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return y.sent(),[4,p.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,y.sent()]}})})},F.prototype.close=function(p){var y=this;if(p===void 0&&(p=!1),this.isOpen){var M=!1;p||this.eventListeners.beforeclose.forEach(function(Q){var W=new Pt(y,!0);Q(W),W.defaultPrevented&&(M=!0)}),M||(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(Q){return Q(new Pt(y))}),this.detachEvents(),this._isOpen=!1)}},F.prototype.addMarkersToToolbar=function(){for(var p,y=[],M=0;Mthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*p:this.editorCanvas.clientWidth,M=y',p.title="Powered by marker.js",p.style.display="grid",p.style.alignItems="center",p.style.justifyItems="center",p.style.padding="3px",p.style.width="20px",p.style.height="20px",this.logoUI.appendChild(p),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},F.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")},F.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"},F.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},F.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 p=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=p+"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 De(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-1&&this.markers.splice(this.markers.indexOf(p),1),p.dispose()},F.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())},F.prototype.toolbarButtonClicked=function(p,y){if(p==="marker"&&y!==void 0)this.createNewMarker(y);else if(p==="action")switch(y){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()}},F.prototype.deleteSelectedMarker=function(){var p=this;if(this._currentMarker!==void 0){var y=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Q){var W=new mt(p,p._currentMarker,!0);Q(W),W.defaultPrevented&&(y=!0)}),!y){var M=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(Q){return Q(new mt(p,M))})}}},F.prototype.clear=function(){var p=this,y=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(me){var $e=new mt(p,void 0,!0);me($e),$e.defaultPrevented&&(y=!0)}),!y)){this.setCurrentMarker();for(var M=function(me){var $e=Q.markers[me];Q.setCurrentMarker(Q.markers[me]),Q._currentMarker.dispose(),Q.markerImage.removeChild(Q._currentMarker.container),Q.markers.splice(Q.markers.indexOf(Q._currentMarker),1),Q.eventListeners.markerdelete.forEach(function(ct){return ct(new mt(p,$e))})},Q=this,W=this.markers.length-1;W>=0;W--)M(W);this.addUndoStep()}},Object.defineProperty(F.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),F.prototype.showNotesEditor=function(){var p;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=(p=this._currentMarker.notes)!==null&&p!==void 0?p:"",this.overlayContainer.appendChild(this.notesArea))},F.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)},F.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},F.prototype.addUndoStep=function(){var p=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var y=this.getState(),M=this.undoRedoManager.getLastUndoStep();if(!M||M.width===y.width&&M.height===y.height){var Q=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(y),Q1&&this.panTo({x:p.clientX,y:p.clientY}))},F.prototype.onPointerUp=function(p){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(p.clientX,p.clientY)),this.isDragging=!1,this.addUndoStep()},F.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},F.prototype.onKeyUp=function(p){this._currentMarker===void 0||this.notesArea!==void 0||p.key!=="Delete"&&p.key!=="Backspace"||this.deleteSelectedMarker()},F.prototype.clientToLocalCoordinates=function(p,y){var M=this.markerImage.getBoundingClientRect();return{x:(p-M.left)/this.zoomLevel,y:(y-M.top)/this.zoomLevel}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var p=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=p+"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()},F.prototype.addLicenseKey=function(p){Ee.addKey(p)},F.prototype.addEventListener=function(p,y){this.eventListeners.addEventListener(p,y)},F.prototype.removeEventListener=function(p,y){this.eventListeners.removeEventListener(p,y)},F.prototype.renderState=function(p){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(p),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(F.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),F.prototype.focus=function(){var p=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(y){return y(new Pt(p))}))},F.prototype.blur=function(){var p=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(y){return y(new Pt(p))}))},F.instanceCounter=0,F}();/* **********************************
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 Kt=function(F,p){return(Kt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,M){y.__proto__=M}||function(y,M){for(var Q in M)Object.prototype.hasOwnProperty.call(M,Q)&&(y[Q]=M[Q])})(F,p)};function sn(F,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");function y(){this.constructor=F}Kt(F,p),F.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}function Bt(F,p,y,M){return new(y||(y=Promise))(function(Q,W){function me(jt){try{ct(M.next(jt))}catch(Qe){W(Qe)}}function $e(jt){try{ct(M.throw(jt))}catch(Qe){W(Qe)}}function ct(jt){var Qe;jt.done?Q(jt.value):(Qe=jt.value,Qe instanceof y?Qe:new y(function(Vt){Vt(Qe)})).then(me,$e)}ct((M=M.apply(F,p||[])).next())})}function an(F,p){var y,M,Q,W,me={label:0,sent:function(){if(1&Q[0])throw Q[1];return Q[1]},trys:[],ops:[]};return W={next:$e(0),throw:$e(1),return:$e(2)},typeof Symbol=="function"&&(W[Symbol.iterator]=function(){return this}),W;function $e(ct){return function(jt){return function(Qe){if(y)throw new TypeError("Generator is already executing.");for(;me;)try{if(y=1,M&&(Q=2&Qe[0]?M.return:Qe[0]?M.throw||((Q=M.return)&&Q.call(M),0):M.next)&&!(Q=Q.call(M,Qe[1])).done)return Q;switch(M=0,Q&&(Qe=[2&Qe[0],Q.value]),Qe[0]){case 0:case 1:Q=Qe;break;case 4:return me.label++,{value:Qe[1],done:!1};case 5:me.label++,M=Qe[1],Qe=[0];continue;case 7:Qe=me.ops.pop(),me.trys.pop();continue;default:if(!(Q=me.trys,(Q=Q.length>0&&Q[Q.length-1])||Qe[0]!==6&&Qe[0]!==2)){me=0;continue}if(Qe[0]===3&&(!Q||Qe[1]>Q[0]&&Qe[1]0&&y>0){var M=new ln(p,y),Q=M.ratio>=1?20:M.getHorizontalLength(20),W=M.ratio<1?20:M.getVerticalLength(20),me=document.createElementNS("http://www.w3.org/2000/svg","svg");me.setAttribute("xmlns","http://www.w3.org/2000/svg"),me.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(me);var $e=ot.createDefs();me.appendChild($e);var ct=ot.createElement("clipPath",[["id","text-bg-clip"]]);$e.appendChild(ct);var jt=ot.createPath(ot.getHollowRectanglePath((24-Q)/2,(24-W)/2,Q,W,(24-Q)/2+2,(24-W)/2+2,Q-4,W-4));me.appendChild(jt);var Qe=ot.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Qe.appendChild(ot.createTSpan(p+":"+y)),me.appendChild(Qe);var Vt=Qe.getBBox();ot.setAttributes(Qe,[["x",((24-Vt.width)/2).toString()],["y",((24-Vt.height)/2-Vt.y).toString()]]);var hn=ot.createPath(ot.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Vt.width))/2,(24-Math.ceil(Vt.height))/2,Math.ceil(Vt.width),Math.ceil(Vt.height)));return ct.appendChild(hn),ot.setAttributes(jt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(me),me.outerHTML}return''},F}(),cn=function(F){function p(y,M,Q){var W=F.call(this,y,M)||this;return W.isDropdownOpen=!1,W.onClick=W.dropdownButtonClicked,W.dropdownButtons=Q,W}return sn(p,F),p.prototype.setupDropdown=function(){var y=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(M){M.className=y.className,M.colorsClassName=y.colorsClassName,y.dropdownBlock.appendChild(M.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},p.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},p.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},p.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},p.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},p.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},p}(st),qt=function(){function F(p,y){this.GRIP_SIZE=10,this.color=p,this.fillColor=y,this.visual=ot.createGroup(),this.visual.appendChild(ot.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ot.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(p){return p===this.visual||p===this.visual.childNodes[0]||p===this.visual.childNodes[1]},F.prototype.setCenter=function(p,y){this.visual.childNodes.forEach(function(M){return ot.setAttributes(M,[["cx",p.toString()],["cy",y.toString()]])})},F}(),En=function(){function F(p,y,M,Q){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=p,this.canvasHeight=y,this.margin=M,this.container=Q,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(F.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(p){this._aspectRatio=p,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(p){this._isGridVisible=p,this.gridContainer&&ot.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(p){this._zoomFactor=p,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),F.prototype.open=function(){var p=this;this.cropShadeElement=ot.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=ot.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var y=0;ythis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-y.height/2),ot.setAttributes(this.cropRectElement,[["x",y.x.toString()],["y",y.y.toString()],["width",y.width.toString()],["height",y.height.toString()]]);var M=y.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(W,me){var $e=y.y+M*(me+1);ot.setAttributes(W,[["x1",""+y.x],["y1",""+$e],["x2",""+(y.x+y.width)],["y2",""+$e]])});var Q=y.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(W,me){var $e=y.x+Q*(me+1);ot.setAttributes(W,[["x1",""+$e],["y1",""+y.y],["x2",""+$e],["y2",""+(y.y+y.height)]])}),ot.setAttributes(this.cropShadeElement,[["d",ot.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,y.x,y.y,y.width,y.height)]]),this.topLeftGrip.setCenter(y.x,y.y),this.topRightGrip.setCenter(y.x+y.width,y.y),this.bottomLeftGrip.setCenter(y.x,y.y+y.height),this.bottomRightGrip.setCenter(y.x+y.width,y.y+y.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},F.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)},F.prototype.clientToLocalCoordinates=function(p,y){var M=this.container.getBoundingClientRect();return{x:p-M.left+this.margin,y:y-M.top+this.margin}},F.prototype.onPointerDown=function(p){this.container.setPointerCapture(p.pointerId),this.previousPoint=this.clientToLocalCoordinates(p.clientX,p.clientY),this.cropRectElement===p.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(p.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(p.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(p.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(p.target)&&(this.activeGrip=this.bottomRightGrip)},F.prototype.onPointerMove=function(p){if(this.isMoving)this.move(this.clientToLocalCoordinates(p.clientX,p.clientY));else if(this.activeGrip){var y=this.clientToLocalCoordinates(p.clientX,p.clientY);this.resize(y)}p.preventDefault()},F.prototype.onPointerUp=function(p){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(p.pointerId)},F.prototype.move=function(p){var y=p.x-this.previousPoint.x,M=p.y-this.previousPoint.y;this.zoomFactor!==1&&(y=-y/this.zoomFactor,M=-M/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+y),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+M),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=p},F.prototype.resize=function(p){var y=Object.assign({},this.cropRect),M=p.x-this.previousPoint.x,Q=p.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:y.x+Mthis.canvasWidth*this.zoomFactor&&(M=this.canvasWidth*this.zoomFactor-y.width),y.width+=M}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(y.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(M),y.height=this.aspectRatio.getVerticalLength(y.width)):(y.y+=Q,y.height=this.cropRect.y+this.cropRect.height-y.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?y.height=this.aspectRatio.getVerticalLength(y.width):y.height+=Q}y.width<10&&(y.x=this.cropRect.x,y.width=10),y.height<10&&(y.y=this.cropRect.y,y.height=10),this.previousPoint=p,y.x>=this.margin&&y.y>=this.margin&&y.x-this.margin+y.width<=this.canvasWidth&&y.y-this.margin+y.height<=this.canvasHeight&&(this.cropRect=y,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},F.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var p=this.cropRect.x+this.cropRect.width/2,y=this.cropRect.y+this.cropRect.height/2,M=this.aspectRatio.getHorizontalLength(this.cropRect.height),Q=this.aspectRatio.getVerticalLength(this.cropRect.width);M/this.canvasWidththis.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=p-this.cropRect.width/2,this.cropRect.y=y-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)}},F.prototype.getRescaledRect=function(p,y,M,Q,W,me){var $e=M/p,ct=Q/y;return{x:(W.x-me)*$e+me,y:(W.y-me)*ct+me,width:W.width*$e,height:W.height*ct}},F.prototype.scaleCanvas=function(p,y){var M=this.getRescaledRect(this.canvasWidth,this.canvasHeight,p,y,this.cropRect,this.margin);this.canvasWidth=p,this.canvasHeight=y,this.onCropChange&&this.onCropChange(M),this.setCropRectangle(M)},F}(),on=function(){function F(p){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=p,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(F.prototype,"angle",{get:function(){return this._angle},set:function(p){this._angle=p,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),F.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},F.prototype.onPointerDown=function(p){this.controlContainer.setPointerCapture(p.pointerId),this.isDragging=!0,this.previousPoint={x:p.clientX,y:p.clientY}},F.prototype.onPointerMove=function(p){this.isDragging&&(this.onAngleChange&&this.onAngleChange((p.clientX-this.previousPoint.x)/5),this.previousPoint.x=p.clientX)},F.prototype.onPointerUp=function(p){this.isDragging&&this.onAngleChange&&this.onAngleChange((p.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(p.pointerId)},F.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var p=this.angleLabelText.getBBox();ot.setAttributes(this.angleLabelElement,[["x",((this.width-p.width)/2).toString()],["y",(this.height/2).toString()]])}},F.prototype.positionScaleShape=function(){if(this.scaleShape){var p=this.scaleShape.transform.baseVal.getItem(0);p.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(p,0)}},F.prototype.getVisual=function(){var p=document.createElementNS("http://www.w3.org/2000/svg","svg");p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("width",this.width+"px"),p.setAttribute("height",this.height+"px"),p.setAttribute("viewBox","0 0 "+this.width+" "+this.height),p.style.flexShrink="0",document.body.appendChild(p);for(var y="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,M=1;M<=this.width/5+10;M++){var Q=M%5==0?this.height/3:this.height/6;y+="h4v"+-Q+"h1v"+Q}y+="v1H0Z",this.scaleShape=ot.createPath(y);var W=ot.createTransform();this.scaleShape.transform.baseVal.appendItem(W),p.appendChild(this.scaleShape),this.angleLabelElement=ot.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=ot.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var me=ot.createTSpan("");return me.innerHTML="°",this.angleLabelElement.appendChild(me),p.appendChild(this.angleLabelElement),document.body.removeChild(p),p},F}(),pt=function(){function F(){this.naturalSize=!1,this.imageType="image/png"}return F.prototype.rasterize=function(p,y,M,Q,W,me,$e){var ct=this;return new Promise(function(jt){var Qe=document.createElement("canvas");Qe.width=p.width.baseVal.value-2*Q,Qe.height=p.height.baseVal.value-2*Q;var Vt=1,hn=1;ct.naturalSize===!0?(Vt=y.naturalWidth/(p.width.baseVal.value-2*Q)/me,hn=y.naturalHeight/(p.height.baseVal.value-2*Q)/$e,Qe.width=y.naturalWidth/me,Qe.height=y.naturalHeight/$e):ct.width!==void 0&&ct.height!==void 0&&(Vt=ct.width/M.width,hn=ct.height/M.height,Qe.width*=Vt,Qe.height*=hn);var Rn=Qe.getContext("2d");Rn.translate(Qe.width/2,Qe.height/2),Rn.rotate(W*Math.PI/180),Rn.scale(me,$e),Rn.translate(-Qe.width/2,-Qe.height/2),Rn.drawImage(y,0,0,Qe.width,Qe.height);var pr=document.createElement("canvas");pr.width=M.width*Vt,pr.height=M.height*hn,pr.getContext("2d").putImageData(Rn.getImageData((M.x-Q)*Vt,(M.y-Q)*hn,M.width*Vt,M.height*hn),0,0),jt(pr.toDataURL(ct.imageType,ct.imageQuality))})},F}(),Ge=function(){function F(p){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=F.instanceCounter++,this.styles=new Ft(this.instanceNo),this.target=p,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(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(p){this._zoomToCropEnabled=p,p?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(p){this._isGridVisible=p,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"gridLines",{get:function(){return this._gridLines},set:function(p){this._gridLines=p,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(p){this._rotationAngle=p,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"aspectRatio",{get:function(){var p;return(p=this._aspectRatio)!==null&&p!==void 0?p:this.aspectRatios[0]},set:function(p){this._aspectRatio=p},enumerable:!1,configurable:!0}),F.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},F.prototype.show=function(){this.showUI(),this.open()},F.prototype.close=function(p){p===void 0&&(p=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),p||this.closeEventListeners.forEach(function(y){return y()}),this._isOpen=!1)},F.prototype.addRenderEventListener=function(p){this.renderEventListeners.push(p)},F.prototype.removeRenderEventListener=function(p){this.renderEventListeners.indexOf(p)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(p),1)},F.prototype.addCloseEventListener=function(p){this.closeEventListeners.push(p)},F.prototype.removeCloseEventListener=function(p){this.closeEventListeners.indexOf(p)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(p),1)},F.prototype.setupResizeObserver=function(){var p=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){p.resize(p.target.clientWidth,p.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))},F.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var p=1*this.target.clientWidth/this.target.clientHeight,y=this.contentDiv.clientWidth/p>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*p:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,M=y+2*this.CANVAS_MARGINp+this.CANVAS_MARGIN?this.target.offsetTop-(p+this.CANVAS_MARGIN):0;this.coverDiv.style.top=y+"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},F.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},F.prototype.addTopToolbar=function(){var p=this;this.topToolbar=new Mt,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 y=new Lt;y.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(y);var M=[];this.aspectRatios.forEach(function(hn){var Rn=new st($t.getIcon(hn.horizontal,hn.vertical),hn.horizontal===0&&hn.vertical===0?"FREE":hn.horizontal+":"+hn.vertical);Rn.onClick=function(){return p.ratioButtonClicked(hn)},M.push(Rn)}),this.aspectRatioButton=new cn($t.getIcon(0,0),"Aspect ratio",M),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,y.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var Q=new st('',"Toggle grid");Q.isActive=this.isGridVisible,Q.onClick=function(){p.isGridVisible=!p.isGridVisible,Q.isActive=p.isGridVisible},y.addButton(Q);var W=new st('',"Zoom to selection");if(W.isActive=this.zoomToCropEnabled,W.onClick=function(){p.zoomToCropEnabled=!p.zoomToCropEnabled,W.isActive=p.zoomToCropEnabled},y.addButton(W),!Qt.isLicensed){var me=new Ve;this.topToolbar.addElementBlock(me);var $e=document.createElement("div");$e.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ct=document.createElement("a");ct.style.color="currentColor",ct.href="https://markerjs.com/products/cropro",ct.target="_blank",ct.innerHTML='',$e.appendChild(ct),me.addElement($e)}var jt=new Lt;jt.minWidth=3*this.toolbarHeight+"px",jt.contentAlign="end",this.topToolbar.addButtonBlock(jt);var Qe=new st('',"OK");Qe.onClick=this.startRenderAndClose,jt.addButton(Qe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Qe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Vt=new st('',"Close");Vt.onClick=this.close,jt.addButton(Vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},F.prototype.addBottomToolbar=function(){var p=this;this.bottomToolbar=new Mt,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 y=new Lt;y.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(y);var M=new st('',"Rotate left");M.onClick=this.rotateLeftButtonClicked,y.addButton(M);var Q=new st('',"Rotate right");Q.onClick=this.rotateRightButtonClicked,y.addButton(Q);var W=new Ve;W.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(W),this.straightener=new on("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(jt){p.rotateBy(jt),p.straightener.angle=p.rotationAngle},W.addElement(this.straightener.getUI());var me=new Lt;me.minWidth=2*this.toolbarHeight+"px",me.contentAlign="end",this.bottomToolbar.addButtonBlock(me);var $e=new st('',"Flip horizontal");$e.onClick=this.flipHorizontallyButtonClicked,me.addButton($e);var ct=new st('',"Flip vertical");ct.onClick=this.flipVerticallyButtonClicked,me.addButton(ct)},F.prototype.ratioButtonClicked=function(p){this.aspectRatio=p,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},F.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=$t.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},F.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new ln(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},F.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},F.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},F.prototype.restoreState=function(p){if(p){var y=this.cropLayer.getRescaledRect(p.width,p.height,this.imageWidth,this.imageHeight,p.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(y),this.cropRectChanged(y),this.flippedHorizontally=p.flippedHorizontally,this.flippedVertically=p.flippedVertically,this.applyFlip(),this.rotationAngle=p.rotationAngle,this.applyRotation()}},F.prototype.clientToLocalCoordinates=function(p,y){var M=this.cropImage.getBoundingClientRect();return{x:p-M.left,y:y-M.top}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var p=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=p+"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()},F.prototype.rotateLeftButtonClicked=function(){var p=this.rotationAngle-90;this.rotationAngle%90!=0&&(p+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(p)},F.prototype.rotateRightButtonClicked=function(){var p=this.rotationAngle+90;this.rotationAngle%90!=0&&(p-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(p)},F.prototype.rotateTo=function(p){p=(p=p>180?p-360:p)<=-180?p+360:p,this.rotationAngle=p,this.applyRotation()},F.prototype.rotateBy=function(p){this.rotateTo((this.rotationAngle+p)%360)},F.prototype.applyRotation=function(){var p=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var y=this.editingTargetRotationContainer.transform.baseVal.getItem(0);y.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(y,0);var M=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/M.width,this.imageHeight/M.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=p},F.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},F.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},F.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},F.prototype.startRenderAndClose=function(){return Bt(this,void 0,void 0,function(){var p,y;return an(this,function(M){switch(M.label){case 0:return[4,this.render()];case 1:return p=M.sent(),y=this.getState(),this.renderEventListeners.forEach(function(Q){return Q(p,y)}),this.close(!0),[2]}})})},F.prototype.render=function(){return Bt(this,void 0,void 0,function(){var p;return an(this,function(y){switch(y.label){case 0:return(p=new pt).naturalSize=this.renderAtNaturalSize,p.imageType=this.renderImageType,p.imageQuality=this.renderImageQuality,p.width=this.renderWidth,p.height=this.renderHeight,this.unzoomFromCrop(),ot.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,p.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 y.sent(),[4,p.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,y.sent()]}})})},F.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new kt("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 kt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new kt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var p=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new kt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*p)+`px;
height: `+(this.toolbarHeight-2*p)+`px;
padding: `+p+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new kt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new kt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new xt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new kt("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 kt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new kt("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 kt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*p)+`px;
padding: `+p+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new kt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},F.instanceCounter=0,F}(),wt=V("8hTe"),Hn=V.n(wt),fr=/]*>/g;function Ar(F){var p=document.createElement("div");return p.innerHTML=F,p.childNodes.length===0?"":p.childNodes[0].nodeValue}var Fn=Xe.a=function(F){var p=F.value,y=p===void 0?"":p,M=F.edit,Q=M===void 0?!1:M,W=F.className,me=F.showTextOnly,$e=F.showLines,ct=F.replaces,jt=F.zoomImg,Qe=F.hasMask,Vt=F.style,hn=Vt===void 0?{}:Vt,Rn=F.stylesPrev,pr=Rn===void 0?{}:Rn,qn=String(y),xn=Object(L.useRef)(),Rr=Object(L.useRef)(),qr=Object(L.useState)(""),Vn=Object(K.a)(qr,2),_t=Vn[0],Te=Vn[1],it=Object(L.useState)("office"),Ht=Object(K.a)(it,2),Ot=Ht[0],Nt=Ht[1],Xt=function(){var mn=new Ge(Rr.current);mn.displayMode="popup",mn.addRenderEventListener(function(){var Ln=Object(I.a)(O.a.mark(function en(Un){var _n;return O.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:return xn.current.style.display="none",ar.next=3,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Un}});case 3:_n=ar.sent,_n!=null&&_n.id&&ct(Rr.current.getAttribute("src").replace(ce.a.API_SERVER,""),"/api/attachments/".concat(_n==null?void 0:_n.id,"?type=").concat(_n.content_type));case 5:case"end":return ar.stop()}},en)}));return function(en){return Ln.apply(this,arguments)}}()),mn.show()},Pn=function(){var mn=new Je(Rr.current);mn.settings.displayMode="popup",mn.addEventListener("render",function(){var Ln=Object(I.a)(O.a.mark(function en(Un){var _n;return O.a.wrap(function(ar){for(;;)switch(ar.prev=ar.next){case 0:if(xn.current.style.display="none",!Rr.current){ar.next=6;break}return ar.next=4,Object(Ce.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Un.dataUrl}});case 4:_n=ar.sent,_n!=null&&_n.id&&ct(Rr.current.getAttribute("src").replace(ce.a.API_SERVER,""),"/api/attachments/".concat(_n==null?void 0:_n.id,"?type=").concat(_n.content_type));case 6:case"end":return ar.stop()}},en)}));return function(en){return Ln.apply(this,arguments)}}()),mn.show(),window.markerArea=mn},Sn=Object(L.useMemo)(function(){xn.current&&(xn.current.style.zIndex=-1);try{var yn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,mn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ln=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;qn=qn.replace(yn,"("+ce.a.API_SERVER+"/api/attachments/").replace(mn,'"'+ce.a.API_SERVER+"/api/attachments/").replace(Ln,'"'+ce.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,`
`)}catch(mr){}var en=Z(qn),Un=b();if(qn.match(/\[TOC\]/)&&(en=en.replace("[TOC]
",u()),C()),en=en.replace(/(__special_katext_id_\d+__)/g,function(mr,ar){var gr=Un[ar],fi=gr.type,Jr=gr.expression;return Object(pe.renderToString)(Ar(Jr)||"",{displayMode:fi==="block",throwOnError:!1,output:"html"})}),en=en.replace(/▁/g,"\u2581\u2581\u2581"),g(),me){var _n=document.createElement("div");return _n.innerHTML=en,_n.innerText}return setTimeout(function(){return Kn()},500),en},[qn]),un=Object(L.useRef)();v.WebkitLineClamp=$e,$e&&(hn=Object(U.a)(Object(U.a)({},hn),v));function jn(yn){var mn=yn.target;if(mn.tagName.toUpperCase()==="IMG"){if(jt){var Ln=mn.getAttribute("src");Te(Ln),Nt("image")}}else if(mn.tagName.toUpperCase()==="A"){var en=mn.getAttribute("href");if(en.indexOf("office")>-1)yn.preventDefault(),Te(en),Nt("office");else if(en.indexOf("application/pdf")>-1)yn.preventDefault(),Te(en),Nt("pdf");else if(en.indexOf("text/html")>-1)yn.preventDefault(),Te(en),Nt("html");else if(en.startsWith("#")){yn.preventDefault();var Un=document.getElementById(en.replace("#",""));Un&&Un.scrollIntoView(!0)}}}var Kn=function(){var mn,Ln=(mn=un.current)===null||mn===void 0?void 0:mn.querySelectorAll("video");Ln==null||Ln.forEach(function(en){if(en.oncontextmenu=function(){return!1},en.src.indexOf(".m3u8")>-1&&!en.canPlayType("application/vnd.apple.mpegurl")){if(te.a.isSupported()){var Un=new te.a;Un.loadSource(en.src),Un.attachMedia(en)}}})};Object(L.useEffect)(function(){if(un.current&&Sn&&(Sn.match(fr)&&window.PR.prettyPrint()),un.current)return un.current.addEventListener("click",jn),function(){un.current.removeEventListener("click",jn),g(),C()}},[Sn,un.current,jn]);var ir=function(mn){if(!Q)return;mn.target.nodeName==="IMG"?(xn.current.style.zIndex=1,xn.current.style.display="flex",xn.current.style.width=mn.target.clientWidth+"px",xn.current.style.height=mn.target.clientHeight+"px",xn.current.style.top=mn.target.offsetTop+"px",xn.current.style.left=mn.target.offsetLeft+"px",Rr.current.src=mn.target.getAttribute("src")):xn.current.style.display="none"};return x.a.createElement("div",{style:{position:"relative"}},x.a.createElement("div",{ref:un,style:Object(U.a)({},hn),className:"".concat(W||""," markdown-body ").concat(Hn.a.mdBody),onMouseOver:ir,dangerouslySetInnerHTML:{__html:Sn}}),x.a.createElement("div",{ref:xn,className:Hn.a.button},x.a.createElement(Y.a,null,x.a.createElement($.a,{onClick:function(){return Xt()}},"\u88C1\u526A"),x.a.createElement($.a,{onClick:function(){return Pn()}},"\u7F16\u8F91"))),x.a.createElement("img",{ref:Rr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),x.a.createElement(ye.a,{close:!0,data:_t,type:_t!=null&&_t.length?Ot:"",style:Object(U.a)({},pr),onClose:function(){return Te("")}}))}},"9VGf":function(at,Xe,V){"use strict";V.d(Xe,"a",function(){return P});var oe=V("q1tI"),Y=V.n(oe);function P($,U){var I=Object(oe.useRef)();Object(oe.useEffect)(function(){I.current=$}),Object(oe.useEffect)(function(){function K(){I.current()}if(U!==null){var N=setInterval(K,U);return function(){return clearInterval(N)}}},[U])}},"A+k2":function(at,Xe,V){at.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K:function(at,Xe,V){(function(oe){oe(V("VrN/"),V("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(O,L,x){if(x!=oe.Init&&x&&O.removeKeyMap("autoCloseTags"),!L)return;var A={name:"autoCloseTags"};(typeof L!="object"||L.whenClosing!==!1)&&(A["'/'"]=function(D){return I(D)}),(typeof L!="object"||L.whenOpening!==!1)&&(A["'>'"]=function(D){return $(D)}),O.addKeyMap(A)});var Y=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["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 $(O){if(O.getOption("disableInput"))return oe.Pass;for(var L=O.listSelections(),x=[],A=O.getOption("autoCloseTags"),D=0;Dw.ch&&(i=i.slice(0,i.length-S.end+w.ch));var m=i.toLowerCase();if(!i||S.type=="string"&&(S.end!=w.ch||!/[\"\']/.test(S.string.charAt(S.string.length-1))||S.string.length==1)||S.type=="tag"&&l.close||S.string.indexOf("/")==w.ch-S.start-1||C&&K(C,m)>-1||N(O,T.mode.xmlCurrentContext&&T.mode.xmlCurrentContext(h)||[],i,w,!0))return oe.Pass;var u=typeof A=="object"&&A.emptyTags;if(u&&K(u,i)>-1){x[D]={text:"/>",newPos:oe.Pos(w.line,w.ch+2)};continue}var E=v&&K(v,m)>-1;x[D]={indent:E,text:">"+(E?`
`:"")+""+i+">",newPos:E?oe.Pos(w.line+1,0):oe.Pos(w.line,w.ch+1)}}for(var d=typeof A=="object"&&A.dontIndentOnAutoClose,D=L.length-1;D>=0;D--){var f=x[D];O.replaceRange(f.text,L[D].head,L[D].anchor,"+insert");var s=O.listSelections().slice(0);s[D]={head:f.newPos,anchor:f.newPos},O.setSelections(s),!d&&f.indent&&(O.indentLine(f.newPos.line,null,!0),O.indentLine(f.newPos.line+1,null,!0))}}function U(O,L){for(var x=O.listSelections(),A=[],D=L?"/":"",w=O.getOption("autoCloseTags"),S=typeof w=="object"&&w.dontIndentOnSlash,T=0;T"&&(C+=">"),A[T]=C}if(O.replaceSelections(A),x=O.listSelections(),!S)for(var T=0;T=0&&L[h]==x;h--)++T;A=S.to;for(var h=1;h0){for(var L=0;L1&&arguments[1]!==void 0?arguments[1]:"",L=[],x=0;xxe.length)&&(fe=xe.length);for(var be=0,ne=new Array(fe);be=xe.length?{done:!0}:{done:!1,value:xe[ne++]}}}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 be=xe[Symbol.iterator](),be.next.bind(be)}function I(xe,fe){return fe={exports:{}},xe(fe,fe.exports),fe.exports}var K=I(function(xe){function fe(){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 be(ne){xe.exports.defaults=ne}xe.exports={defaults:fe(),getDefaults:fe,changeDefaults:be}}),N=K.defaults,O=K.getDefaults,L=K.changeDefaults,x=/[&<>"']/,A=/[&<>"']/g,D=/[<>"']|&(?!#?\w+;)/,w=/[<>"']|&(?!#?\w+;)/g,S={"&":"&","<":"<",">":">",'"':""","'":"'"},T=function(fe){return S[fe]};function h(xe,fe){if(fe){if(x.test(xe))return xe.replace(A,T)}else if(D.test(xe))return xe.replace(w,T);return xe}var l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(xe){return xe.replace(l,function(fe,be){return be=be.toLowerCase(),be==="colon"?":":be.charAt(0)==="#"?be.charAt(1)==="x"?String.fromCharCode(parseInt(be.substring(2),16)):String.fromCharCode(+be.substring(1)):""})}var c=/(^|[^\[])\^/g;function C(xe,fe){xe=xe.source||xe,fe=fe||"";var be={replace:function(re,ae){return ae=ae.source||ae,ae=ae.replace(c,"$1"),xe=xe.replace(re,ae),be},getRegex:function(){return new RegExp(xe,fe)}};return be}var v=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function u(xe,fe,be){if(xe){var ne;try{ne=decodeURIComponent(i(be)).replace(v,"").toLowerCase()}catch(re){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}fe&&!m.test(be)&&(be=a(fe,be));try{be=encodeURI(be).replace(/%25/g,"%")}catch(re){return null}return be}var E={},d=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(xe,fe){E[" "+xe]||(d.test(xe)?E[" "+xe]=xe+"/":E[" "+xe]=k(xe,"/",!0)),xe=E[" "+xe];var be=xe.indexOf(":")===-1;return fe.substring(0,2)==="//"?be?fe:xe.replace(f,"$1")+fe:fe.charAt(0)==="/"?be?fe:xe.replace(s,"$1")+fe:xe+fe}var b={exec:function(){}};function g(xe){for(var fe=1,be,ne;fe=0&&ue[Le]==="\\";)we=!we;return we?"|":" |"}),ne=be.split(/ \|/),re=0;if(ne.length>fe)ne.splice(fe);else for(;ne.length=ne.length?re.slice(ne.length):re}).join(`
`)}var _e=function(){function xe(be){this.options=be||G}var fe=xe.prototype;return fe.space=function(ne){var re=this.rules.block.newline.exec(ne);if(re)return re[0].length>1?{type:"space",raw:re[0]}:{raw:`
`}},fe.code=function(ne,re){var ae=this.rules.block.code.exec(ne);if(ae){var de=re[re.length-1];if(de&&de.type==="paragraph")return{raw:ae[0],text:ae[0].trimRight()};var ue=ae[0].replace(/^ {4}/gm,"");return{type:"code",raw:ae[0],codeBlockStyle:"indented",text:this.options.pedantic?ue:B(ue,`
`)}}},fe.fences=function(ne){var re=this.rules.block.fences.exec(ne);if(re){var ae=re[0],de=Ce(ae,re[3]||"");return{type:"code",raw:ae,lang:re[2]?re[2].trim():re[2],text:de}}},fe.heading=function(ne){var re=this.rules.block.heading.exec(ne);if(re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},fe.nptable=function(ne){var re=this.rules.block.nptable.exec(ne);if(re){var ae={type:"table",header:te(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[],raw:re[0]};if(ae.header.length===ae.align.length){var de=ae.align.length,ue;for(ue=0;ue ?/gm,"");return{type:"blockquote",raw:re[0],text:ae}}},fe.list=function(ne){var re=this.rules.block.list.exec(ne);if(re){for(var ae=re[0],de=re[2],ue=de.length>1,we=de[de.length-1]===")",Le={type:"list",raw:ae,ordered:ue,start:ue?+de.slice(0,-1):"",loose:!1,items:[]},rt=re[0].match(this.rules.block.item),je=!1,Ye,Pt,ut,mt,zt,Je,Kt,sn=rt.length,Bt=0;Bt1||this.options.smartLists&&ut!==de)&&(mt=rt.slice(Bt+1).join(`
`),Le.raw=Le.raw.substring(0,Le.raw.length-mt.length),Bt=sn-1)),zt=je||/\n\n(?!\s*$)/.test(Ye),Bt!==sn-1&&(je=Ye.charAt(Ye.length-1)===`
`,zt||(zt=je)),zt&&(Le.loose=!0),Je=/^\[[ xX]\] /.test(Ye),Kt=void 0,Je&&(Kt=Ye[1]!==" ",Ye=Ye.replace(/^\[[ xX]\] +/,"")),Le.items.push({type:"list_item",raw:ae,task:Je,checked:Kt,loose:zt,text:Ye});return Le}},fe.html=function(ne){var re=this.rules.block.html.exec(ne);if(re)return{type:this.options.sanitize?"paragraph":"html",raw:re[0],pre:!this.options.sanitizer&&(re[1]==="pre"||re[1]==="script"||re[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(re[0]):ce(re[0]):re[0]}},fe.def=function(ne){var re=this.rules.block.def.exec(ne);if(re){re[3]&&(re[3]=re[3].substring(1,re[3].length-1));var ae=re[1].toLowerCase().replace(/\s+/g," ");return{tag:ae,raw:re[0],href:re[2],title:re[3]}}},fe.table=function(ne){var re=this.rules.block.table.exec(ne);if(re){var ae={type:"table",header:te(re[1].replace(/^ *| *\| *$/g,"")),align:re[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:re[3]?re[3].replace(/\n$/,"").split(`
`):[]};if(ae.header.length===ae.align.length){ae.raw=re[0];var de=ae.align.length,ue;for(ue=0;ue/i.test(de[0])&&(re=!1),!ae&&/^<(pre|code|kbd|script)(\s|>)/i.test(de[0])?ae=!0:ae&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(de[0])&&(ae=!1),{type:this.options.sanitize?"text":"html",raw:de[0],inLink:re,inRawBlock:ae,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ce(de[0]):de[0]}},fe.link=function(ne){var re=this.rules.inline.link.exec(ne);if(re){var ae=pe(re[2],"()");if(ae>-1){var de=re[0].indexOf("!")===0?5:4,ue=de+re[1].length+ae;re[2]=re[2].substring(0,ae),re[0]=re[0].substring(0,ue).trim(),re[3]=""}var we=re[2],Le="";if(this.options.pedantic){var rt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);rt?(we=rt[1],Le=rt[3]):Le=""}else Le=re[3]?re[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var je=ye(re,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Le&&Le.replace(this.rules.inline._escapes,"$1")},re[0]);return je}},fe.reflink=function(ne,re){var ae;if((ae=this.rules.inline.reflink.exec(ne))||(ae=this.rules.inline.nolink.exec(ne))){var de=(ae[2]||ae[1]).replace(/\s+/g," ");if(de=re[de.toLowerCase()],!de||!de.href){var ue=ae[0].charAt(0);return{type:"text",raw:ue,text:ue}}var we=ye(ae,de,ae[0]);return we}},fe.strong=function(ne,re,ae){ae===void 0&&(ae="");var de=this.rules.inline.strong.start.exec(ne);if(de&&(!de[1]||de[1]&&(ae===""||this.rules.inline.punctuation.exec(ae)))){re=re.slice(-1*ne.length);var ue=de[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ue.lastIndex=0;for(var we;(de=ue.exec(re))!=null;)if(we=this.rules.inline.strong.middle.exec(re.slice(0,de.index+3)),we)return{type:"strong",raw:ne.slice(0,we[0].length),text:ne.slice(2,we[0].length-2)}}},fe.em=function(ne,re,ae){ae===void 0&&(ae="");var de=this.rules.inline.em.start.exec(ne);if(de&&(!de[1]||de[1]&&(ae===""||this.rules.inline.punctuation.exec(ae)))){re=re.slice(-1*ne.length);var ue=de[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ue.lastIndex=0;for(var we;(de=ue.exec(re))!=null;)if(we=this.rules.inline.em.middle.exec(re.slice(0,de.index+2)),we)return{type:"em",raw:ne.slice(0,we[0].length),text:ne.slice(1,we[0].length-1)}}},fe.codespan=function(ne){var re=this.rules.inline.code.exec(ne);if(re){var ae=re[2].replace(/\n/g," "),de=/[^ ]/.test(ae),ue=ae.startsWith(" ")&&ae.endsWith(" ");return de&&ue&&(ae=ae.substring(1,ae.length-1)),ae=ce(ae,!0),{type:"codespan",raw:re[0],text:ae}}},fe.br=function(ne){var re=this.rules.inline.br.exec(ne);if(re)return{type:"br",raw:re[0]}},fe.del=function(ne){var re=this.rules.inline.del.exec(ne);if(re)return{type:"del",raw:re[0],text:re[1]}},fe.autolink=function(ne,re){var ae=this.rules.inline.autolink.exec(ne);if(ae){var de,ue;return ae[2]==="@"?(de=ce(this.options.mangle?re(ae[1]):ae[1]),ue="mailto:"+de):(de=ce(ae[1]),ue=de),{type:"link",raw:ae[0],text:de,href:ue,tokens:[{type:"text",raw:de,text:de}]}}},fe.url=function(ne,re){var ae;if(ae=this.rules.inline.url.exec(ne)){var de,ue;if(ae[2]==="@")de=ce(this.options.mangle?re(ae[0]):ae[0]),ue="mailto:"+de;else{var we;do we=ae[0],ae[0]=this.rules.inline._backpedal.exec(ae[0])[0];while(we!==ae[0]);de=ce(ae[0]),ae[1]==="www."?ue="http://"+de:ue=de}return{type:"link",raw:ae[0],text:de,href:ue,tokens:[{type:"text",raw:de,text:de}]}}},fe.inlineText=function(ne,re,ae){var de=this.rules.inline.text.exec(ne);if(de){var ue;return re?ue=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(de[0]):ce(de[0]):de[0]:ue=ce(this.options.smartypants?ae(de[0]):de[0]),{type:"text",raw:de[0],text:ue}}},xe}(),le=Z.noopTest,se=Z.edit,ge=Z.merge,ie={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*|\\n*|\\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]+/};ie._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ie._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ie.def=se(ie.def).replace("label",ie._label).replace("title",ie._title).getRegex(),ie.bullet=/(?:[*+-]|\d{1,9}[.)])/,ie.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ie.item=se(ie.item,"gm").replace(/bull/g,ie.bullet).getRegex(),ie.list=se(ie.list).replace(/bull/g,ie.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ie.def.source+")").getRegex(),ie._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",ie._comment=//,ie.html=se(ie.html,"i").replace("comment",ie._comment).replace("tag",ie._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ie.paragraph=se(ie._paragraph).replace("hr",ie.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",ie._tag).getRegex(),ie.blockquote=se(ie.blockquote).replace("paragraph",ie.paragraph).getRegex(),ie.normal=ge({},ie),ie.gfm=ge({},ie.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*|$)"}),ie.gfm.nptable=se(ie.gfm.nptable).replace("hr",ie.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",ie._tag).getRegex(),ie.gfm.table=se(ie.gfm.table).replace("hr",ie.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",ie._tag).getRegex(),ie.pedantic=ge({},ie.normal,{html:se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ie._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(ie.normal._paragraph).replace("hr",ie.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ie.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:le,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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]*?(?:(?=[\\?@\\[\\]`^{|}~",q.punctuation=se(q.punctuation).replace(/punctuation/g,q._punctuation).getRegex(),q._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",q._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",q.em.start=se(q.em.start).replace(/punctuation/g,q._punctuation).getRegex(),q.em.middle=se(q.em.middle).replace(/punctuation/g,q._punctuation).replace(/overlapSkip/g,q._overlapSkip).getRegex(),q.em.endAst=se(q.em.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.em.endUnd=se(q.em.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.start=se(q.strong.start).replace(/punctuation/g,q._punctuation).getRegex(),q.strong.middle=se(q.strong.middle).replace(/punctuation/g,q._punctuation).replace(/blockSkip/g,q._blockSkip).getRegex(),q.strong.endAst=se(q.strong.endAst,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.strong.endUnd=se(q.strong.endUnd,"g").replace(/punctuation/g,q._punctuation).getRegex(),q.blockSkip=se(q._blockSkip,"g").getRegex(),q.overlapSkip=se(q._overlapSkip,"g").getRegex(),q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,q._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])?)+(?![-_])/,q.autolink=se(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex(),q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,q.tag=se(q.tag).replace("comment",ie._comment).replace("attribute",q._attribute).getRegex(),q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,q.link=se(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex(),q.reflink=se(q.reflink).replace("label",q._label).getRegex(),q.reflinkSearch=se(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex(),q.normal=ge({},q),q.pedantic=ge({},q.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",q._label).getRegex(),reflink:se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()}),q.gfm=ge({},q.normal,{escape:se(q.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]*?(?:(?=[\\.5&&(ne="x"+ne.toString(16)),fe+=""+ne+";";return fe}var De=function(){function xe(be){this.tokens=[],this.tokens.links=Object.create(null),this.options=be||Me,this.options.tokenizer=this.options.tokenizer||new _e,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:Ne.normal,inline:Pe.normal};this.options.pedantic?(ne.block=Ne.pedantic,ne.inline=Pe.pedantic):this.options.gfm&&(ne.block=Ne.gfm,this.options.breaks?ne.inline=Pe.breaks:ne.inline=Pe.gfm),this.tokenizer.rules=ne}xe.lex=function(ne,re){var ae=new xe(re);return ae.lex(ne)};var fe=xe.prototype;return fe.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},fe.blockTokens=function(ne,re,ae){re===void 0&&(re=[]),ae===void 0&&(ae=!0),ne=ne.replace(/^ +$/gm,"");for(var de,ue,we,Le;ne;){if(de=this.tokenizer.space(ne)){ne=ne.substring(de.raw.length),de.type&&re.push(de);continue}if(de=this.tokenizer.code(ne,re)){ne=ne.substring(de.raw.length),de.type?re.push(de):(Le=re[re.length-1],Le.raw+=`
`+de.raw,Le.text+=`
`+de.text);continue}if(de=this.tokenizer.fences(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.heading(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.nptable(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.hr(ne)){ne=ne.substring(de.raw.length),re.push(de);continue}if(de=this.tokenizer.blockquote(ne)){ne=ne.substring(de.raw.length),de.tokens=this.blockTokens(de.text,[],ae),re.push(de);continue}if(de=this.tokenizer.list(ne)){for(ne=ne.substring(de.raw.length),we=de.items.length,ue=0;ue0)for(;(rt=this.tokenizer.rules.inline.reflinkSearch.exec(Le))!=null;)je.includes(rt[0].slice(rt[0].lastIndexOf("[")+1,-1))&&(Le=Le.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(rt=this.tokenizer.rules.inline.blockSkip.exec(Le))!=null;)Le=Le.slice(0,rt.index)+"["+"a".repeat(rt[0].length-2)+"]"+Le.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(we=this.tokenizer.escape(ne)){ne=ne.substring(we.raw.length),re.push(we);continue}if(we=this.tokenizer.tag(ne,ae,de)){ne=ne.substring(we.raw.length),ae=we.inLink,de=we.inRawBlock,re.push(we);continue}if(we=this.tokenizer.link(ne)){ne=ne.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,de)),re.push(we);continue}if(we=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,de)),re.push(we);continue}if(we=this.tokenizer.strong(ne,Le,ue)){ne=ne.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],ae,de),re.push(we);continue}if(we=this.tokenizer.em(ne,Le,ue)){ne=ne.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],ae,de),re.push(we);continue}if(we=this.tokenizer.codespan(ne)){ne=ne.substring(we.raw.length),re.push(we);continue}if(we=this.tokenizer.br(ne)){ne=ne.substring(we.raw.length),re.push(we);continue}if(we=this.tokenizer.del(ne)){ne=ne.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],ae,de),re.push(we);continue}if(we=this.tokenizer.autolink(ne,Ae)){ne=ne.substring(we.raw.length),re.push(we);continue}if(!ae&&(we=this.tokenizer.url(ne,Ae))){ne=ne.substring(we.raw.length),re.push(we);continue}if(we=this.tokenizer.inlineText(ne,de,Be)){ne=ne.substring(we.raw.length),ue=we.raw.slice(-1),re.push(we);continue}if(ne){var Ye="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(Ye);break}else throw new Error(Ye)}}return re},Y(xe,null,[{key:"rules",get:function(){return{block:Ne,inline:Pe}}}]),xe}(),Fe=K.defaults,ze=Z.cleanUrl,qe=Z.escape,He=function(){function xe(be){this.options=be||Fe}var fe=xe.prototype;return fe.code=function(ne,re,ae){var de=(re||"").match(/\S*/)[0];if(this.options.highlight){var ue=this.options.highlight(ne,de);ue!=null&&ue!==ne&&(ae=!0,ne=ue)}return de?''+(ae?ne:qe(ne,!0))+`
`:""+(ae?ne:qe(ne,!0))+`
`},fe.blockquote=function(ne){return`
`+ne+`
`},fe.html=function(ne){return ne},fe.heading=function(ne,re,ae,de){return this.options.headerIds?"
`:""+ne+"
`},fe.hr=function(){return this.options.xhtml?`
`:`
`},fe.list=function(ne,re,ae){var de=re?"ol":"ul",ue=re&&ae!==1?' start="'+ae+'"':"";return"<"+de+ue+`>
`+ne+""+de+`>
`},fe.listitem=function(ne){return""+ne+`
`},fe.checkbox=function(ne){return" "},fe.paragraph=function(ne){return""+ne+`
`},fe.table=function(ne,re){return re&&(re=""+re+""),`
`},fe.tablerow=function(ne){return`
`+ne+`
`},fe.tablecell=function(ne,re){var ae=re.header?"th":"td",de=re.align?"<"+ae+' align="'+re.align+'">':"<"+ae+">";return de+ne+""+ae+`>
`},fe.strong=function(ne){return""+ne+""},fe.em=function(ne){return""+ne+""},fe.codespan=function(ne){return""+ne+""},fe.br=function(){return this.options.xhtml?"
":"
"},fe.del=function(ne){return""+ne+""},fe.link=function(ne,re,ae){if(ne=ze(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ae;var de='"+ae+"",de},fe.image=function(ne,re,ae){if(ne=ze(this.options.sanitize,this.options.baseUrl,ne),ne===null)return ae;var de='
":">",de},fe.text=function(ne){return ne},xe}(),Oe=function(){function xe(){}var fe=xe.prototype;return fe.strong=function(ne){return ne},fe.em=function(ne){return ne},fe.codespan=function(ne){return ne},fe.del=function(ne){return ne},fe.html=function(ne){return ne},fe.text=function(ne){return ne},fe.link=function(ne,re,ae){return""+ae},fe.image=function(ne,re,ae){return""+ae},fe.br=function(){return""},xe}(),lt=function(){function xe(){this.seen={}}var fe=xe.prototype;return fe.slug=function(ne){var re=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(re)){var ae=re;do this.seen[ae]++,re=ae+"-"+this.seen[ae];while(this.seen.hasOwnProperty(re))}return this.seen[re]=0,re},xe}(),tt=K.defaults,ft=Z.unescape,nt=function(){function xe(be){this.options=be||tt,this.options.renderer=this.options.renderer||new He,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Oe,this.slugger=new lt}xe.parse=function(ne,re){var ae=new xe(re);return ae.parse(ne)};var fe=xe.prototype;return fe.parse=function(ne,re){re===void 0&&(re=!0);var ae="",de,ue,we,Le,rt,je,Ye,Pt,ut,mt,zt,Je,Kt,sn,Bt,an,Qt,ot,Ft=ne.length;for(de=0;de0&&Bt.tokens[0].type==="text"?(Bt.tokens[0].text=ot+" "+Bt.tokens[0].text,Bt.tokens[0].tokens&&Bt.tokens[0].tokens.length>0&&Bt.tokens[0].tokens[0].type==="text"&&(Bt.tokens[0].tokens[0].text=ot+" "+Bt.tokens[0].tokens[0].text)):Bt.tokens.unshift({type:"text",text:ot}):sn+=ot),sn+=this.parse(Bt.tokens,Kt),ut+=this.renderer.listitem(sn,Qt,an);ae+=this.renderer.list(ut,zt,Je);continue}case"html":{ae+=this.renderer.html(mt.text);continue}case"paragraph":{ae+=this.renderer.paragraph(this.parseInline(mt.tokens));continue}case"text":{for(ut=mt.tokens?this.parseInline(mt.tokens):mt.text;de+1An error occurred:
"+yt(we.message+"",!0)+"
";throw we}}Ue.options=Ue.setOptions=function(xe){return St(Ue.defaults,xe),Dt(Ue.defaults),Ue},Ue.getDefaults=ke,Ue.defaults=Tt,Ue.use=function(xe){var fe=St({},xe);if(xe.renderer&&function(){var ne=Ue.defaults.renderer||new He,re=function(ue){var we=ne[ue];ne[ue]=function(){for(var Le=arguments.length,rt=new Array(Le),je=0;jeot.length){var Lt=Object(Oe.xor)(Mt,ot);console.log(Lt,"newLevel"),It=It.filter(function(st){return!Lt.includes(st)})}rt(It),Je(ot.length===(je==null||((xt=je.tag_disciplines)===null||xt===void 0)?void 0:xt.length))},sn=function(ot){var Ft,xt=je==null||((Ft=je.tag_disciplines)===null||Ft===void 0)?void 0:Ft.map(function(kt){return kt.id});rt(ot.target.checked?Object(Oe.uniq)([].concat(Object(Z.a)(Le),Object(Z.a)(xt))):Le==null?void 0:Le.filter(function(kt){return!xt.includes(kt)})),Je(ot.target.checked)};console.log(je,"options");var Bt=function(){var ot,Ft,xt=(je==null?void 0:je.tag_disciplines)||[];if(Ye){var kt;xt=(kt=xt)===null||kt===void 0?void 0:kt.filter(function(Mt){var It;return Mt==null||((It=Mt.name)===null||It===void 0)?void 0:It.includes(Ye)})}return xt=(ot=xt)===null||ot===void 0?void 0:ot.map(function(Mt){return Object(L.a)(Object(L.a)({},Mt),{},{label:"".concat(Mt.name,"(".concat(Mt==null?void 0:Mt.item_count,")")),value:Mt.id})}),xt=(Ft=xt)===null||Ft===void 0?void 0:Ft.filter(function(Mt){return Mt.item_count!==0}),xt},an=function(){var ot=!1;if(!Ye)ot=!0;else{var Ft;(Ft=je.tag_disciplines)===null||Ft===void 0||Ft.forEach(function(xt){if(!ot){var kt;ot=((kt=xt.name)===null||kt===void 0?void 0:kt.includes(Ye))&&xt.item_count!==0}})}return ot};return(je==null?void 0:je.item_count)===0||!an()?i.a.createElement(i.a.Fragment,null):i.a.createElement("div",{className:He.a.cInput},i.a.createElement("div",{className:He.a.cl},i.a.createElement(g.a,{checked:zt,onChange:sn},i.a.createElement("span",{className:He.a.box},i.a.createElement("span",{className:"font14 c-light-primary"},i.a.createElement("span",{title:je==null?void 0:je.name,className:He.a.box1}," ",je==null?void 0:je.name),i.a.createElement("span",null," ","(".concat(je==null?void 0:je.item_count,")"))),i.a.createElement("i",{className:"iconfont icon-lujing font12 ml5"})))),i.a.createElement("div",{className:He.a.cr},i.a.createElement(lt,{options:Bt(),value:Le,onChange:Kt})))},ft=tt,nt=V("ErOA"),St=V("ozfa"),ht=V("MJZm"),yt=V("0Owb"),ke=V("tmPe"),Dt=V.n(ke),Tt=function(ue){var we=ue.value,Le=ue.onChange,rt=ue.defaultValue,je=ue.treeData,Ye=je===void 0?[]:je,Pt=Object(ze.a)(ue,["value","onChange","defaultValue","treeData"]);return i.a.createElement("div",{className:Dt.a.customTree},i.a.createElement(ht.a,Object(yt.a)({multiple:!0,showIcon:!0,selectedKeys:we,defaultExpandedKeys:rt,treeData:Ye,onSelect:Le},Pt)))},Ue=Tt,Ze=V("sbIO"),xe=S.a.Search,fe=function(ue){var we,Le=ue.formValue,rt=ue.setFatherTabs,je=ue.tabs,Ye=ue.editData,Pt=ue.dispatch,ut=Object(c.i)().id,mt=Object(l.useState)(["mine"]),zt=Object(D.a)(mt,2),Je=zt[0],Kt=zt[1],sn=Object(l.useState)(!0),Bt=Object(D.a)(sn,2),an=Bt[0],Qt=Bt[1],ot=Object(l.useState)(!1),Ft=Object(D.a)(ot,2),xt=Ft[0],kt=Ft[1],Mt=Object(l.useState)(!1),It=Object(D.a)(Mt,2),Lt=It[0],st=It[1],Ve=Object(l.useState)(""),ln=Object(D.a)(Ve,2),$t=ln[0],cn=ln[1],qt=Object(l.useState)(!1),En=Object(D.a)(qt,2),on=En[0],pt=En[1],Ge=Object(l.useState)(!1),wt=Object(D.a)(Ge,2),Hn=wt[0],fr=wt[1],Ar=Object(l.useState)({}),Fn=Object(D.a)(Ar,2),F=Fn[0],p=Fn[1],y=Object(l.useState)([]),M=Object(D.a)(y,2),Q=M[0],W=M[1],me=Object(l.useState)([]),$e=Object(D.a)(me,2),ct=$e[0],jt=$e[1],Qe=Object(l.useState)([]),Vt=Object(D.a)(Qe,2),hn=Vt[0],Rn=Vt[1],pr=Object(l.useState)([]),qn=Object(D.a)(pr,2),xn=qn[0],Rr=qn[1],qr=Object(l.useState)(null),Vn=Object(D.a)(qr,2),_t=Vn[0],Te=Vn[1],it=Object(l.useRef)([]),Ht=Object(l.useState)(!1),Ot=Object(D.a)(Ht,2),Nt=Ot[0],Xt=Ot[1],Pn=Object(l.useState)([]),Sn=Object(D.a)(Pn,2),un=Sn[0],jn=Sn[1],Kn=Object(l.useState)([0]),ir=Object(D.a)(Kn,2),yn=ir[0],mn=ir[1],Ln=Object(l.useState)([]),en=Object(D.a)(Ln,2),Un=en[0],_n=en[1],mr=Object(l.useRef)([]),ar=Object(l.useState)(!1),gr=Object(D.a)(ar,2),fi=gr[0],Jr=gr[1],Ti=Object(l.useState)([]),ei=Object(D.a)(Ti,2),On=ei[0],ti=ei[1],Xr=Object(l.useState)([]),pi=Object(D.a)(Xr,2),ni=pi[0],ui=pi[1],si=Object(l.useRef)([]),Gt=Object(l.useState)([]),nn=Object(D.a)(Gt,2),Jt=nn[0],fn=nn[1],bn=Object(l.useState)(!1),kn=Object(D.a)(bn,2),vn=kn[0],er=kn[1],vr=Object(l.useRef)([]),gn=Object(l.useState)(0),Qr=Object(D.a)(gn,2),Tn=Qr[0],or=Qr[1],tr=Un==null?void 0:Un.filter(function(bt){return un==null?void 0:un.includes(bt.id)}),Gr=ni==null?void 0:ni.filter(function(bt){return On==null?void 0:On.includes(bt.id)});Object(l.useEffect)(function(){wi()},[]),Object(l.useEffect)(function(){return je===1&&(Pt({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Pt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){Pt({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Pt({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}},[je]),Object(l.useEffect)(function(){ut?Ye&&cr():(Fi(Je),mi(),Qt(!1))},[Ye]),Object(l.useEffect)(function(){$t&&Ja()},[$t]);var Ja=function(){var dt=null;ct==null||ct.forEach(function(We){var Ie;(Ie=We.sub_disciplines)===null||Ie===void 0||Ie.forEach(function(Et){var vt;(vt=Et.tag_disciplines)===null||vt===void 0||vt.forEach(function(Ct){var Zt,dn=((Zt=Ct.name)===null||Zt===void 0?void 0:Zt.includes($t))&&Ct.item_count!==0;dn&&!dt&&(dt=We.id)})})}),dt&&Te(dt)},Qa=function(dt){function We(Ie){var Et=Ie.children,vt=Array.isArray(Et)&&Et.length>0,Ct=Ie==null?void 0:Ie.group_id;return vr.current.push({name:Ie==null?void 0:Ie.name,id:Ct,count:Ie==null?void 0:Ie.count}),{title:i.a.createElement("div",{title:Ie==null?void 0:Ie.name,className:B.a.name},Ie==null?void 0:Ie.name,"\uFF08".concat(Ie==null?void 0:Ie.count,"\uFF09")),value:Ct,name:Ie==null?void 0:Ie.name,key:Ct,count:Ie==null?void 0:Ie.count,id:Ct,icon:i.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:vt?Et==null?void 0:Et.map(function(Zt){return We(Zt)}):[]}}return dt==null?void 0:dt.map(function(Ie){return We(Ie)})},wi=function(){var bt=Object(O.a)(h.a.mark(function dt(){var We,Ie;return h.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return vt.next=2,Object(te.A)({});case 2:We=vt.sent,vr.current=[{id:0,name:"\u6839\u76EE\u5F55",count:We==null?void 0:We.root_count}],We!=null&&We.data&&(Ie=[{title:i.a.createElement("div",{title:"\u6839\u76EE\u5F55",className:B.a.name},"\u6839\u76EE\u5F55","\uFF08".concat((We==null?void 0:We.root_count)||0,"\uFF09")),value:0,id:0,key:0,count:We==null?void 0:We.root_count,name:"\u6839\u76EE\u5F55",icon:i.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Qa(We.data||[])}],_n(vr.current),fn(Ie));case 5:case"end":return vt.stop()}},dt)}));return function(){return bt.apply(this,arguments)}}(),cr=function(){var bt=Object(O.a)(h.a.mark(function dt(){var We,Ie,Et,vt,Ct,Zt,dn,Mn,An,In,wn,nr,Gn,zn,yr,sr,Qn,br;return h.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return In=Ye==null||((We=Ye.tag_disciplines)===null||We===void 0)?void 0:We.map(function(Cn){return Cn.tag_discipline_id}),wn=Ye==null||((Ie=Ye.groups)===null||Ie===void 0)?void 0:Ie.map(function(Cn){return Cn.id}),nr={source:Ye==null||((Et=Ye.examination_bank)===null||Et===void 0)?void 0:Et.source,group_ids:wn,tag_discipline_ids:In,teach_group_ids:Ye==null?void 0:Ye.teach_group_ids},rn.next=5,Object(nt.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:nr});case 5:if(Gn=rn.sent,!((Gn==null?void 0:Gn.status)===-1)){rn.next=8;break}return rn.abrupt("return");case 8:zn=Gn==null?void 0:Gn.filter(function(Cn){var Yn;return!!(Cn!=null&&(Yn=Cn.item_banks)!==null&&Yn!==void 0&&Yn.length)}),zn=zn.map(function(Cn){return Object(L.a)(Object(L.a)({},Cn),{},{scoreTotal:0,score:0,questionTotal:0})}),zn=(vt=zn)===null||vt===void 0?void 0:vt.map(function(Cn,Yn){var Er,lr,Mr;return Object(L.a)(Object(L.a)({},Cn),{},{score:(Ye==null||((Er=Ye.score_settings)===null||Er===void 0||((lr=Er.find(function(Ir){return Ir.item_type===(Cn==null?void 0:Cn.item_type)}))===null||lr===void 0))?void 0:lr.score)||0,item_banks:Cn==null||((Mr=Cn.item_banks)===null||Mr===void 0)?void 0:Mr.map(function(Ir){var Bn;return Object(L.a)(Object(L.a)({},Ir),{},{tag_disciplines:Ir==null||((Bn=Ir.tag_disciplines)===null||Bn===void 0)?void 0:Bn.map(function(Xn){var xr;return Object(L.a)(Object(L.a)({},Xn),{},{difficulties:Xn==null||((xr=Xn.difficulties)===null||xr===void 0)?void 0:xr.map(function(Dr){var _r=Ye==null?void 0:Ye.contents.find(function(Br){return Br.item_type===Cn.item_type&&Br.sub_discipline_id===Ir.sub_discipline_id&&Br.tag_discipline_id===Xn.tag_discipline_id&&Br.difficulty===Dr.difficulty});return _r?Object(L.a)(Object(L.a)({},Dr),{},{num:_r==null?void 0:_r.quanlity}):Object(L.a)({},Dr)})})})})})})}),yr=Ai(zn),sr=yr.panel,Qn=yr.score_num_item,zn=(Ct=zn)===null||Ct===void 0?void 0:Ct.map(function(Cn,Yn){var Er,lr=(sr==null||((Er=sr[Yn])===null||Er===void 0)?void 0:Er.reduce(function(Mr,Ir){return Mr+Ir},0))||0;return Object(L.a)(Object(L.a)({},Cn),{},{scoreTotal:lr*(Qn[Yn]||0),questionTotal:lr})}),br=[],Ye==null||((Zt=Ye.sort_by_item_type)===null||Zt===void 0)||Zt.forEach(function(Cn){var Yn=zn.find(function(Er){var lr,Mr=(lr=Ri.find(function(Ir){return Ir.type===(Er==null?void 0:Er.item_type)}))===null||lr===void 0?void 0:lr.name;return Mr===Cn});br.push(Yn)}),br=Object(Oe.compact)(br),Fi(Ye==null||((dn=Ye.examination_bank)===null||dn===void 0)?void 0:dn.source),mi(),Kt(Ye==null||((Mn=Ye.examination_bank)===null||Mn===void 0)?void 0:Mn.source),Rr(In),it.current=In,jn(wn),ti((Ye==null?void 0:Ye.teach_group_ids)||[]),or(Ye==null||((An=Ye.groups)===null||An===void 0)?void 0:An.map(function(Cn){return Cn.count}).reduce(function(Cn,Yn){return Cn+Yn},0)),mr.current=wn,mn(wn!=null&&wn.length?wn:[0]),W(Object(Oe.cloneDeep)(br)),Qt(!1);case 29:case"end":return rn.stop()}},dt)}));return function(){return bt.apply(this,arguments)}}(),Za=function(){var bt=Object(O.a)(h.a.mark(function dt(){var We;return h.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:We={source:Je,group_ids:un,tag_discipline_ids:xn,teach_group_ids:On},di(We),it.current=xn,pt(!1);case 4:case"end":return Et.stop()}},dt)}));return function(){return bt.apply(this,arguments)}}(),Fi=function(){var bt=Object(O.a)(h.a.mark(function dt(We){var Ie,Et,vt,Ct,Zt,dn;return h.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:return An.next=2,Object(nt.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:We}});case 2:vt=An.sent,Ct=[],vt==null||((Ie=vt.disciplines)===null||Ie===void 0)||Ie.forEach(function(In){var wn;In==null||((wn=In.sub_disciplines)===null||wn===void 0)||wn.forEach(function(nr){Ct=Ct.concat((nr==null?void 0:nr.tag_disciplines)||[])})}),Zt=null,dn=vt==null||((Et=vt.disciplines)===null||Et===void 0)?void 0:Et.map(function(In){var wn,nr=In==null||((wn=In.sub_disciplines)===null||wn===void 0)?void 0:wn.reduce(function(Gn,zn){return Gn+zn.item_count},0);return!Zt&&nr!==0&&(Zt=In.id),Object(L.a)(Object(L.a)({},In),{},{item_count:nr})}),console.log(dn,48767874),jt(dn),Rn(Ct),Te(Zt);case 11:case"end":return An.stop()}},dt)}));return function(We){return bt.apply(this,arguments)}}(),mi=function(){var bt=Object(O.a)(h.a.mark(function dt(){var We;return h.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(nt.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:We=Et.sent,ui((We==null?void 0:We.groups)||[]);case 4:case"end":return Et.stop()}},dt)}));return function(){return bt.apply(this,arguments)}}(),di=function(){var bt=Object(O.a)(h.a.mark(function dt(We){var Ie,Et;return h.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return Qt(!0),Ct.next=3,Object(nt.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:We});case 3:Ie=Ct.sent,Et=Ie==null?void 0:Ie.filter(function(Zt){var dn;return!!(Zt!=null&&(dn=Zt.item_banks)!==null&&dn!==void 0&&dn.length)}),Et=Et.map(function(Zt){return Object(L.a)(Object(L.a)({},Zt),{},{scoreTotal:0,score:0,questionTotal:0})}),W(Et),Qt(!1);case 8:case"end":return Ct.stop()}},dt)}));return function(We){return bt.apply(this,arguments)}}(),wa=function(){Rr(it.current),pt(!1),cn("")},qa=function(dt){Rr(dt)},ta=function(){for(var dt=hn==null?void 0:hn.filter(function(Mn){return xn==null?void 0:xn.includes(Mn.id)}),We=Object(Z.a)(dt),Ie=0,Et=[],vt=0;vt1&&dt!==0&&(We=gi(Ie,dt,dt-1)),W(We)},ji=function(dt){var We=[],Ie=Object(Oe.cloneDeep)(Q);Ie.length>1&&dt!==Ie.length-1&&(We=gi(Ie,dt,dt+1)),W(We)},Li=function(){var bt=Object(O.a)(h.a.mark(function dt(We){var Ie,Et,vt,Ct;return h.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(vt=Object(Z.a)(Je),Je.includes(We)?vt=vt.filter(function(Mn){return Mn!==We}):vt.push(We),!(vt.length===0)){dn.next=5;break}return z.b.warn("\u8BD5\u9898\u6765\u6E90\u4E3A\u5FC5\u9009\u9879"),dn.abrupt("return");case 5:(Ie=vt)!==null&&Ie!==void 0&&Ie.includes("mine")||(jn([]),mr.current=[]),(Et=vt)!==null&&Et!==void 0&&Et.includes("teach_groups")||(ti([]),si.current=[]),Kt(vt),Fi(vt),Rr([]),it.current=[],Ct={source:vt,group_ids:mr.current,tag_discipline_ids:[],teach_group_ids:si.current},di(Ct);case 13:case"end":return dn.stop()}},dt)}));return function(We){return bt.apply(this,arguments)}}(),La=function(dt){var We={1:"\u4E00",2:"\u4E8C",3:"\u4E09",4:"\u56DB",5:"\u4E94",6:"\u516D",7:"\u4E03"};if(!dt)return;var Ie=dt||{},Et=Ie.exam,vt=Ie.single_questions,Ct=Ie.multiple_questions,Zt=Ie.judgement_questions,dn=Ie.program_questions,Mn=Ie.completion_questions,An=Ie.subjective_questions,In=Ie.practical_questions,wn=Ie.combination_questions,nr=[Object(L.a)({type:"SINGLE",name:"\u5355\u9009\u9898"},vt),Object(L.a)({type:"MULTIPLE",name:"\u591A\u9009\u9898"},Ct),Object(L.a)({type:"COMPLETION",name:"\u586B\u7A7A\u9898"},Mn),Object(L.a)({type:"JUDGMENT",name:"\u5224\u65AD\u9898"},Zt),Object(L.a)({type:"SUBJECTIVE",name:"\u7B80\u7B54\u9898"},An),Object(L.a)({type:"PROGRAM",name:"\u7F16\u7A0B\u9898"},dn),Object(L.a)({type:"PRACTICAL",name:"\u5B9E\u8BAD\u9898"},In),Object(L.a)({type:"COMBINATION",name:"\u7EC4\u5408\u9898"},wn)],Gn=[],zn=0,yr=0,sr=nr.filter(function(Qn){return Qn.questions_count>0}).map(function(Qn,br){var kr;return(kr=Qn.questions)===null||kr===void 0||kr.forEach(function(rn){Gn.push(rn.id),zn=zn+rn.score,yr=yr+1}),Object(L.a)(Object(L.a)({},Qn),{number:We[br+1]})});return{all_questions_count:yr,all_score:zn,questionList:sr,ids:Gn,exam:Et}},Zr=function(dt){var We,Ie,Et=Object(Oe.cloneDeep)(F),vt=Object(Oe.cloneDeep)(Q);Et.questionList=Et==null||((We=Et.questionList)===null||We===void 0)?void 0:We.map(function(Ct){return Ct.type===dt.type?Object(L.a)(Object(L.a)({},Ct),{},{questions_score:dt.scoreTotal}):Ct}),vt=(Ie=vt)===null||Ie===void 0?void 0:Ie.map(function(Ct){return Ct.item_type===dt.type?Object(L.a)(Object(L.a)({},Ct),{},{score:dt.score,scoreTotal:dt.scoreTotal}):Ct}),W(vt),p(Et),console.log(dt,F,Q)},ii=ct==null||((we=ct.find(function(bt){return bt.id===_t}))===null||we===void 0)?void 0:we.sub_disciplines,Di=ta();return Hn?i.a.createElement(Ze.a,{loading:xt,submit:Ra,goBack:function(){return fr(!1)},data:F,onTypeScore:Zr,onExchange:na}):i.a.createElement("section",{className:B.a.wrap,style:{display:je?"flex":"none"}},i.a.createElement("div",{id:"id_left",className:B.a.left,onMouseEnter:function(dt){var We=document.getElementById("id_left");We.style.overflowY="auto"},onMouseLeave:function(dt){var We=document.getElementById("id_left");We.style.overflowY="hidden"}},i.a.createElement(Y.a,{loading:an,active:!0,paragraph:{rows:5}},Q.map(function(bt,dt){var We;return i.a.createElement("div",{className:B.a.list,key:dt},i.a.createElement("div",{className:B.a.name},i.a.createElement("b",null),i.a.createElement("span",null,(We=Ri.find(function(Ie){return Ie.type===(bt==null?void 0:bt.item_type)}))===null||We===void 0?void 0:We.name)),i.a.createElement("aside",null,i.a.createElement("div",null,"\u5171",i.a.createElement("span",{className:B.a.b},bt.questionTotal),"\u9898",i.a.createElement("span",{className:B.a.l},"|"),"\u5171",i.a.createElement("span",{className:B.a.r},bt.scoreTotal),"\u5206"),i.a.createElement("div",null,dt>0?i.a.createElement(k.a,{getPopupContainer:function(Et){return document.getElementById("id_left")},title:"\u4E0A\u79FB"},i.a.createElement("span",{onClick:function(){return ri(dt)},className:"mb20",style:{transform:"rotate(270deg)"}}," ",i.a.createElement("i",{className:"icon-jiantou1"}))):i.a.createElement("span",{className:"mb20",style:{transform:"rotate(270deg)",cursor:"not-allowed"}}," ",i.a.createElement("i",{className:"icon-jiantou1"})),dt"),i.a.createElement("span",{className:"current",onClick:function(){return C.d.push("/paperlibrary")}},"\u8BD5\u5377\u5E93>"),i.a.createElement("span",{style:{color:"#bebebe"}},"\u968F\u673A\u7EC4\u5377")),ut===0&&i.a.createElement(f,{value:ut,onChange:cn}),ut===0&&i.a.createElement("section",{className:m.a.oneWrap},i.a.createElement("div",{className:m.a.title},i.a.createElement("b",null),i.a.createElement("span",null,"\u57FA\u672C\u4FE1\u606F"),i.a.createElement("div",null,"STEP1")," "),i.a.createElement(A.a,{className:m.a.formWrap,form:Kt,layout:"horizontal",onValuesChange:ln},i.a.createElement(A.a.Item,{label:"\u8BD5\u5377\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^(?!(\s+$))/,message:"\u8F93\u5165\u6846\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C"}]},i.a.createElement(S.a,{className:m.a.in,bordered:!1,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0\uFF0C\u6700\u591A60\u4E2A\u5B57",maxLength:60})),i.a.createElement("div",{style:{position:"relative"}},i.a.createElement(A.a.Item,{label:"\u7B54\u9898\u65F6\u957F:",name:"time",rules:[{required:!0,message:"\u7B54\u9898\u65F6\u957F\u4E0D\u80FD\u4E3A\u7A7A"}]},i.a.createElement(N.a,{min:1,parser:qt,max:9999,placeholder:"\u8BF7\u8F93\u5165\u7B54\u9898\u65F6\u957F",style:{width:190}})),i.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"\u5206\u949F")),i.a.createElement(A.a.Item,{label:"\u8BD5\u9898\u96BE\u5EA6",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},i.a.createElement(I.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},i.a.createElement(I.a.Button,{className:m.a.rb,value:1},"\u7B80\u5355"),i.a.createElement(I.a.Button,{className:m.a.rb,value:2},"\u9002\u4E2D"),i.a.createElement(I.a.Button,{className:m.a.rb,value:3},"\u56F0\u96BE"))),i.a.createElement(A.a.Item,{label:"\u8003\u8BD5\u987B\u77E5",name:"exam_notes"},i.a.createElement(ne,{placeholder:"\u8003\u751F\u5FC5\u987B\u4E25\u683C\u9075\u5B88\u8003\u573A\u7EAA\u5F8B\uFF0C\u4E0D\u51C6\u5192\u540D\u9876\u66FF\uFF0C\u4E0D\u51C6\u6709\u4EFB\u4F55\u4F5C\u5F0A\u884C\u4E3A\u3002\u5982\u53D1\u73B0\u8FDD\u7EAA\uFF0C\u5E76\u7ED9\u4E88\u4E25\u5389\u5904\u5206\u3002",rows:4,maxLength:300}))),i.a.createElement("div",{className:m.a.btns},i.a.createElement($.a,{className:"mr40",onClick:function(){return C.d.push("/paperlibrary")}},"\u8FD4\u56DE"),i.a.createElement($.a,{type:"primary",onClick:Object(O.a)(h.a.mark(function En(){return h.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Kt.validateFields();case 2:mt(1);case 3:case"end":return pt.stop()}},En)}))},"\u4E0B\u4E00\u6B65"))),i.a.createElement(be,{tabs:ut,dispatch:je,editData:Lt,setFatherTabs:mt,formValue:an})))},ae=Xe.default=Object(C.a)(function(de){var ue=de.paperlibrary,we=de.user,Le=de.globalSetting;return{paperlibrary:ue,user:we,globalSetting:Le}})(re)},"E/GV":function(at,Xe,V){at.exports=V.p+"static/swenjianjia.a86ae489.svg"},ELLl:function(at,Xe,V){(function(oe){oe(V("VrN/"))})(function(oe){var Y={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},P=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(S,T,h){h&&h!=oe.Init&&(S.removeKeyMap(U),S.state.closeBrackets=null),T&&(I($(T,"pairs")),S.state.closeBrackets=T,S.addKeyMap(U))});function $(S,T){return T=="pairs"&&typeof S=="string"?S:typeof S=="object"&&S[T]!=null?S[T]:Y[T]}var U={Backspace:O,Enter:L};function I(S){for(var T=0;T=0;i--){var C=l[i].head;S.replaceRange("",P(C.line,C.ch-1),P(C.line,C.ch+1),"+delete")}}function L(S){var T=N(S),h=T&&$(T,"explode");if(!h||S.getOption("disableInput"))return oe.Pass;for(var l=S.listSelections(),i=0;i0;return{anchor:new P(S.anchor.line,S.anchor.ch+(T?-1:1)),head:new P(S.head.line,S.head.ch+(T?1:-1))}}function A(S,T){var h=N(S);if(!h||S.getOption("disableInput"))return oe.Pass;var l=$(h,"pairs"),i=l.indexOf(T);if(i==-1)return oe.Pass;for(var c=$(h,"closeBefore"),C=$(h,"triples"),v=l.charAt(i+1)==T,m=S.listSelections(),u=i%2==0,E,d=0;d=0&&S.getRange(s,P(s.line,s.ch+3))==T+T+T?a="skipThree":a="skip";else if(v&&s.ch>1&&C.indexOf(T)>=0&&S.getRange(P(s.line,s.ch-2),s)==T+T){if(s.ch>2&&/\bstring/.test(S.getTokenTypeAt(P(s.line,s.ch-2))))return oe.Pass;a="addFour"}else if(v){var g=s.ch==0?" ":S.getRange(P(s.line,s.ch-1),s);if(!oe.isWordChar(b)&&g!=T&&!oe.isWordChar(g))a="both";else return oe.Pass}else if(u&&(b.length===0||/\s/.test(b)||c.indexOf(b)>-1))a="both";else return oe.Pass;if(!E)E=a;else if(E!=a)return oe.Pass}var _=i%2?l.charAt(i-1):T,k=i%2?T:l.charAt(i+1);S.operation(function(){if(E=="skip")S.execCommand("goCharRight");else if(E=="skipThree")for(var H=0;H<3;H++)S.execCommand("goCharRight");else if(E=="surround"){for(var z=S.getSelections(),H=0;H1&&arguments[1]!==void 0?arguments[1]:1,be=Oe.length,ne=0;ne1&&arguments[1]!==void 0?arguments[1]:!1;return Object(u.a)(B).map(function(ce,pe){if(!U.isValidElement(ce)||!ce.type)return null;var ye=ce.type.isSelectOptGroup,Ce=ce.key,_e=ce.props,le=_e.children,se=Object(K.a)(_e,["children"]);return te||!ye?E(ce):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(Ce===null?pe:Ce,"__"),label:Ce},se),{},{options:d(le)})}).filter(function(ce){return ce})}var f=V("2Qr1"),s=V("qNPg"),a=V("U8pU"),b=V("Kwbf"),g=V("WKfj");function _(B){var te=B.mode,ce=B.options,pe=B.children,ye=B.backfill,Ce=B.allowClear,_e=B.placeholder,le=B.getInputElement,se=B.showSearch,ge=B.onSearch,ie=B.defaultOpen,q=B.autoFocus,Ee=B.labelInValue,Me=B.value,Ne=B.inputValue,Pe=B.optionLabelProp,Be=te==="multiple"||te==="tags",Ae=se!==void 0?se:Be||te==="combobox",De=ce||d(pe);if(Object(b.a)(te!=="tags"||De.every(function(He){return!He.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),te==="tags"||te==="combobox"){var Fe=De.some(function(He){return He.options?He.options.some(function(Oe){return typeof("value"in Oe?Oe.value:Oe.key)=="number"}):typeof("value"in He?He.value:He.key)=="number"});Object(b.a)(!Fe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(te!=="combobox"||!Pe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(te==="combobox"||!ye,"`backfill` only works with `combobox` mode."),Object(b.a)(te==="combobox"||!le,"`getInputElement` only work with `combobox` mode."),Object(b.b)(te!=="combobox"||!le||!Ce||!_e,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ge&&!Ae&&te!=="combobox"&&te!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!ie||q,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Me!=null){var ze=Object(g.d)(Me);Object(b.a)(!Ee||ze.every(function(He){return Object(a.a)(He)==="object"&&("key"in He||"value"in He)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Be||Array.isArray(Me),"`value` should be array when `mode` is `multiple` or `tags`")}if(pe){var qe=null;Object(u.a)(pe).some(function(He){if(!U.isValidElement(He)||!He.type)return!1;var Oe=He.type;if(Oe.isSelectOption)return!1;if(Oe.isSelectOptGroup){var lt=Object(u.a)(He.props.children).every(function(tt){return!U.isValidElement(tt)||!He.type||tt.type.isSelectOption?!0:(qe=tt.type,!1)});return!lt}return qe=Oe,!0}),qe&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(qe.displayName||qe.name||qe,"`.")),Object(b.a)(Ne===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var k=_,H=Object(s.a)({prefixCls:"rc-select",components:{optionList:l},convertChildrenToData:d,flattenOptions:f.d,getLabeledValue:f.e,filterOptions:f.b,isValueDisabled:f.g,findValueOption:f.c,warningProps:k,fillOptionsWithMissingValue:f.a}),z=function(B){Object(P.a)(ce,B);var te=Object($.a)(ce);function ce(){var pe;return Object(oe.a)(this,ce),pe=te.apply(this,arguments),pe.selectRef=U.createRef(),pe.focus=function(){pe.selectRef.current.focus()},pe.blur=function(){pe.selectRef.current.blur()},pe}return Object(Y.a)(ce,[{key:"render",value:function(){return U.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),ce}(U.Component);z.Option=c,z.OptGroup=v;var Z=z,G=Xe.c=Z},M8RZ:function(at,Xe,V){"use strict";V.d(Xe,"a",function(){return O});var oe=V("fWQN"),Y=V("mtLc"),P=V("yKVA"),$=V("879j"),U=V("q1tI"),I=V.n(U),K=V("i8i4"),N=V.n(K),O=function(L){Object(P.a)(A,L);var x=Object($.a)(A);function A(D){var w;Object(oe.a)(this,A),w=x.call(this,D);var S=window.document;return w.node=S.createElement("div"),S.body.appendChild(w.node),w}return Object(Y.a)(A,[{key:"render",value:function(){var w=this.props.children;return Object(K.createPortal)(w,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),A}(I.a.Component)},NvD2:function(at,Xe,V){"use strict";V.d(Xe,"a",function(){return I});var oe=V("Kwbf");function Y(K,N){var O=new Set;return K.forEach(function(L){N.has(L)||O.add(L)}),O}function P(K){var N=K||{},O=N.disabled,L=N.disableCheckbox,x=N.checkable;return!!(O||L)||x===!1}function $(K,N,O,L){for(var x=new Set(K),A=new Set,D=0;D<=O;D+=1){var w=N.get(D)||new Set;w.forEach(function(l){var i=l.key,c=l.node,C=l.children,v=C===void 0?[]:C;x.has(i)&&!L(c)&&v.filter(function(m){return!L(m.node)}).forEach(function(m){x.add(m.key)})})}for(var S=new Set,T=O;T>=0;T-=1){var h=N.get(T)||new Set;h.forEach(function(l){var i=l.parent,c=l.node;if(L(c)||!l.parent||S.has(l.parent.key))return;if(L(l.parent.node)){S.add(i.key);return}var C=!0,v=!1;(i.children||[]).filter(function(m){return!L(m.node)}).forEach(function(m){var u=m.key,E=x.has(u);C&&!E&&(C=!1),!v&&(E||A.has(u))&&(v=!0)}),C&&x.add(i.key),v&&A.add(i.key),S.add(i.key)})}return{checkedKeys:Array.from(x),halfCheckedKeys:Array.from(Y(A,x))}}function U(K,N,O,L,x){for(var A=new Set(K),D=new Set(N),w=0;w<=L;w+=1){var S=O.get(w)||new Set;S.forEach(function(i){var c=i.key,C=i.node,v=i.children,m=v===void 0?[]:v;!A.has(c)&&!D.has(c)&&!x(C)&&m.filter(function(u){return!x(u.node)}).forEach(function(u){A.delete(u.key)})})}D=new Set;for(var T=new Set,h=L;h>=0;h-=1){var l=O.get(h)||new Set;l.forEach(function(i){var c=i.parent,C=i.node;if(x(C)||!i.parent||T.has(i.parent.key))return;if(x(i.parent.node)){T.add(c.key);return}var v=!0,m=!1;(c.children||[]).filter(function(u){return!x(u.node)}).forEach(function(u){var E=u.key,d=A.has(E);v&&!d&&(v=!1),!m&&(d||D.has(E))&&(m=!0)}),v||A.delete(c.key),m&&D.add(c.key),T.add(c.key)})}return{checkedKeys:Array.from(A),halfCheckedKeys:Array.from(Y(D,A))}}function I(K,N,O,L){var x=[],A;L?A=L:A=P;var D=new Set(K.filter(function(h){var l=!!O[h];return l||x.push(h),l})),w=new Map,S=0;Object.keys(O).forEach(function(h){var l=O[h],i=l.level,c=w.get(i);c||(c=new Set,w.set(i,c)),c.add(l),S=Math.max(S,i)}),Object(oe.a)(!x.length,"Tree missing follow keys: ".concat(x.slice(0,100).map(function(h){return"'".concat(h,"'")}).join(", ")));var T;return N===!0?T=$(D,w,S,A):T=U(D,N.halfCheckedKeys,w,S,A),T}},O2Wb:function(at,Xe,V){at.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(at,Xe,V){"use strict";var oe=V("U8pU"),Y=V("VTBJ"),P=V("Ff2n"),$=V("q1tI"),U=V("uciX"),I=V("7ixt"),K=function(D){var w=D.overlay,S=D.prefixCls,T=D.id,h=D.overlayInnerStyle;return $.createElement("div",{className:"".concat(S,"-inner"),id:T,role:"tooltip",style:h},typeof w=="function"?w():w)},N=K,O=function(D,w){var S=D.overlayClassName,T=D.trigger,h=T===void 0?["hover"]:T,l=D.mouseEnterDelay,i=l===void 0?0:l,c=D.mouseLeaveDelay,C=c===void 0?.1:c,v=D.overlayStyle,m=D.prefixCls,u=m===void 0?"rc-tooltip":m,E=D.children,d=D.onVisibleChange,f=D.afterVisibleChange,s=D.transitionName,a=D.animation,b=D.placement,g=b===void 0?"right":b,_=D.align,k=_===void 0?{}:_,H=D.destroyTooltipOnHide,z=H===void 0?!1:H,Z=D.defaultVisible,G=D.getTooltipContainer,B=D.overlayInnerStyle,te=Object(P.a)(D,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ce=Object($.useRef)(null);Object($.useImperativeHandle)(w,function(){return ce.current});var pe=Object(Y.a)({},te);"visible"in D&&(pe.popupVisible=D.visible);var ye=function(){var ge=D.arrowContent,ie=ge===void 0?null:ge,q=D.overlay,Ee=D.id;return[$.createElement("div",{className:"".concat(u,"-arrow"),key:"arrow"},ie),$.createElement(N,{key:"content",prefixCls:u,id:Ee,overlay:q,overlayInnerStyle:B})]},Ce=!1,_e=!1;if(typeof z=="boolean")Ce=z;else if(z&&Object(oe.a)(z)==="object"){var le=z.keepParent;Ce=le===!0,_e=le===!1}return $.createElement(U.a,Object.assign({popupClassName:S,prefixCls:u,popup:ye,action:h,builtinPlacements:I.a,popupPlacement:g,ref:ce,popupAlign:k,getPopupContainer:G,onPopupVisibleChange:d,afterPopupVisibleChange:f,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:Z,destroyPopupOnHide:Ce,autoDestroy:_e,mouseLeaveDelay:C,popupStyle:v,mouseEnterDelay:i},pe),E)},L=Object($.forwardRef)(O),x=Xe.a=L},OZM5:function(at,Xe,V){"use strict";V.d(Xe,"b",function(){return L}),V.d(Xe,"a",function(){return x}),V.d(Xe,"k",function(){return A}),V.d(Xe,"h",function(){return D}),V.d(Xe,"i",function(){return w}),V.d(Xe,"g",function(){return S}),V.d(Xe,"c",function(){return T}),V.d(Xe,"d",function(){return h}),V.d(Xe,"j",function(){return c}),V.d(Xe,"e",function(){return C}),V.d(Xe,"f",function(){return v});var oe=V("KQm4"),Y=V("U8pU"),P=V("Ff2n"),$=V("q1tI"),U=V.n($),I=V("Kwbf"),K=V("WaYH"),N=.25,O=2;function L(m,u){var E=m.slice(),d=E.indexOf(u);return d>=0&&E.splice(d,1),E}function x(m,u){var E=m.slice();return E.indexOf(u)===-1&&E.push(u),E}function A(m){return m.split("-")}function D(m,u){return"".concat(m,"-").concat(u)}function w(m){return m&&m.type&&m.type.isTreeNode}function S(m,u){var E=[m],d=u[m];function f(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];s.forEach(function(a){var b=a.key,g=a.children;E.push(b),f(g)})}return f(d.children),E}function T(m,u){var E=m.clientY,d=u.selectHandle.getBoundingClientRect(),f=d.top,s=d.bottom,a=d.height,b=Math.max(a*N,O);return E<=f+b?-1:E>=s-b?1:0}function h(m,u){if(!m)return;var E=u.multiple;return E?m.slice():m.length?[m[0]]:m}var l=function(u){return u};function i(m,u){if(!m)return[];var E=u||{},d=E.processProps,f=d===void 0?l:d,s=Array.isArray(m)?m:[m];return s.map(function(a){var b=a.children,g=Object(P.a)(a,["children"]),_=i(b,u);return U.a.createElement(K.a,Object.assign({},f(g)),_)})}function c(m){if(!m)return null;var u;if(Array.isArray(m))u={checkedKeys:m,halfCheckedKeys:void 0};else if(Object(Y.a)(m)==="object")u={checkedKeys:m.checked||void 0,halfCheckedKeys:m.halfChecked||void 0};else return Object(I.a)(!1,"`checkedKeys` is not an array or an object"),null;return u}function C(m,u){var E=new Set;function d(f){if(E.has(f))return;var s=u[f];if(!s)return;E.add(f);var a=s.parent,b=s.node;if(b.disabled)return;a&&d(a.key)}return(m||[]).forEach(function(f){d(f)}),Object(oe.a)(E)}function v(m){var u={};return Object.keys(m).forEach(function(E){(E.startsWith("data-")||E.startsWith("aria-"))&&(u[E]=m[E])}),u}},Ot1p:function(at,Xe,V){"use strict";var oe=V("2qtc"),Y=V("kLXV"),P=V("rAM+"),$=V("miYZ"),U=V("tsqr"),I=V("9og8"),K=V("tJVT"),N=V("jrin"),O=V("WmNS"),L=V.n(O),x=V("q1tI"),A=V.n(x),D=V("VrN/"),w=V.n(D),S=V("bdgK"),T=V("p77/"),h=V("Bd2K"),l=V("ELLl"),i=V("19Vz"),c=V("lZu9"),C=V("+NIl"),v=V("kSUc"),m=V("9Bee"),u=function(ue){var we=ue.value,Le=we===void 0?"":we,rt=ue.className,je=ue.showTextOnly,Ye=ue.showLines,Pt=ue.style,ut=Pt===void 0?{}:Pt,mt=Object(x.useMemo)(function(){return""},[Le]);return A.a.createElement(A.a.Fragment,null,A.a.createElement("div",{dangerouslySetInnerHTML:{__html:mt}}))},E=V("0Owb"),d=V("dejd"),f=V("C+DQ"),s=V("1vsH"),a=V("m3rI"),b=[{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 g(ue){var we=ue.onActionCallback,Le=ue.title,rt=ue.icon,je=ue.actionName,Ye=ue.className,Pt=Ye===void 0?"":Ye,ut=ue.children;function mt(){we(je)}return A.a.createElement("a",{title:Le,className:Pt,onClick:mt},A.a.createElement("i",{className:"md-iconfont ".concat(rt)}),ut)}var _=function(ue){var we=ue.watch,Le=ue.showNullButton,rt=ue.onActionCallback,je=ue.fullScreen,Ye=ue.insertTemp,Pt=ue.hidetoolBar,ut=ue.uuid,mt=ue.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(s.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(s.F)("_educoder_session"),"&key=").concat(ut,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var zt=[].concat(b,[{title:"".concat(we?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(we?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return A.a.createElement("ul",{className:"markdown-toolbar-container"},!Pt&&zt.map(function(Je,Kt){return A.a.createElement("li",{key:Kt},Je.actionName?A.a.createElement(g,Object(E.a)({},Je,{onActionCallback:rt})):A.a.createElement("span",{className:"v-line"}))}),Le?A.a.createElement("li",null,A.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:rt},A.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ye&&A.a.createElement("li",null,A.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ye),onActionCallback:rt},A.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),A.a.createElement("li",{className:"btn-full-screen"},A.a.createElement(g,{icon:"".concat(je?"icon-shrink":"icon-enlarge"),title:je?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:rt})))},k=V("M8RZ"),H=V("+L6B"),z=V("2/Rp"),Z=V("y8nQ"),G=V("Vl3Y"),B=V("5NDa"),te=V("5rEg"),ce={labelCol:{span:4},wrapperCol:{span:20}},pe=function(ue){var we=ue.callback,Le=ue.onCancel;function rt(je){we(je)}return A.a.createElement(G.a,Object(E.a)({},ce,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:rt}),A.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},A.a.createElement(te.a,null)),A.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},A.a.createElement(te.a,null)),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(z.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))},ye=V("7ahc"),Ce=V("HmJG"),_e=V("BjJ7"),le=G.a.useForm,se={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},ie=function(ue){var we=ue.callback,Le=ue.onCancel,rt=le(),je=Object(K.a)(rt,1),Ye=je[0];function Pt(zt){we(zt)}function ut(zt,Je){if(zt.status===-1){U.b.error(zt.message);return}Ye.setFieldsValue({src:"/api/attachments/".concat(zt.id),type:Je.type})}function mt(zt){var Je=zt.target.files[0];Ee(Je,ut)}return A.a.createElement(G.a,Object(E.a)({form:Ye},ge,{className:"upload-image-panel",onFinish:Pt}),A.a.createElement(G.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},A.a.createElement("div",{className:"flex-container"},A.a.createElement(G.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},A.a.createElement(te.a,{style:se})),A.a.createElement(q,{onFileChange:mt}))),A.a.createElement(G.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},A.a.createElement(te.a,{style:{width:264}})),A.a.createElement(G.a.Item,{style:{textAlign:"right"}},A.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(z.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))};function q(ue){var we=ue.onFileChange;return A.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",A.a.createElement("input",{type:"file",onChange:we}))}function Ee(ue,we){if(!ue)throw new String("\u6CA1\u6709\u6587\u4EF6");var Le=new FormData;Le.append("editormd-image-file",ue),Le.append("file_param_name","editormd-image-file"),Le.append("byxhr","true");var rt=new window.XMLHttpRequest;rt.withCredentials=!0,rt.addEventListener("load",function(je){we(JSON.parse(je.target.responseText),ue)},!1),rt.addEventListener("error",function(je){console.error(je)},!1),rt.open("POST","".concat(_e.a,"/api/attachments.json")),rt.send(Le)}var Me=V("giR+"),Ne=V("fyUT"),Pe=V("7Kak"),Be=V("9yH6"),Ae=Be.a.Group,De={margin:"0 8px"},Fe=function(ue){var we=ue.callback,Le=ue.onCancel;function rt(je){we(je)}return A.a.createElement(G.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:rt},A.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},A.a.createElement("span",{style:De},"\u5355\u5143\u683C\u6570\uFF1A"),A.a.createElement("span",{style:De},"\u884C\u6570"),A.a.createElement(G.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},A.a.createElement(Ne.a,null)),A.a.createElement("span",{style:De},"\u5217\u6570"),A.a.createElement(G.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},A.a.createElement(Ne.a,null))),A.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},A.a.createElement("span",{style:De},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),A.a.createElement(G.a.Item,{name:"align"},A.a.createElement(Ae,null,A.a.createElement(Be.a,{value:"default"},A.a.createElement("i",{className:"fa fa-align-justify"})),A.a.createElement(Be.a,{value:"left"},A.a.createElement("i",{className:"fa fa-align-left"})),A.a.createElement(Be.a,{value:"center"},A.a.createElement("i",{className:"fa fa-align-center"})),A.a.createElement(Be.a,{value:"right"},A.a.createElement("i",{className:"fa fa-align-right"}))))),A.a.createElement("div",{className:"flex-container flex-end"},A.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),A.a.createElement(z.a,{type:"ghost",onClick:Le},"\u53D6\u6D88")))},ze=V("ErOA"),qe=V("7Cbv"),He="link",Oe="upload-image",lt="code-block",tt="add-table",ft="------------",nt={default:ft,left:":".concat(ft),center:":".concat(ft,":"),right:"".concat(ft,":")},St=V("9VGf"),ht,yt;function ke(){}var Dt=0,Tt=1e4,Ue="\u2581",Ze=`
**\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 xe(ue){return/^\d+$/.test(ue)?"".concat(ue,"px"):ue}var fe=navigator.platform.toUpperCase().indexOf("MAC")>=0,be=fe?"Cmd":"Ctrl",ne=["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"],re=(ht={},Object(N.a)(ht,be+"-B","bold"),Object(N.a)(ht,be+"-I","italic"),ht),ae=(yt={},Object(N.a)(yt,He,"\u6DFB\u52A0\u94FE\u63A5"),Object(N.a)(yt,lt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(N.a)(yt,Oe,"\u6DFB\u52A0\u6587\u4EF6"),Object(N.a)(yt,tt,"\u6DFB\u52A0\u8868\u683C"),yt),de=Xe.a=function(ue){var we=ue.defaultValue,Le=we===void 0?"":we,rt=ue.onChange,je=ue.width,Ye=je===void 0?"100%":je,Pt=ue.height,ut=Pt===void 0?400:Pt,mt=ue.miniToolbar,zt=mt===void 0?!1:mt,Je=ue.isFocus,Kt=Je===void 0?!1:Je,sn=ue.watch,Bt=ue.insertTemp,an=ue.mode,Qt=an===void 0?"markdown":an,ot=ue.id,Ft=ot===void 0?"markdown-editor-id":ot,xt=ue.showResizeBar,kt=xt===void 0?!1:xt,Mt=ue.noStorage,It=Mt===void 0?!1:Mt,Lt=ue.showNullButton,st=Lt===void 0?!1:Lt,Ve=ue.hidetoolBar,ln=Ve===void 0?!1:Ve,$t=ue.fullScreen,cn=$t===void 0?!1:$t,qt=ue.onBlur,En=ue.onCMBeforeChange,on=ue.onFullScreen,pt=ue.className,Ge=pt===void 0?"":pt,wt=ue.disablePaste,Hn=wt===void 0?!1:wt,fr=ue.placeholder,Ar=fr===void 0?"":fr,Fn=ue.values,F=Fn===void 0?"":Fn,p=Object(x.useState)(null),y=Object(K.a)(p,2),M=y[0],Q=y[1],W=Object(x.useState)(Le),me=Object(K.a)(W,2),$e=me[0],ct=me[1],jt=Object(x.useState)(sn),Qe=Object(K.a)(jt,2),Vt=Qe[0],hn=Qe[1],Rn=Object(x.useState)(cn),pr=Object(K.a)(Rn,2),qn=pr[0],xn=pr[1],Rr=Object(x.useState)(""),qr=Object(K.a)(Rr,2),Vn=qr[0],_t=qr[1],Te=Object(x.useState)(0),it=Object(K.a)(Te,2),Ht=it[0],Ot=it[1],Nt=Object(x.useState)(ut),Xt=Object(K.a)(Nt,2),Pn=Xt[0],Sn=Xt[1],un=Object(x.useState)(!1),jn=Object(K.a)(un,2),Kn=jn[0],ir=jn[1],yn=Object(x.useRef)(Object(qe.a)()),mn=Object(x.useRef)(!1),Ln=Object(x.useRef)(),en=Object(x.useRef)(),Un=Object(x.useRef)(),_n=Object(x.useRef)(),mr=Object(x.useRef)(),ar=function(){var Gt=Object(I.a)(L.a.mark(function nn(){var Jt,fn;return L.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return kn.next=2,Object(ze.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:yn.current}});case 2:fn=kn.sent,fn!=null&&(Jt=fn.attachments)!==null&&Jt!==void 0&&Jt.length&&(console.log("cm:",M,en),fn.attachments.map(function(vn){vn.content_type.indexOf("image")>-1?M.replaceSelection(".concat(vn.content_type,")")):vn.content_type.indexOf("video")>-1?M.replaceSelection('')):vn.content_type.indexOf("pdf")>-1?M.replaceSelection('').concat(vn.name,"")):M.replaceSelection("[".concat(vn.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(vn.id,"?type=").concat(vn.content_type,")"))}));case 4:case"end":return kn.stop()}},nn)}));return function(){return Gt.apply(this,arguments)}}();Object(x.useEffect)(function(){ct(F),M==null||M.setValue(F)},[F]),Object(x.useEffect)(function(){on==null||on(qn)},[qn]),Object(x.useEffect)(function(){if(en.current){var Gt=w.a.fromTextArea(en.current,{mode:Qt,lineNumbers:!zt,lineWrapping:!0,value:Le,autoCloseTags:!0,autoCloseBrackets:!0});Kt&&Gt.focus();function nn(Jt,fn){if(Hn){fn.preventDefault();return}var bn=fn.clipboardData;if(bn){var kn=bn.types.toString(),vn=bn.items;if(kn==="Files"||bn.types.indexOf("Files")>-1){if(fn.preventDefault(),Qt=="stex")return;try{var er,vr=vn[1];((er=vn[0])===null||er===void 0?void 0:er.kind)==="file"&&(vr=vn[0]);var gn=vr.getAsFile(),Qr=gn.name.split(".").pop();Ee(gn,function(Tn){if(Tn.id){var or,tr,Gr;(gn==null||((or=gn.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?Gt.replaceSelection(".concat(Tn.content_type,")")):(gn==null||((tr=gn.type)===null||tr===void 0)?void 0:tr.indexOf("video"))>-1?Gt.replaceSelection('')):(gn==null||((Gr=gn.type)===null||Gr===void 0)?void 0:Gr.indexOf("pdf"))>-1?Gt.replaceSelection('').concat(gn.name,"")):ne.includes(Qr)?Gt.replaceSelection('').concat(gn.name,"")):Gt.replaceSelection("[".concat(gn.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Tn.id,"?type=").concat(Tn.content_type,")"))}else(Tn==null?void 0:Tn.status)===401&&(document.location.href="/user/login")})}catch(Tn){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Gt.on("paste",nn),Gt.on("dragleave",function(Jt,fn){Un.current.classList.remove("mouse-hover-md")}),Gt.on("dragover",function(Jt,fn){Un.current.classList.add("mouse-hover-md")}),Gt.on("drop",function(Jt,fn){Un.current.classList.add("mouse-hover-md");var bn;if(bn=fn.dataTransfer.files,bn.length>0){fn.preventDefault(),fn.stopPropagation();for(var kn=function(vr){var gn=bn[vr],Qr=gn.name.split(".").pop();Ee(gn,function(Tn){if(Tn.id){var or,tr,Gr;(gn==null||((or=gn.type)===null||or===void 0)?void 0:or.indexOf("image"))>-1?Gt.replaceSelection(".concat(Tn.content_type,")")):(gn==null||((tr=gn.type)===null||tr===void 0)?void 0:tr.indexOf("video"))>-1?Gt.replaceSelection('')):(gn==null||((Gr=gn.type)===null||Gr===void 0)?void 0:Gr.indexOf("pdf"))>-1?Gt.replaceSelection('').concat(gn.name,"")):ne.includes(Qr)?Gt.replaceSelection('').concat(gn.name,"")):Gt.replaceSelection("[".concat(gn.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(Tn.id,"?type=").concat(Tn.content_type,")"))}else(Tn==null?void 0:Tn.status)===401&&(document.location.href="/user/login")})},vn=0;vn0||vn.target.offsetWidth>0)&&(gr(),M.setSize("100%","100%"),M.refresh())}}catch(er){bn.e(er)}finally{bn.f()}});return Jt.observe(en.current.parentElement),Jt}if(M){var nn=Gt();return function(){nn.unobserve(en.current.parentElement)}}},[M,gr]),Object(x.useEffect)(function(){if(M){for(var Gt=[],nn=function(){var vn=fn[Jt];bn=Object(K.a)(vn,2);var er=bn[0],vr=bn[1],gn=Object(N.a)({},er,function(){fi(vr)});Gt.push(gn),M.addKeyMap(gn)},Jt=0,fn=Object.entries(re);Jt0){var Gt=new Date().getTime(),nn=window.sessionStorage.getItem(Ft);Gt>=Ht+Tt&&(!nn||nn!==$e)&&(window.sessionStorage.setItem(Ft,$e),ir(!0))}},Tt),Object(x.useEffect)(function(){hn(sn)},[M,sn]),Object(x.useEffect)(function(){M&&(Kt&&M.focus())},[M,Kt]),Object(x.useEffect)(function(){if(Vt&&M){var Gt=M.getScrollerElement();function nn(Jt){var fn=Jt.target;if(mr.current){var bn=fn.scrollTop/fn.scrollHeight;mr.current.scrollTop=mr.current.scrollHeight*bn}}return Gt.addEventListener("scroll",nn),function(){Gt.removeEventListener("scroll",nn)}}},[M,Vt]),Object(x.useEffect)(function(){if(M&&En){function Gt(nn,Jt){En(nn,Jt)}return M.on("beforeChange",Gt),function(){M.off("beforeChange",Gt)}}},[M,En]),Object(x.useEffect)(function(){if(M&&qt){function Gt(){qt(M.getValue())}return M.on("blur",Gt),function(){M.off("blur",Gt)}}},[M,qt]),Object(x.useEffect)(function(){if(M){function Gt(nn){var Jt=nn.getValue();ct(Jt),Ot(new Date().getTime()),nn.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),rt&&rt(Jt)}return M.on("change",Gt),function(){M.off("change",Gt)}}},[M,rt]),Object(x.useEffect)(function(){M&&(Le==null?(M.setValue(""),ct("")):Le!==M.getValue()&&(M.setValue(Le),ct(Le),M.setCursor(M.lineCount(),0)))},[M,Le]);var fi=Object(x.useCallback)(function(Gt){var nn=M.getCursor(),Jt=M.getSelection(),fn=Jt.split(`
`);switch(Gt){case"bold":return M.replaceSelection("**"+Jt+"**"),Jt===""&&M.setCursor(nn.line,nn.ch+2),M.focus();case"italic":return M.replaceSelection("*"+Jt+"*"),Jt===""&&M.setCursor(nn.line,nn.ch+1),M.focus();case"code":return M.replaceSelection("`"+Jt+"`"),Jt===""&&M.setCursor(nn.line,nn.ch+1),M.focus();case"inline-latex":return M.replaceSelection("`$$"+Jt+"$$`"),Jt===""&&M.setCursor(nn.line,nn.ch+3),M.focus();case"latex":return M.replaceSelection("```latex\n"+Jt+"\n```"),M.setCursor(nn.line+1,Jt.length+1),M.focus();case"line-break":return M.replaceSelection(`
`),M.focus();case"list-ul":return Jt===""?M.replaceSelection("- "+Jt):M.replaceSelection(fn.map(function(bn){return bn===""?"":"- ".concat(bn)}).join(`
`)),M.focus();case"list-ol":return Jt===""?M.replaceSelection("1. "+Jt):M.replaceSelection(fn.map(function(bn,kn){return bn===""?"":"".concat(kn+1,". ").concat(bn)}).join(`
`)),M.focus();case"add-null-ch":return Jt===""&&M.setCursor(nn.line,nn.ch+1),M.replaceSelection(Ue),M.focus();case"inster-template-1":return Jt===""&&M.setCursor(nn.line,nn.ch),M.replaceSelection(Ze),M.focus();case"eraser":return M.setValue(""),M.focus();case"trigger-watch":return hn(!Vt),M.focus();case"trigger-full-screen":return xn(!qn),M.focus();case He:_t(He);return;case lt:_t(lt);return;case Oe:_t(Oe);return;case tt:_t(tt);return;default:throw new Error}},[M,Vt,qn]),Jr=Object(x.useCallback)(function(Gt){_t("");switch(Vn){case He:var nn=Gt.title,Jt=Gt.link;return M.replaceSelection("[".concat(nn,"](").concat(Jt,")")),M.focus();case lt:var fn=Gt.language,bn=Gt.content;return M.replaceSelection(["```"+fn,bn,"```"].join(`
`)),M.focus();case Oe:var kn=Gt.src,vn=Gt.alt;return vn?M.replaceSelection(".concat(kn,' "').concat(vn,'" )')):M.replaceSelection("")),M.focus();case tt:for(var er=Gt.row,vr=Gt.col,gn=Gt.align,Qr=`
`,Tn=0;Tn300&&(er=300);var vr=ut+er+"px";Sn(vr)}}return Gt.addEventListener("mousedown",fn),document.addEventListener("mousemove",kn),document.addEventListener("mouseup",bn),function(){Gt.removeEventListener("mousedown",fn),document.removeEventListener("mousemove",kn),document.removeEventListener("mouseup",bn)}}},[M,_n]),Object(x.useEffect)(function(){Sn(ut)},[ut]);var On=xe(Ye),ti=xe(Pn),Xr={width:On,height:ti},pi=Object(x.useMemo)(function(){if(Ht){var Gt=new Date(Ht),nn=Gt.getHours(),Jt=Gt.getMinutes(),fn=Gt.getSeconds();return nn=nn<10?"0"+nn:nn,Jt=Jt<10?"0"+Jt:Jt,fn=fn<10?"0"+fn:fn,"".concat(nn,":").concat(Jt,":").concat(fn)}return 0},[Ht]);function ni(){window.sessionStorage.removeItem(Ft),ir(!1),Ot(0)}function ui(){ir(!1),Ot(0),M.setValue(window.sessionStorage.getItem(Ft))}function si(Gt,nn){var Jt=M.getValue();Jt=Jt.replace(Gt,nn),ct(Jt),M==null||M.setValue(Jt)}return A.a.createElement(x.Fragment,null,A.a.createElement("div",{className:"markdown-editor-wrapper",ref:Un},A.a.createElement("div",{className:"markdown-editor-container ".concat(Ge," ").concat(Vt?"on-preview":""," ").concat(zt?"mini":""," ").concat(qn?"full-screen":""),style:Xr},A.a.createElement(_,{insertTemp:Bt,watch:Vt,fullScreen:qn,showNullButton:st,onActionCallback:fi,hidetoolBar:ln,uuid:yn.current,setOpenPhones:function(){mn.current=!0}}),A.a.createElement("div",{className:"markdown-editor-body"},A.a.createElement("div",{className:"codemirror-container"},A.a.createElement("textarea",{ref:en,placeholder:Ar})),Vt?A.a.createElement("div",{ref:mr,className:"preview-container"},Qt==="stex"&&A.a.createElement(u,{value:$e}),Qt!=="stex"&&A.a.createElement(m.a,{edit:!0,value:$e,replaces:si})):null))),kt?A.a.createElement("a",{ref:_n,className:"editor-resize"}):null,A.a.createElement(k.a,null,ae[Vn]?A.a.createElement(Y.a,{centered:!0,title:ae[Vn],visible:!0,onCancel:ei,footer:null,className:"markdown-popup-form"},Ti):null))}},PGNT:function(at,Xe,V){at.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(at,Xe,V){at.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"}},QSKd:function(at,Xe,V){at.exports=V.p+"static/wenhao.35e7ea02.svg"},"RZ/O":function(at,Xe,V){at.exports=V.p+"static/bi.c00a7d71.svg"},SJMd:function(at,Xe){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var V,oe,Y,P=!1,$,U;window.PR_SHOULD_USE_CONTINUATION=!0;var I,K;(function(){var N=window,O=["break,continue,do,else,for,if,return,while"],L=[O,"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"],x=[L,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],A=[x,"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"],D=[x,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],w=[x,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],S="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",T=[x,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="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",l=[O,"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"],i=[O,"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"],c=[O,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],C=[A,w,D,T,h,l,i,c],v=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,m="str",u="kwd",E="com",d="typ",f="lit",s="pun",a="pln",b="tag",g="dec",_="src",k="atn",H="atv",z="nocode",Z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function G(Ae){for(var De=0,Fe=!1,ze=!1,qe=0,He=Ae.length;qe122||(ne<65||be>90||Dt.push([Math.max(65,be)|32,Math.min(ne,90)|32]),ne<97||be>122||Dt.push([Math.max(97,be)&~32,Math.min(ne,122)&~32]))}}Dt.sort(function(ue,we){return ue[0]-we[0]||we[1]-ue[1]});for(var re=[],ae=[],Ze=0;Zede[0]&&(de[1]+1>de[0]&&Ue.push("-"),Ue.push(ft(de[1])))}return Ue.push("]"),Ue.join("")}function St(yt){for(var ke=yt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),Dt=ke.length,Tt=[],Ue=0,Ze=0;Ue=2&&be==="["?ke[Ue]=nt(xe):be!=="\\"&&(ke[Ue]=xe.replace(/[a-zA-Z]/g,function(ae){var de=ae.charCodeAt(0);return"["+String.fromCharCode(de&~32,de|32)+"]"}))}return ke.join("")}for(var ht=[],qe=0,He=Ae.length;qe=0;)Fe[ht.charAt(yt)]=St;var ke=St[1],Dt=""+ke;tt.hasOwnProperty(Dt)||(lt.push(ke),tt[Dt]=null)}lt.push(/[\0-\uffff]/),ze=G(lt)})();var qe=De.length,He=function(Oe){for(var lt=Oe.sourceCode,tt=Oe.basePos,ft=Oe.sourceNode,nt=[tt,a],St=0,ht=lt.match(ze)||[],yt={},ke=0,Dt=ht.length;ke=5&&Ue.substring(0,5)==="lang-",xe&&!(Ze&&typeof Ze[1]=="string")&&(xe=!1,Ue=_),xe||(yt[Tt]=Ue)}var ne=St;if(St+=Tt.length,!xe)nt.push(tt+ne,Ue);else{var re=Ze[1],ae=Tt.indexOf(re),de=ae+re.length;Ze[2]&&(de=Tt.length-Ze[2].length,ae=de-re.length);var ue=Ue.substring(5);te(ft,tt+ne,Tt.substring(0,ae),He,nt),te(ft,tt+ne+ae,re,q(ue,re),nt),te(ft,tt+ne+de,Tt.substring(de),He,nt)}}Oe.decorations=nt};return He}function Ce(Ae){var De=[],Fe=[];Ae.tripleQuotedStrings?De.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ae.multiLineStrings?De.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):De.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ae.verbatimStrings&&Fe.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ze=Ae.hashComments;ze&&(Ae.cStyleComments?(ze>1?De.push([E,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):De.push([E,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Fe.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):De.push([E,/^#[^\r\n]*/,null,"#"])),Ae.cStyleComments&&(Fe.push([E,/^\/\/[^\r\n]*/,null]),Fe.push([E,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var qe=Ae.regexLiterals;if(qe){var He=qe>1?"":`
\r`,Oe=He?".":"[\\S\\s]",lt="/(?=[^/*"+He+"])(?:[^/\\x5B\\x5C"+He+"]|\\x5C"+Oe+"|\\x5B(?:[^\\x5C\\x5D"+He+"]|\\x5C"+Oe+")*(?:\\x5D|$))+/";Fe.push(["lang-regex",RegExp("^"+Z+"("+lt+")")])}var tt=Ae.types;tt&&Fe.push([d,tt]);var ft=(""+Ae.keywords).replace(/^ | $/g,"");ft.length&&Fe.push([u,new RegExp("^(?:"+ft.replace(/[\s,]+/g,"|")+")\\b"),null]),De.push([a,/^\s+/,null,` \r
\xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ae.regexLiterals&&(nt+="(?!s*/)"),Fe.push([f,/^@[a-z_$][a-z_$@0-9]*/i,null],[d,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[f,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[a,/^\\[\s\S]?/,null],[s,new RegExp(nt),null]),ye(De,Fe)}var _e=Ce({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function le(Ae,De,Fe){for(var ze=/(?:^|\s)nocode(?:\s|$)/,qe=/\r\n?|\n/,He=Ae.ownerDocument,Oe=He.createElement("li");Ae.firstChild;)Oe.appendChild(Ae.firstChild);var lt=[Oe];function tt(ke){var Dt=ke.nodeType;if(Dt==1&&!ze.test(ke.className))if(ke.nodeName==="br")ft(ke),ke.parentNode&&ke.parentNode.removeChild(ke);else for(var Tt=ke.firstChild;Tt;Tt=Tt.nextSibling)tt(Tt);else if((Dt==3||Dt==4)&&Fe){var Ue=ke.nodeValue,Ze=Ue.match(qe);if(Ze){var xe=Ue.substring(0,Ze.index);ke.nodeValue=xe;var fe=Ue.substring(Ze.index+Ze[0].length);if(fe){var be=ke.parentNode;be.insertBefore(He.createTextNode(fe),ke.nextSibling)}ft(ke),xe||ke.parentNode.removeChild(ke)}}}function ft(ke){for(;!ke.nextSibling;)if(ke=ke.parentNode,!ke)return;function Dt(Ze,xe){var fe=xe?Ze.cloneNode(!1):Ze,be=Ze.parentNode;if(be){var ne=Dt(be,1),re=Ze.nextSibling;ne.appendChild(fe);for(var ae=re;ae;ae=re)re=ae.nextSibling,ne.appendChild(ae)}return fe}for(var Tt=Dt(ke.nextSibling,0),Ue;(Ue=Tt.parentNode)&&Ue.nodeType===1;)Tt=Ue;lt.push(Tt)}for(var nt=0;nt=be&&(tt+=2),He>=ne&&(St+=2)}}finally{Ue&&(Ue.style.display=Ze)}}var ge={};function ie(Ae,De){for(var Fe=De.length;--Fe>=0;){var ze=De[Fe];ge.hasOwnProperty(ze)?N.console&&console.warn("cannot override language handler %s",ze):ge[ze]=Ae}}function q(Ae,De){return Ae&&ge.hasOwnProperty(Ae)||(Ae=/^\s*]*(?:>|$)/],[E,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^