(window.webpackJsonp=window.webpackJsonp||[]).push([[199,7,8],{"+NIl":function(At,ft,re){(function(ae){ae(re("VrN/"))})(function(ae){"use strict";ae.defineMode("stex",function($,R){"use strict";function X(T,A){T.cmdState.push(A)}function N(T){return T.cmdState.length>0?T.cmdState[T.cmdState.length-1]:null}function I(T){var A=T.cmdState.pop();A&&A.closeBracket()}function z(T){for(var A=T.cmdState,w=A.length-1;w>=0;w--){var h=A[w];if(h.name=="DEFAULT")continue;return h}return{styleIdentifier:function(){return null}}}function j(T,A,w){return function(){this.name=T,this.bracketNo=0,this.style=A,this.styles=w,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=j("importmodule","tag",["string","builtin"]),O.documentclass=j("documentclass","tag",["","atom"]),O.usepackage=j("usepackage","tag",["atom"]),O.begin=j("begin","tag",["atom"]),O.end=j("end","tag",["atom"]),O.label=j("label","tag",["atom"]),O.ref=j("ref","tag",["atom"]),O.eqref=j("eqref","tag",["atom"]),O.cite=j("cite","tag",["atom"]),O.bibitem=j("bibitem","tag",["atom"]),O.Bibitem=j("Bibitem","tag",["atom"]),O.RBibitem=j("RBibitem","tag",["atom"]),O.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function P(T,A){T.f=A}function E(T,A){var w;if(T.match(/^\\[a-zA-Z@]+/)){var h=T.current().slice(1);return w=O.hasOwnProperty(h)?O[h]:O.DEFAULT,w=new w,X(A,w),P(A,D),w.style}if(T.match(/^\\[$&%#{}_]/))return"tag";if(T.match(/^\\[,;!\/\\]/))return"tag";if(T.match("\\["))return P(A,function(d,c){return L(d,c,"\\]")}),"keyword";if(T.match("\\("))return P(A,function(d,c){return L(d,c,"\\)")}),"keyword";if(T.match("$$"))return P(A,function(d,c){return L(d,c,"$$")}),"keyword";if(T.match("$"))return P(A,function(d,c){return L(d,c,"$")}),"keyword";var o=T.next();if(o=="%")return T.skipToEnd(),"comment";if(o=="}"||o=="]"){if(w=N(A),w)w.closeBracket(o),P(A,D);else return"error";return"bracket"}else return o=="{"||o=="["?(w=O.DEFAULT,w=new w,X(A,w),"bracket"):/\d/.test(o)?(T.eatWhile(/[\w.%]/),"atom"):(T.eatWhile(/[\w\-_]/),w=z(A),w.name=="begin"&&(w.argument=T.current()),w.styleIdentifier())}function L(T,A,w){if(T.eatSpace())return null;if(w&&T.match(w))return P(A,E),"keyword";if(T.match(/^\\[a-zA-Z@]+/))return"tag";if(T.match(/^[a-zA-Z]+/))return"variable-2";if(T.match(/^\\[$&%#{}_]/))return"tag";if(T.match(/^\\[,;!\/]/))return"tag";if(T.match(/^[\^_&]/))return"tag";if(T.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(T.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var h=T.next();return h=="{"||h=="}"||h=="["||h=="]"||h=="("||h==")"?"bracket":h=="%"?(T.skipToEnd(),"comment"):"error"}function D(T,A){var w=T.peek(),h;return w=="{"||w=="["?(h=N(A),h.openBracket(w),T.eat(w),P(A,E),"bracket"):/[ \t\r]/.test(w)?(T.eat(w),null):(P(A,E),I(A),E(T,A))}return{startState:function(){var T=R.inMathMode?function(A,w){return L(A,w)}:E;return{cmdState:[],f:T}},copyState:function(T){return{cmdState:T.cmdState.slice(),f:T.f}},token:function(T,A){return A.f(T,A)},blankLine:function(T){T.f=E,T.cmdState.length=0},lineComment:"%"}}),ae.defineMIME("text/x-stex","stex"),ae.defineMIME("text/x-latex","stex")})},"+yhJ":function(At,ft,re){At.exports=re.p+"static/xixi.d492fb65.svg"},"0eGx":function(At,ft,re){At.exports=re.p+"static/zhong.c1924b73.svg"},"19Vz":function(At,ft,re){(function(ae){ae(re("VrN/"))})(function(ae){ae.defineOption("placeholder","",function(j,O,P){var E=P&&P!=ae.Init;if(O&&!E)j.on("blur",N),j.on("change",I),j.on("swapDoc",I),ae.on(j.getInputField(),"compositionupdate",j.state.placeholderCompose=function(){X(j)}),I(j);else if(!O&&E){j.off("blur",N),j.off("change",I),j.off("swapDoc",I),ae.off(j.getInputField(),"compositionupdate",j.state.placeholderCompose),$(j);var L=j.getWrapperElement();L.className=L.className.replace(" CodeMirror-empty","")}O&&!j.hasFocus()&&N(j)});function $(j){j.state.placeholder&&(j.state.placeholder.parentNode.removeChild(j.state.placeholder),j.state.placeholder=null)}function R(j){$(j);var O=j.state.placeholder=document.createElement("pre");O.style.cssText="height: 0; overflow: visible",O.style.direction=j.getOption("direction"),O.className="CodeMirror-placeholder CodeMirror-line-like";var P=j.getOption("placeholder");typeof P=="string"&&(P=document.createTextNode(P)),O.appendChild(P),j.display.lineSpace.insertBefore(O,j.display.lineSpace.firstChild)}function X(j){setTimeout(function(){var O=!1,P=j.getInputField();P.nodeName=="TEXTAREA"?O=!P.value:j.lineCount()==1&&(O=!/[^\u200b]/.test(P.querySelector(".CodeMirror-line").textContent)),O?R(j):$(j)},20)}function N(j){z(j)&&R(j)}function I(j){var O=j.getWrapperElement(),P=z(j);O.className=O.className.replace(" CodeMirror-empty","")+(P?" CodeMirror-empty":""),P?R(j):$(j)}function z(j){return j.lineCount()===1&&j.getLine(0)===""}})},"1eCo":function(At,ft,re){(function(ae){ae(re("VrN/"))})(function(ae){"use strict";var $={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},R={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ae.defineMode("xml",function(X,N){var I=X.indentUnit,z={},j=N.htmlMode?$:R;for(var O in j)z[O]=j[O];for(var O in N)z[O]=N[O];var P,E;function L(a,b){function v(H){return b.tokenize=H,H(a,b)}var x=a.next();if(x=="<")return a.eat("!")?a.eat("[")?a.match("CDATA[")?v(A("atom","]]>")):null:a.match("--")?v(A("comment","-->")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),v(w(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=A("meta","?>"),"meta"):(P=a.eat("/")?"closeTag":"openTag",b.tokenize=D,"tag bracket");if(x=="&"){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}L.isInText=!0;function D(a,b){var v=a.next();if(v==">"||v=="/"&&a.eat(">"))return b.tokenize=L,P=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return P="equals",null;if(v=="<"){b.tokenize=L,b.state=c,b.tagName=b.tagStart=null;var x=b.tokenize(a,b);return x?x+" tag error":"tag error"}else return/[\'\"]/.test(v)?(b.tokenize=T(v),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function T(a){var b=function(v,x){for(;!v.eol();)if(v.next()==a){x.tokenize=D;break}return"string"};return b.isInAttribute=!0,b}function A(a,b){return function(v,x){for(;!v.eol();){if(v.match(b)){x.tokenize=L;break}v.next()}return a}}function w(a){return function(b,v){for(var x;(x=b.next())!=null;){if(x=="<")return v.tokenize=w(a+1),v.tokenize(b,v);if(x==">")if(a==1){v.tokenize=L;break}else return v.tokenize=w(a-1),v.tokenize(b,v)}return"meta"}}function h(a,b,v){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=v,(z.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function o(a){a.context&&(a.context=a.context.prev)}function d(a,b){for(var v;;){if(!a.context)return;if(v=a.context.tagName,!z.contextGrabbers.hasOwnProperty(v)||!z.contextGrabbers[v].hasOwnProperty(b))return;o(a)}}function c(a,b,v){return a=="openTag"?(v.tagStart=b.column(),C):a=="closeTag"?y:c}function C(a,b,v){return a=="word"?(v.tagName=b.current(),E="tag",S):z.allowMissingTagName&&a=="endTag"?(E="tag bracket",S(a,b,v)):(E="error",C)}function y(a,b,v){if(a=="word"){var x=b.current();return v.context&&v.context.tagName!=x&&z.implicitlyClosed.hasOwnProperty(v.context.tagName)&&o(v),v.context&&v.context.tagName==x||z.matchClosing===!1?(E="tag",m):(E="tag error",l)}else return z.allowMissingTagName&&a=="endTag"?(E="tag bracket",m(a,b,v)):(E="error",l)}function m(a,b,v){return a!="endTag"?(E="error",m):(o(v),c)}function l(a,b,v){return E="error",m(a,b,v)}function S(a,b,v){if(a=="word")return E="attribute",f;if(a=="endTag"||a=="selfcloseTag"){var x=v.tagName,k=v.tagStart;return v.tagName=v.tagStart=null,a=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(x)?d(v,x):(d(v,x),v.context=new h(v,x,k==v.indented)),c}return E="error",S}function f(a,b,v){return a=="equals"?p:(z.allowMissing||(E="error"),S(a,b,v))}function p(a,b,v){return a=="string"?s:a=="word"&&z.allowUnquoted?(E="string",S):(E="error",S(a,b,v))}function s(a,b,v){return a=="string"?s:S(a,b,v)}return{startState:function(a){var b={tokenize:L,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;P=null;var v=b.tokenize(a,b);return(v||P)&&v!="comment"&&(E=null,b.state=b.state(P||v,a,b),E&&(v=E=="error"?v+" error":E)),v},indent:function(a,b,v){var x=a.context;if(a.tokenize.isInAttribute)return a.tagStart==a.indented?a.stringStartCol+1:a.indented+I;if(x&&x.noIndent)return ae.Pass;if(a.tokenize!=D&&a.tokenize!=L)return v?v.match(/^(\s*)/)[0].length:0;if(a.tagName)return z.multilineTagIndentPastTag!==!1?a.tagStart+a.tagName.length+2:a.tagStart+I*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/$/,blockCommentStart:"",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(a){a.state==p&&(a.state=S)},xmlCurrentTag:function(a){return a.tagName?{name:a.tagName,close:a.type=="closeTag"}:null},xmlCurrentContext:function(a){for(var b=[],v=a.context;v;v=v.prev)v.tagName&&b.push(v.tagName);return b.reverse()}}}),ae.defineMIME("text/xml","xml"),ae.defineMIME("application/xml","xml"),ae.mimeModes.hasOwnProperty("text/html")||ae.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"6+eU":function(At,ft,re){"use strict";re.d(ft,"a",function(){return m});var ae=re("wx14"),$=re("rePB"),R=re("VTBJ"),X=re("1OyB"),N=re("vuIU"),I=re("Ji7U"),z=re("LK+K"),j=re("q1tI"),O=re.n(j),P=re("TSYQ"),E=re.n(P),L=function(S){var f,p="".concat(S.rootPrefixCls,"-item"),s=E()(p,"".concat(p,"-").concat(S.page),(f={},Object($.a)(f,"".concat(p,"-active"),S.active),Object($.a)(f,S.className,!!S.className),Object($.a)(f,"".concat(p,"-disabled"),!S.page),f)),a=function(){S.onClick(S.page)},b=function(x){S.onKeyPress(x,S.onClick,S.page)};return O.a.createElement("li",{title:S.showTitle?S.page:null,className:s,onClick:a,onKeyPress:b,tabIndex:"0"},S.itemRender(S.page,"page",O.a.createElement("a",{rel:"nofollow"},S.page)))},D=L,T={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},A=function(l){Object(I.a)(f,l);var S=Object(z.a)(f);function f(){var p;Object(X.a)(this,f);for(var s=arguments.length,a=new Array(s),b=0;b=0||v.relatedTarget.className.indexOf("".concat(V,"-next"))>=0))return;p.setState({goInputText:""}),H(p.getValidValue())},p.go=function(v){var x=p.state.goInputText;if(x==="")return;(v.keyCode===T.ENTER||v.type==="click")&&(p.setState({goInputText:""}),p.props.quickGo(p.getValidValue()))},p}return Object(N.a)(f,[{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(v){return v.toString()===a.toString()})?b:b.concat([a.toString()]).sort(function(v,x){var k=isNaN(Number(v))?0:Number(v),H=isNaN(Number(x))?0:Number(x);return k-H})}},{key:"render",value:function(){var s=this,a=this.props,b=a.pageSize,v=a.locale,x=a.rootPrefixCls,k=a.changeSize,H=a.quickGo,V=a.goButton,Q=a.selectComponentClass,G=a.buildOptionText,W=a.selectPrefixCls,q=a.disabled,oe=this.state.goInputText,fe="".concat(x,"-options"),ve=Q,ke=null,Ee=null,_e=null;if(!k&&!H)return null;var Te=this.getPageSizeOptions();if(k&&ve){var Ce=Te.map(function(me,ne){return O.a.createElement(ve.Option,{key:ne,value:me.toString()},(G||s.buildOptionText)(me))});ke=O.a.createElement(ve,{disabled:q,prefixCls:W,showSearch:!1,className:"".concat(fe,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(b||Te[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ne){return ne.parentNode}},Ce)}return H&&(V&&(_e=typeof V=="boolean"?O.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:q,className:"".concat(fe,"-quick-jumper-button")},v.jump_to_confirm):O.a.createElement("span",{onClick:this.go,onKeyUp:this.go},V)),Ee=O.a.createElement("div",{className:"".concat(fe,"-quick-jumper")},v.jump_to,O.a.createElement("input",{disabled:q,type:"text",value:oe,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),v.page,_e)),O.a.createElement("li",{className:"".concat(fe)},ke,Ee)}}]),f}(O.a.Component);A.defaultProps={pageSizeOptions:["10","20","50","100"]};var w=A,h=re("N2Kk");function o(){}function d(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}function c(l,S,f){return f}function C(l,S,f){var p=typeof l=="undefined"?S.pageSize:l;return Math.floor((f.total-1)/p)+1}var y=function(l){Object(I.a)(f,l);var S=Object(z.a)(f);function f(p){var s;Object(X.a)(this,f),s=S.call(this,p),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 V=s.props.prefixCls,Q=k||O.a.createElement("button",{type:"button","aria-label":H,className:"".concat(V,"-item-link")});return typeof k=="function"&&(Q=O.a.createElement(k,Object(R.a)({},s.props))),Q},s.savePaginationNode=function(k){s.paginationNode=k},s.isValid=function(k){return d(k)&&k!==s.state.current},s.shouldDisplayQuickJumper=function(){var k=s.props,H=k.showQuickJumper,V=k.pageSize,Q=k.total;return Q<=V?!1:H},s.handleKeyDown=function(k){(k.keyCode===T.ARROW_UP||k.keyCode===T.ARROW_DOWN)&&k.preventDefault()},s.handleKeyUp=function(k){var H=s.getValidValue(k),V=s.state.currentInputValue;H!==V&&s.setState({currentInputValue:H}),k.keyCode===T.ENTER?s.handleChange(H):k.keyCode===T.ARROW_UP?s.handleChange(H-1):k.keyCode===T.ARROW_DOWN&&s.handleChange(H+1)},s.changePageSize=function(k){var H=s.state.current,V=C(k,s.state,s.props);H=H>V?V:H,V===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,V=k;if(s.isValid(V)&&!H){var Q=C(void 0,s.state,s.props);V>Q?V=Q:V<1&&(V=1),"current"in s.props||s.setState({current:V,currentInputValue:V});var G=s.state.pageSize;return s.props.onChange(V,G),V}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?V-2:0),G=2;G=b?x=b:x=Number(a),x}},{key:"getShowSizeChanger",value:function(){var s=this.props,a=s.showSizeChanger,b=s.total,v=s.totalBoundaryShowSizeChanger;return typeof a!="undefined"?a:b>v}},{key:"renderPrev",value:function(s){var a=this.props,b=a.prevIcon,v=a.itemRender,x=v(s,"prev",this.getItemIcon(b,"prev page")),k=!this.hasPrev();return Object(j.isValidElement)(x)?Object(j.cloneElement)(x,{disabled:k}):x}},{key:"renderNext",value:function(s){var a=this.props,b=a.nextIcon,v=a.itemRender,x=v(s,"next",this.getItemIcon(b,"next page")),k=!this.hasNext();return Object(j.isValidElement)(x)?Object(j.cloneElement)(x,{disabled:k}):x}},{key:"render",value:function(){var s=this,a=this.props,b=a.prefixCls,v=a.className,x=a.style,k=a.disabled,H=a.hideOnSinglePage,V=a.total,Q=a.locale,G=a.showQuickJumper,W=a.showLessItems,q=a.showTitle,oe=a.showTotal,fe=a.simple,ve=a.itemRender,ke=a.showPrevNextJumpers,Ee=a.jumpPrevIcon,_e=a.jumpNextIcon,Te=a.selectComponentClass,Ce=a.selectPrefixCls,me=a.pageSizeOptions,ne=this.state,we=ne.current,tt=ne.pageSize,Ye=ne.currentInputValue;if(H===!0&&V<=tt)return null;var Xe=C(void 0,this.state,this.props),Ve=[],Le=null,Me=null,He=null,Ge=null,je=null,Ue=G&&G.goButton,Re=W?1:2,st=we-1>0?we-1:0,Je=we+1=Re*2&&we!==1+2&&(Ve[0]=Object(j.cloneElement)(Ve[0],{className:"".concat(b,"-item-after-jump-prev")}),Ve.unshift(Le)),Xe-we>=Re*2&&we!==Xe-2&&(Ve[Ve.length-1]=Object(j.cloneElement)(Ve[Ve.length-1],{className:"".concat(b,"-item-before-jump-next")}),Ve.push(Me)),gt!==1&&Ve.unshift(He),dt!==Xe&&Ve.push(Ge)}var ge=null;oe&&(ge=O.a.createElement("li",{className:"".concat(b,"-total-text")},oe(V,[V===0?0:(we-1)*tt+1,we*tt>V?V:we*tt])));var de=!this.hasPrev()||!Xe,pe=!this.hasNext()||!Xe;return O.a.createElement("ul",Object(ae.a)({className:E()(b,v,Object($.a)({},"".concat(b,"-disabled"),k)),style:x,unselectable:"unselectable",ref:this.savePaginationNode},Qe),ge,O.a.createElement("li",{title:q?Q.prev_page:null,onClick:this.prev,tabIndex:de?null:0,onKeyPress:this.runIfEnterPrev,className:E()("".concat(b,"-prev"),Object($.a)({},"".concat(b,"-disabled"),de)),"aria-disabled":de},this.renderPrev(st)),Ve,O.a.createElement("li",{title:q?Q.next_page:null,onClick:this.next,tabIndex:pe?null:0,onKeyPress:this.runIfEnterNext,className:E()("".concat(b,"-next"),Object($.a)({},"".concat(b,"-disabled"),pe)),"aria-disabled":pe},this.renderNext(Je)),O.a.createElement(w,{disabled:k,locale:Q,rootPrefixCls:b,selectComponentClass:Te,selectPrefixCls:Ce,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:we,pageSize:tt,pageSizeOptions:me,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ue}))}}],[{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 v=a.current,x=C(s.pageSize,a,s);v=v>x?x:v,"current"in s||(b.current=v,b.currentInputValue=v),b.pageSize=s.pageSize}return b}}]),f}(O.a.Component);y.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:o,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:o,locale:h.a,style:{},itemRender:c,totalBoundaryShowSizeChanger:50};var m=y},"6K3P":function(At,ft,re){At.exports=re.p+"static/jinshi.9b74f304.svg"},"7Cbv":function(At,ft,re){"use strict";var ae=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function R(){if(!ae)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ae($)}var X=/^(?:[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 N(D){return typeof D=="string"&&X.test(D)}for(var I=N,z=[],j=0;j<256;++j)z.push((j+256).toString(16).substr(1));function O(D){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=(z[D[T+0]]+z[D[T+1]]+z[D[T+2]]+z[D[T+3]]+"-"+z[D[T+4]]+z[D[T+5]]+"-"+z[D[T+6]]+z[D[T+7]]+"-"+z[D[T+8]]+z[D[T+9]]+"-"+z[D[T+10]]+z[D[T+11]]+z[D[T+12]]+z[D[T+13]]+z[D[T+14]]+z[D[T+15]]).toLowerCase();if(!I(A))throw TypeError("Stringified UUID is invalid");return A}var P=O;function E(D,T,A){D=D||{};var w=D.random||(D.rng||R)();if(w[6]=w[6]&15|64,w[8]=w[8]&63|128,T){A=A||0;for(var h=0;h<16;++h)T[A+h]=w[h];return T}return P(w)}var L=ft.a=E},"7ahc":function(At,ft,re){"use strict";re.d(ft,"a",function(){return C});var ae=re("k1fw"),$=re("0Owb"),R=re("+L6B"),X=re("2/Rp"),N=re("y8nQ"),I=re("Vl3Y"),z=re("tJVT"),j=re("OaEy"),O=re("2fM7"),P=re("q1tI"),E=re.n(P),L=re("VrN/"),D=re.n(L),T=re("p77/"),A=re.n(T),w=re("c5Ni"),h=re.n(w),o=O.a.Option,d={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"]};ft.b=function(y){var m=y.callback,l=y.onCancel,S=Object(P.useState)("python"),f=Object(z.a)(S,2),p=f[0],s=f[1];function a(v){s(c[v][1])}function b(v){m(v)}return E.a.createElement(I.a,Object($.a)({},d,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:b}),E.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},E.a.createElement(O.a,{onChange:a},Object.keys(c).map(function(v){return E.a.createElement(o,{key:v,value:v},c[v][0])}))),E.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},E.a.createElement(C,{mode:p})),E.a.createElement("div",{className:"flex-container flex-end"},E.a.createElement(X.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),E.a.createElement(X.a,{type:"ghost",onClick:l},"\u53D6\u6D88")))};function C(y){var m=y.value,l=y.onChange,S=y.mode,f=y.options,p=f===void 0?{}:f,s=Object(P.useRef)(),a=Object(P.useState)(),b=Object(z.a)(a,2),v=b[0],x=b[1];return Object(P.useEffect)(function(){if(v){function k(H){var V=H.getValue();l&&l(V)}return v.on("change",k),function(){v.off("change",k)}}},[v,l]),Object(P.useEffect)(function(){v&&v.setOption("mode",S)},[v,S]),Object(P.useEffect)(function(){v&&((m!==v.getValue()||m==="")&&setTimeout(function(){v.setValue(m||" ")},300))},[v,m]),Object(P.useEffect)(function(){if(s.current&&!v){var k=D.a.fromTextArea(s.current,Object(ae.a)({mode:S,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},p));x(k)}},[s.current,v]),E.a.createElement("div",{className:"my-codemirror-container"},E.a.createElement("textarea",{ref:s}))}},"7ixt":function(At,ft,re){"use strict";re.d(ft,"a",function(){return R});var ae={adjustX:1,adjustY:1},$=[0,0],R={left:{points:["cr","cl"],overflow:ae,offset:[-4,0],targetOffset:$},right:{points:["cl","cr"],overflow:ae,offset:[4,0],targetOffset:$},top:{points:["bc","tc"],overflow:ae,offset:[0,-4],targetOffset:$},bottom:{points:["tc","bc"],overflow:ae,offset:[0,4],targetOffset:$},topLeft:{points:["bl","tl"],overflow:ae,offset:[0,-4],targetOffset:$},leftTop:{points:["tr","tl"],overflow:ae,offset:[-4,0],targetOffset:$},topRight:{points:["br","tr"],overflow:ae,offset:[0,-4],targetOffset:$},rightTop:{points:["tl","tr"],overflow:ae,offset:[4,0],targetOffset:$},bottomRight:{points:["tr","br"],overflow:ae,offset:[0,4],targetOffset:$},rightBottom:{points:["bl","br"],overflow:ae,offset:[4,0],targetOffset:$},bottomLeft:{points:["tl","bl"],overflow:ae,offset:[0,4],targetOffset:$},leftBottom:{points:["br","bl"],overflow:ae,offset:[-4,0],targetOffset:$}},X=R},"7qnI":function(At,ft,re){"use strict";var ae=re("5Dmo"),$=re("3S7+"),R=re("fWQN"),X=re("mtLc"),N=re("yKVA"),I=re("879j"),z=re("5NDa"),j=re("5rEg"),O=re("q1tI"),P=re.n(O),E=re("O2Wb"),L=re.n(E),D=j.a.TextArea,T=function(A){Object(N.a)(h,A);var w=Object(I.a)(h);function h(){return Object(R.a)(this,h),w.apply(this,arguments)}return Object(X.a)(h,[{key:"render",value:function(){var d=this,c=this.props,C=c.index,y=c.onAnswerChange,m=c.addChildAnswer,l=c.exerciseIsPublish,S=c.answers,f=c.activeOptionErrorIndex,p=c.flex,s=p===void 0?"0 0 1000px":p;return P.a.createElement("div",{className:L.a.flex},P.a.createElement("div",{className:"".concat(L.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",C+1,"):"),P.a.createElement("div",{className:"".concat(L.a.flex," ").concat(L.a.flex1),style:{flexDirection:"column"}},S.map(function(a,b){var v="".concat(C,"-").concat(b);return P.a.createElement("div",{className:"".concat(L.a.flex," ").concat(L.a.flex1),key:b},P.a.createElement("div",{className:L.a.flex1,style:{flex:s}},P.a.createElement("div",null,P.a.createElement(D,{className:v===f?L.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 y(C,b,k.target.value)},style:{minHeight:95}}))),!l&&P.a.createElement(P.a.Fragment,null,b!=0&&P.a.createElement($.a,{title:"\u5220\u9664"},P.a.createElement("i",{className:"".concat(L.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return d.props.deleteChildAnswer(C,b)},style:{float:"right"}})),b===0&&P.a.createElement($.a,{title:"\u5220\u9664"},P.a.createElement("i",{className:"".concat(L.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return d.props.deleteChildAnswermain(C,b)},style:{float:"right"}})),P.a.createElement($.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},P.a.createElement("i",{className:"".concat(L.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return m(C)},style:{float:"right",visibility:b==S.length-1?"":"hidden"}}))))})))}}]),h}(O.Component);ft.a=T},"8EBN":function(At,ft,re){(function(ae){ae(re("VrN/"))})(function(ae){"use strict";ae.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 $=0;$-1&&X.substring(z+1,X.length);if(j)return ae.findModeByExtension(j)},ae.findModeByName=function(X){X=X.toLowerCase();for(var N=0;N=M.length?J.slice(M.length):J}).join(`
`)}var h=[],o=[""],d=new T.a.Renderer,c=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function C(){h.length=0,o=[""]}var y={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function m(U,u,g,M){if(u>=U.length||U[u].level<=g)return u;var J=U[u];M.push("- "+J.text+""),u++;var F=[];return u=m(U,u,J.level,F),F.length>0&&(M.push("
"),F.forEach(function(ce){M.push(ce)}),M.push("
")),M.push(" "),u=m(U,u,g,M),u}function l(){return m(h,0,0,o),o.push("
"),o.join("")}var S={heading:function(u){var g=c.exec(u);if(g)return{type:"heading",raw:g[0],depth:g[1].length,text:g[2]}},fences:function(u){var g=this.rules.block.fences.exec(u);if(g){var M=g[0],J=w(M,g[3]||""),F=g[2]?g[2].trim():g[2];if(["latex","katex","math"].indexOf(F)>=0){var ce=s(),Ne=J;J=ce,a[ce]={type:"block",expression:Ne}}return{type:"code",raw:M,lang:F,text:J}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,p=0,s=function(){return"__special_katext_id_".concat(p++,"__")},a={};function b(){return a}function v(){p=0,a={}}function x(U){return U=U.replace(f,function(u,g){var M=s();return a[M]={type:"inline",expression:g},M}),U}var k=d.listitem;d.listitem=function(U){return k(x(U))};var H=d.paragraph;d.paragraph=function(U){return H(x(U))};var V=d.tablecell;d.tablecell=function(U,u){return V(x(U),u)},d.code=function(U,u,g){var M=(u||"").match(/\S*/)[0];return M?["latex","katex","math"].indexOf(M)>=0?"".concat(U,"
"):'
').concat(g?U:Object(A.escape)(U,!0),`
`):''+(g?U:Object(A.escape)(U,!0))+"
"},d.heading=function(U,u,g){var M=this.options.headerPrefix+g.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:M,level:u,text:U}),"'+U+""},T.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),T.a.use({tokenizer:S,renderer:d});var Q=T.a,G=re("SJMd"),W=re("ulZh"),q=re.n(W),oe=re("m3rI"),fe=re("Oy/b"),ve=re("p5ED"),ke=re("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 Ee=function(U,u){return(Ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,M){g.__proto__=M}||function(g,M){for(var J in M)Object.prototype.hasOwnProperty.call(M,J)&&(g[J]=M[J])})(U,u)};function _e(U,u){function g(){this.constructor=U}Ee(U,u),U.prototype=u===null?Object.create(u):(g.prototype=u.prototype,new g)}function Te(U,u,g,M){return new(g||(g=Promise))(function(J,F){function ce(Tt){try{rt(M.next(Tt))}catch(Be){F(Be)}}function Ne(Tt){try{rt(M.throw(Tt))}catch(Be){F(Be)}}function rt(Tt){var Be;Tt.done?J(Tt.value):(Be=Tt.value,Be instanceof g?Be:new g(function(kt){kt(Be)})).then(ce,Ne)}rt((M=M.apply(U,u||[])).next())})}function Ce(U,u){var g,M,J,F,ce={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return F={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Ne(rt){return function(Tt){return function(Be){if(g)throw new TypeError("Generator is already executing.");for(;ce;)try{if(g=1,M&&(J=2&Be[0]?M.return:Be[0]?M.throw||((J=M.return)&&J.call(M),0):M.next)&&!(J=J.call(M,Be[1])).done)return J;switch(M=0,J&&(Be=[2&Be[0],J.value]),Be[0]){case 0:case 1:J=Be;break;case 4:return ce.label++,{value:Be[1],done:!1};case 5:ce.label++,M=Be[1],Be=[0];continue;case 7:Be=ce.ops.pop(),ce.trys.pop();continue;default:if(!(J=ce.trys,(J=J.length>0&&J[J.length-1])||Be[0]!==6&&Be[0]!==2)){ce=0;continue}if(Be[0]===3&&(!J||Be[1]>J[0]&&Be[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(F){var ce=document.createElement("div");ce.className=""+g.toolbarButtonStyleClass.name,ce.setAttribute("data-type-name",F.typeName),ce.innerHTML=F.icon,ce.addEventListener("click",function(){g.markerToolbarButtonClicked(ce,F)}),g.buttons.push(ce),g.markerButtons.push(ce)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var J=document.createElement("div");J.className=this.toolbarBlockStyleClass.name,J.style.whiteSpace="nowrap",J.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(J),this.addActionButton(J,'',"render"),this.addActionButton(J,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},U.prototype.addButtonClickListener=function(u){this.buttonClickListeners.push(u)},U.prototype.removeButtonClickListener=function(u){this.buttonClickListeners.indexOf(u)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(u),1)},U.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},U.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var u=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var g=0;g0&&this.buttonClickListeners.forEach(function(M){return M("marker",g)}),this.markerButtonOverflowBlock.style.display="none"},U.prototype.actionToolbarButtonClicked=function(u,g){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(M){return M("action",g)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},U.prototype.setActiveButton=function(u){this.resetButtonStyles(),u.className=u.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),u.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},U.prototype.setActiveMarkerButton=function(u){var g=this.markerButtons.find(function(M){return M.getAttribute("data-type-name")===u});g&&this.setActiveButton(g)},U.prototype.setCurrentMarker=function(u){var g=this;this.currentMarker=u,this.buttons.filter(function(M){return/delete|notes/.test(M.getAttribute("data-action"))}).forEach(function(M){g.currentMarker===void 0?(M.style.fillOpacity="0.4",M.style.pointerEvents="none"):(M.style.fillOpacity="1",M.style.pointerEvents="all")})},U}(),He=function(){function U(u,g,M,J){this.panels=[],this.panelButtons=[],this.markerjsContainer=u,this.displayMode=g,this.uiStyleSettings=M,this.styles=J,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return U.prototype.addStyles=function(){var u;this.toolboxStyleClass=this.styles.addClass(new Le("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 Le("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var g=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Le("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Le("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Le("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 Le("toolbox-panel-row_colors",`
background-color: `+((u=this.uiStyleSettings.toolboxBackgroundColor)!==null&&u!==void 0?u:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Le("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*g)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*g)+`px;
padding: `+g+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Le("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ve("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},U.prototype.show=function(u){var g;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=u,this.uiContainer.className=this.toolboxStyleClass.name+" "+((g=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&g!==void 0?g:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},U.prototype.setPanelButtons=function(u){var g,M,J=this;this.panels=u,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((g=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&g!==void 0?g: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(F){var ce;F.uiStyleSettings=J.uiStyleSettings;var Ne=document.createElement("div");Ne.className=J.toolboxButtonStyleClass.name+" "+((ce=J.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ce!==void 0?ce:J.toolboxButtonStyleColorsClass.name),Ne.innerHTML=F.icon,Ne.title=F.title,Ne.addEventListener("click",function(){J.panelButtonClick(F)}),J.panelButtons.push(Ne),J.buttonRow.appendChild(Ne)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},U.prototype.panelButtonClick=function(u){var g=this,M=-1;if(u!==this.activePanel){M=this.panels.indexOf(u),this.panelRow.innerHTML="";var J=u.getUi();J.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(J),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=u}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){g.displayMode==="inline"?g.panelRow.style.display="none":g.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(F,ce){var Ne,rt;F.className=g.toolboxButtonStyleClass.name+" "+(ce===M?""+((Ne=g.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ne!==void 0?Ne:g.toolboxActiveButtonStyleColorsClass.name):""+((rt=g.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&rt!==void 0?rt:g.toolboxButtonStyleColorsClass.name))})},U}(),Ge=function(U,u){this.title=U,this.icon=u},je=function(U){function u(g,M,J,F){var ce=U.call(this,g,F||'')||this;return ce.colors=[],ce.addTransparent=!1,ce.colorBoxes=[],ce.colors=M,ce.currentColor=J,ce.setCurrentColor=ce.setCurrentColor.bind(ce),ce.getColorBox=ce.getColorBox.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.whiteSpace="nowrap",this.colors.forEach(function(J){var F=g.getColorBox(J);M.appendChild(F),g.colorBoxes.push(F)}),M},u.prototype.getColorBox=function(g){var M=this,J=this.uiStyleSettings.toolbarHeight/4,F=this.uiStyleSettings.toolbarHeight-J,ce=document.createElement("div");ce.style.display="inline-block",ce.style.boxSizing="content-box",ce.style.width=F-2+"px",ce.style.height=F-2+"px",ce.style.padding="1px",ce.style.marginRight="2px",ce.style.marginBottom="2px",ce.style.borderWidth="2px",ce.style.borderStyle="solid",ce.style.borderRadius=(F+2)/2+"px",ce.style.borderColor=g===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ce.addEventListener("click",function(){M.setCurrentColor(g,ce)});var Ne=document.createElement("div");return Ne.style.display="inline-block",Ne.style.width=F-2+"px",Ne.style.height=F-2+"px",Ne.style.backgroundColor=g,Ne.style.borderRadius=F/2+"px",g==="transparent"&&(Ne.style.fill=this.uiStyleSettings.toolboxAccentColor,Ne.innerHTML=``),ce.appendChild(Ne),ce},u.prototype.setCurrentColor=function(g,M){var J=this;this.currentColor=g,this.colorBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(g)},u}(Ge),Ue=function(){function U(u,g,M){this._state="new",this._isSelected=!1,this._container=u,this._overlayContainer=g,this.globalSettings=M,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(U.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),U.prototype.ownsTarget=function(u){return!1},Object.defineProperty(U.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),U.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},U.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},U.prototype.pointerDown=function(u,g){},U.prototype.dblClick=function(u,g){},U.prototype.manipulate=function(u){},U.prototype.pointerUp=function(u){this.stateChanged()},U.prototype.dispose=function(){},U.prototype.addMarkerVisualToContainer=function(u){this.container.childNodes.length>0?this.container.insertBefore(u,this.container.childNodes[0]):this.container.appendChild(u)},U.prototype.getState=function(){return{typeName:U.typeName,state:this.state,notes:this.notes}},U.prototype.restoreState=function(u){this._state=u.state,this.notes=u.notes},U.prototype.scale=function(u,g){},U.prototype.colorChanged=function(u){this.onColorChanged&&this.onColorChanged(u),this.stateChanged()},U.prototype.fillColorChanged=function(u){this.onFillColorChanged&&this.onFillColorChanged(u),this.stateChanged()},U.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var u=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),u.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(u)&&this.onStateChanged(this)}},U.typeName="MarkerBase",U}(),Re=function(){function U(){this.findGripByVisual=this.findGripByVisual.bind(this)}return U.prototype.findGripByVisual=function(u){return this.topLeft.ownsTarget(u)?this.topLeft:this.topCenter.ownsTarget(u)?this.topCenter:this.topRight.ownsTarget(u)?this.topRight:this.centerLeft.ownsTarget(u)?this.centerLeft:this.centerRight.ownsTarget(u)?this.centerRight:this.bottomLeft.ownsTarget(u)?this.bottomLeft:this.bottomCenter.ownsTarget(u)?this.bottomCenter:this.bottomRight.ownsTarget(u)?this.bottomRight:void 0},U}(),st=function(){function U(){this.GRIP_SIZE=10,this.visual=ne.createGroup(),this.visual.appendChild(ne.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ne.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return U.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},U}(),Je=function(){function U(){}return U.toITransformMatrix=function(u){return{a:u.a,b:u.b,c:u.c,d:u.d,e:u.e,f:u.f}},U.toSVGMatrix=function(u,g){return u.a=g.a,u.b=g.b,u.c=g.c,u.d=g.d,u.e=g.e,u.f=g.f,u},U}(),Qe=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.left=0,F.top=0,F.width=0,F.height=0,F.defaultSize={x:50,y:20},F.offsetX=0,F.offsetY=0,F.rotationAngle=0,F.CB_DISTANCE=10,F._suppressMarkerCreateEvent=!1,F.container.transform.baseVal.appendItem(ne.createTransform()),F.setupControlBox(),F}return _e(u,U),Object.defineProperty(u.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"visual",{get:function(){return this._visual},set:function(g){this._visual=g;var M=ne.createTransform();this._visual.transform.baseVal.appendItem(M)},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(g){return!!U.prototype.ownsTarget.call(this,g)||!!(this.controlGrips.findGripByVisual(g)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(g))},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.state==="new"&&(this.left=g.x,this.top=g.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var J=this.unrotatePoint(g);if(this.manipulationStartX=J.x,this.manipulationStartY=J.y,this.offsetX=J.x-this.left,this.offsetY=J.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 F=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=F.x-this.width/2,this.top=F.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ce=this.container.transform.baseVal.getItem(0);ce.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ce,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},u.prototype.pointerUp=function(g){var M=this.state;U.prototype.pointerUp.call(this,g),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(g),this._state="select",M==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},u.prototype.moveVisual=function(g){this.visual.style.transform="translate("+g.x+"px, "+g.y+"px)"},u.prototype.manipulate=function(g){var M=this.unrotatePoint(g);this.state==="creating"?this.resize(g):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(g)},u.prototype.resize=function(g){var M=this.manipulationStartLeft,J=this.manipulationStartWidth,F=this.manipulationStartTop,ce=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:M=this.manipulationStartLeft+g.x-this.manipulationStartX,J=this.manipulationStartWidth+this.manipulationStartLeft-M;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:J=this.manipulationStartWidth+g.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:F=this.manipulationStartTop+g.y-this.manipulationStartY,ce=this.manipulationStartHeight+this.manipulationStartTop-F;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ce=this.manipulationStartHeight+g.y-this.manipulationStartY}J>=0?(this.left=M,this.width=J):(this.left=M+J,this.width=-J),ce>=0?(this.top=F,this.height=ce):(this.top=F+ce,this.height=-ce),this.setSize()},u.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},u.prototype.rotate=function(g){if(Math.abs(g.x-this.centerX)>.1){var M=Math.sign(g.x-this.centerX);this.rotationAngle=180*Math.atan((g.y-this.centerY)/(g.x-this.centerX))/Math.PI+90*M,this.applyRotation()}},u.prototype.applyRotation=function(){var g=this.container.transform.baseVal.getItem(0);g.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(g,0)},u.prototype.rotatePoint=function(g){if(this.rotationAngle===0)return g;var M=this.container.getCTM(),J=ne.createPoint(g.x,g.y);return{x:(J=J.matrixTransform(M)).x,y:J.y}},u.prototype.unrotatePoint=function(g){if(this.rotationAngle===0)return g;var M=this.container.getCTM();M=M.inverse();var J=ne.createPoint(g.x,g.y);return{x:(J=J.matrixTransform(M)).x,y:J.y}},u.prototype.select=function(){U.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){U.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=ne.createGroup();var g=ne.createTransform();g.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(g),this.container.appendChild(this.controlBox),this.controlRect=ne.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=ne.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 Re,this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){var g=this.controlBox.transform.baseVal.getItem(0);g.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(g,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()},u.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()},u.prototype.createGrip=function(){var g=new st;return g.visual.transform.baseVal.appendItem(ne.createTransform()),this.controlBox.appendChild(g.visual),g},u.prototype.positionGrips=function(){var g=this.controlGrips.topLeft.GRIP_SIZE,M=-g/2,J=M,F=(this.width+this.CB_DISTANCE)/2-g/2,ce=(this.height+this.CB_DISTANCE)/2-g/2,Ne=this.height+this.CB_DISTANCE-g/2,rt=this.width+this.CB_DISTANCE-g/2;this.positionGrip(this.controlGrips.topLeft.visual,M,J),this.positionGrip(this.controlGrips.topCenter.visual,F,J),this.positionGrip(this.controlGrips.topRight.visual,rt,J),this.positionGrip(this.controlGrips.centerLeft.visual,M,ce),this.positionGrip(this.controlGrips.centerRight.visual,rt,ce),this.positionGrip(this.controlGrips.bottomLeft.visual,M,Ne),this.positionGrip(this.controlGrips.bottomCenter.visual,F,Ne),this.positionGrip(this.controlGrips.bottomRight.visual,rt,Ne),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,F,J-3*this.CB_DISTANCE)},u.prototype.positionGrip=function(g,M,J){var F=g.transform.baseVal.getItem(0);F.setTranslate(M,J),g.transform.baseVal.replaceItem(F,0)},u.prototype.hideControlBox=function(){this.controlBox.style.display="none"},u.prototype.showControlBox=function(){this.controlBox.style.display=""},u.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Je.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Je.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},U.prototype.getState.call(this))},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var M=g;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(Je.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,M.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Je.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,M.containerTransformMatrix))},u.prototype.scale=function(g,M){U.prototype.scale.call(this,g,M);var J=this.rotatePoint({x:this.left,y:this.top}),F=this.unrotatePoint({x:J.x*g,y:J.y*M});this.left=F.x,this.top=F.y,this.width=this.width*g,this.height=this.height*M,this.adjustControlBox()},u}(Ue),nt=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.fillColor="transparent",F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.opacity=1,F.setStrokeColor=F.setStrokeColor.bind(F),F.setFillColor=F.setFillColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.createVisual=F.createVisual.bind(F),F}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual)},u.prototype.createVisual=function(){this.visual=ne.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)},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},u.prototype.manipulate=function(g){U.prototype.manipulate.call(this,g)},u.prototype.resize=function(g){U.prototype.resize.call(this,g),this.setSize()},u.prototype.setSize=function(){U.prototype.setSize.call(this),ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(g){U.prototype.pointerUp.call(this,g),this.setSize()},u.prototype.setStrokeColor=function(g){this.strokeColor=g,this.visual&&ne.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(g),this.stateChanged()},u.prototype.setFillColor=function(g){this.fillColor=g,this.visual&&ne.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},u.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.visual&&ne.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.visual&&ne.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},U.prototype.getState.call(this))},u.prototype.restoreState=function(g){var M=g;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),U.prototype.restoreState.call(this,g),this.setSize()},u.prototype.scale=function(g,M){U.prototype.scale.call(this,g,M),this.setSize()},u.title="Rectangle marker",u}(Qe),bt=function(U){function u(g,M,J,F){var ce=U.call(this,g,F||'')||this;return ce.widths=[],ce.widthBoxes=[],ce.widths=M,ce.currentWidth=J,ce.setCurrentWidth=ce.setCurrentWidth.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.widths.forEach(function(J){var F=document.createElement("div");F.style.display="flex",F.style.flexGrow="2",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=J===g.currentWidth?g.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){g.setCurrentWidth(J,F)}),M.appendChild(F);var ce=document.createElement("div");ce.innerText=J.toString(),ce.style.marginRight="5px",F.appendChild(ce);var Ne=document.createElement("div");Ne.style.minHeight="20px",Ne.style.flexGrow="2",Ne.style.display="flex",Ne.style.alignItems="center";var rt=document.createElement("hr");rt.style.minWidth="20px",rt.style.border="0px",rt.style.borderTop=J+"px solid "+g.uiStyleSettings.toolboxColor,rt.style.flexGrow="2",Ne.appendChild(rt),F.appendChild(Ne),g.widthBoxes.push(F)}),M},u.prototype.setCurrentWidth=function(g,M){var J=this;this.currentWidth=g,this.widthBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},u}(Ge),at=function(U){function u(g,M,J,F){var ce=U.call(this,g,F||'')||this;return ce.styles=[],ce.styleBoxes=[],ce.styles=M,ce.currentStyle=J,ce.setCurrentStyle=ce.setCurrentStyle.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,M=document.createElement("div");return M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2",this.styles.forEach(function(J){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/g.styles.length-5+"%",F.style.borderColor=J===g.currentStyle?g.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){g.setCurrentStyle(J,F)}),M.appendChild(F);var ce=document.createElement("div");ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.overflow="hidden";var Ne=``;ce.innerHTML=Ne,F.appendChild(ce),g.styleBoxes.push(F)}),M},u.prototype.setCurrentStyle=function(g,M){var J=this;this.currentStyle=g,this.styleBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},u}(Ge),ht=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new je("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new bt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new at("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return _e(u,U),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.typeName="FrameMarker",u.title="Frame marker",u.icon='',u}(nt),Ae=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},gt=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.x1=0,F.y1=0,F.x2=0,F.y2=0,F.defaultLength=50,F.manipulationStartX=0,F.manipulationStartY=0,F.manipulationStartX1=0,F.manipulationStartY1=0,F.manipulationStartX2=0,F.manipulationStartY2=0,F.setupControlBox(),F}return _e(u,U),u.prototype.ownsTarget=function(g){return!!U.prototype.ownsTarget.call(this,g)||!(!this.grip1.ownsTarget(g)&&!this.grip2.ownsTarget(g))},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.manipulationStartX=g.x,this.manipulationStartY=g.y,this.state==="new"&&(this.x1=g.x,this.y1=g.y,this.x2=g.x,this.y2=g.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")},u.prototype.pointerUp=function(g){var M=this.state;U.prototype.pointerUp.call(this,g),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(g),this._state="select",M==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},u.prototype.adjustVisual=function(){},u.prototype.manipulate=function(g){this.state==="creating"?this.resize(g):this.state==="move"?(this.x1=this.manipulationStartX1+g.x-this.manipulationStartX,this.y1=this.manipulationStartY1+g.y-this.manipulationStartY,this.x2=this.manipulationStartX2+g.x-this.manipulationStartX,this.y2=this.manipulationStartY2+g.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(g)},u.prototype.resize=function(g){switch(this.activeGrip){case this.grip1:this.x1=g.x,this.y1=g.y;break;case this.grip2:case void 0:this.x2=g.x,this.y2=g.y}this.adjustVisual(),this.adjustControlBox()},u.prototype.select=function(){U.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},u.prototype.deselect=function(){U.prototype.deselect.call(this),this.controlBox.style.display="none"},u.prototype.setupControlBox=function(){this.controlBox=ne.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},u.prototype.adjustControlBox=function(){this.positionGrips()},u.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},u.prototype.createGrip=function(){var g=new st;return g.visual.transform.baseVal.appendItem(ne.createTransform()),this.controlBox.appendChild(g.visual),g},u.prototype.positionGrips=function(){var g=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-g/2,this.y1-g/2),this.positionGrip(this.grip2.visual,this.x2-g/2,this.y2-g/2)},u.prototype.positionGrip=function(g,M,J){var F=g.transform.baseVal.getItem(0);F.setTranslate(M,J),g.transform.baseVal.replaceItem(F,0)},u.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},U.prototype.getState.call(this))},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var M=g;this.x1=M.x1,this.y1=M.y1,this.x2=M.x2,this.y2=M.y2},u.prototype.scale=function(g,M){U.prototype.scale.call(this,g,M),this.x1=this.x1*g,this.y1=this.y1*M,this.x2=this.x2*g,this.y2=this.y2*M,this.adjustVisual(),this.adjustControlBox()},u}(Ue),dt=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new je("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new bt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new at("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.selectorLine&&g!==this.visibleLine)},u.prototype.createVisual=function(){this.visual=ne.createGroup(),this.selectorLine=ne.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ne.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)},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},u.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()),ne.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ne.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setStrokeColor=function(g){this.strokeColor=g,this.adjustVisual(),this.colorChanged(g)},u.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.adjustVisual()},u.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.adjustVisual(),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var M=g;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.createVisual(),this.adjustVisual()},u.typeName="LineMarker",u.title="Line marker",u.icon='',u}(gt),De=function(U){function u(g,M,J,F){var ce=U.call(this,g,F||'')||this;return ce.fonts=[],ce.fontBoxes=[],ce.fonts=M,ce.currentFont=J,ce.setCurrentFont=ce.setCurrentFont.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=this,M=document.createElement("div");return M.style.overflow="hidden",M.style.flexGrow="2",this.fonts.forEach(function(J){var F=document.createElement("div");F.style.display="inline-block",F.style.alignItems="center",F.style.justifyContent="space-between",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.overflow="hidden",F.style.maxWidth=100/g.fonts.length-5+"%",F.style.borderColor=J===g.currentFont?g.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){g.setCurrentFont(J,F)}),M.appendChild(F);var ce=document.createElement("div");ce.style.display="flex",ce.style.minHeight="20px",ce.style.flexGrow="2",ce.style.fontFamily=J,ce.style.overflow="hidden";var Ne=document.createElement("div");Ne.style.whiteSpace="nowrap",Ne.style.overflow="hidden",Ne.style.textOverflow="ellipsis",Ne.innerHTML="The quick brown fox jumps over the lazy dog",ce.appendChild(Ne),F.appendChild(ce),g.fontBoxes.push(F)}),M},u.prototype.setCurrentFont=function(g,M){var J=this;this.currentFont=g,this.fontBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},u}(Ge),We=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.color="transparent",F.padding=5,F.DEFAULT_TEXT="your text here",F.text=F.DEFAULT_TEXT,F.isMoved=!1,F.color=J.defaultColor,F.fontFamily=J.defaultFontFamily,F.defaultSize={x:100,y:30},F.setColor=F.setColor.bind(F),F.setFont=F.setFont.bind(F),F.renderText=F.renderText.bind(F),F.sizeText=F.sizeText.bind(F),F.textEditDivClicked=F.textEditDivClicked.bind(F),F.showTextEditor=F.showTextEditor.bind(F),F.setSize=F.setSize.bind(F),F.positionTextEditor=F.positionTextEditor.bind(F),F.colorPanel=new je("Color",J.defaultColorSet,J.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.fontFamilyPanel=new De("Font",J.defaultFontFamilies,J.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F}return _e(u,U),u.prototype.ownsTarget=function(g){if(U.prototype.ownsTarget.call(this,g)||g===this.visual||g===this.textElement||g===this.bgRectangle)return!0;var M=!1;return this.textElement.childNodes.forEach(function(J){J===g&&(M=!0)}),M},u.prototype.createVisual=function(){this.visual=ne.createGroup(),this.bgRectangle=ne.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ne.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ne.createTransform()),this.textElement.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.isMoved=!1,this.pointerDownPoint=g,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},u.prototype.renderText=function(){var g=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){g.textElement.appendChild(ne.createTSpan(M.trim()===""?" ":M.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},u.prototype.getTextScale=function(){var g=this.textElement.getBBox(),M=1;if(g.width>0&&g.height>0){var J=(1*this.width-this.width*this.padding*2/100)/g.width,F=(1*this.height-this.height*this.padding*2/100)/g.height;M=Math.min(J,F)}return M},u.prototype.getTextPosition=function(g){var M=this.textElement.getBBox(),J=0,F=0;return M.width>0&&M.height>0&&(J=(this.width-M.width*g)/2,F=this.height/2-M.height*g/2),{x:J,y:F}},u.prototype.sizeText=function(){var g=this.textElement.getBBox(),M=this.getTextScale(),J=this.getTextPosition(M);J.y-=g.y*M,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+J.x+"px, "+J.y+"px) scale("+M+", "+M+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(J.x,J.y),this.textElement.transform.baseVal.getItem(1).setScale(M,M))},u.prototype.manipulate=function(g){U.prototype.manipulate.call(this,g),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(g.x-this.pointerDownPoint.x)>5||Math.abs(g.y-this.pointerDownPoint.y)>5)},u.prototype.resize=function(g){U.prototype.resize.call(this,g),this.isMoved=!0,this.setSize(),this.sizeText()},u.prototype.setSize=function(){U.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},u.prototype.pointerUp=function(g){var M=this.state;M==="creating"&&(this._suppressMarkerCreateEvent=!0),U.prototype.pointerUp.call(this,g),this.setSize(),(M==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},u.prototype.showTextEditor=function(){var g=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(g.textEditor.style.fontSize);g.textEditor.clientWidth>=Number.parseInt(g.textEditor.style.maxWidth)&&M>.9;)M-=.1,g.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 J=M.clipboardData.getData("text"),F=window.getSelection();if(!F.rangeCount)return!1;F.deleteFromDocument(),F.getRangeAt(0).insertNode(document.createTextNode(J)),M.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){g.textEditDivClicked(g.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},u.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var g=this.getTextScale(),M=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),J=this.textElement.getBBox(),F={x:J.width*g,y:J.height*g};M.x-=F.x/2,M.y-=F.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*g,12)+"px",this.textElement.style.display="none"}},u.prototype.textEditDivClicked=function(g){this.text=g.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},u.prototype.select=function(){U.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},u.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),U.prototype.deselect.call(this)},u.prototype.dblClick=function(g,M){U.prototype.dblClick.call(this,g,M),this.showTextEditor()},u.prototype.setColor=function(g){this.textElement&&ne.setAttributes(this.textElement,[["fill",g]]),this.color=g,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(g)},u.prototype.setFont=function(g){this.textElement&&ne.setAttributes(this.textElement,[["font-family",g]]),this.fontFamily=g,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},u.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},u.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){var M=g;this.color=M.color,this.fontFamily=M.fontFamily,this.padding=M.padding,this.text=M.text,this.createVisual(),U.prototype.restoreState.call(this,g),this.setSize()},u.prototype.scale=function(g,M){U.prototype.scale.call(this,g,M),this.setSize(),this.sizeText(),this.positionTextEditor()},u.typeName="TextMarker",u.title="Text marker",u.icon='',u}(Qe),ge=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.color="transparent",F.lineWidth=3,F.drawing=!1,F.pixelRatio=1,F.color=J.defaultColor,F.lineWidth=J.defaultStrokeWidth,F.pixelRatio=J.freehandPixelRatio,F.setColor=F.setColor.bind(F),F.addCanvas=F.addCanvas.bind(F),F.finishCreation=F.finishCreation.bind(F),F.setLineWidth=F.setLineWidth.bind(F),F.colorPanel=new je("Color",J.defaultColorSet,J.defaultColor),F.colorPanel.onColorChanged=F.setColor,F.lineWidthPanel=new bt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.lineWidthPanel.onWidthChanged=F.setLineWidth,F}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.drawingImage)},u.prototype.createVisual=function(){this.visual=ne.createGroup(),this.drawingImage=ne.createImage(),this.visual.appendChild(this.drawingImage);var g=ne.createTransform();this.visual.transform.baseVal.appendItem(g),this.addMarkerVisualToContainer(this.visual)},u.prototype.pointerDown=function(g,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(g.x,g.y),this.drawing=!0):U.prototype.pointerDown.call(this,g,M)},u.prototype.manipulate=function(g){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(g.x,g.y),this.canvasContext.stroke()):U.prototype.manipulate.call(this,g)},u.prototype.resize=function(g){U.prototype.resize.call(this,g),ne.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},u.prototype.pointerUp=function(g){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):U.prototype.pointerUp.call(this,g)},u.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)},u.prototype.select=function(){this.state==="creating"&&this.finishCreation(),U.prototype.select.call(this)},u.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),U.prototype.deselect.call(this)},u.prototype.finishCreation=function(){for(var g=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),M=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],J=M[0],F=M[1],ce=M[2],Ne=M[3],rt=!1,Tt=0;Tt0&&(rt=!0,TtNe&&(Ne=Tt),Be>ce&&(ce=Be));if(rt){this.left=J/this.pixelRatio,this.top=F/this.pixelRatio,this.width=(ce-J)/this.pixelRatio,this.height=(Ne-F)/this.pixelRatio;var kt=document.createElement("canvas");kt.width=ce-J,kt.height=Ne-F,kt.getContext("2d").putImageData(this.canvasContext.getImageData(J,F,ce-J,Ne-F),0,0),this.drawingImgUrl=kt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},u.prototype.setDrawingImage=function(){ne.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ne.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},u.prototype.setColor=function(g){this.color=g,this.colorChanged(g)},u.prototype.setLineWidth=function(g){this.lineWidth=g},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({drawingImgUrl:this.drawingImgUrl},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){this.createVisual(),U.prototype.restoreState.call(this,g),this.drawingImgUrl=g.drawingImgUrl,this.setDrawingImage()},u.prototype.scale=function(g,M){U.prototype.scale.call(this,g,M),this.setDrawingImage()},u.typeName="FreehandMarker",u.title="Freehand marker",u.icon='',u}(Qe),de=function(U){function u(g,M,J){var F=U.call(this,g,J||'')||this;return F.typeBoxes=[],F.currentType=M,F.setCurrentType=F.setCurrentType.bind(F),F}return _e(u,U),u.prototype.getUi=function(){var g=this,M=document.createElement("div");M.style.display="flex",M.style.overflow="hidden",M.style.flexGrow="2";for(var J=function(Ne){var rt="both";switch(Ne){case 0:rt="both";break;case 1:rt="start";break;case 2:rt="end";break;case 3:rt="none"}var Tt=document.createElement("div");if(Tt.style.display="flex",Tt.style.flexGrow="2",Tt.style.alignItems="center",Tt.style.justifyContent="space-between",Tt.style.padding="5px",Tt.style.borderWidth="2px",Tt.style.borderStyle="solid",Tt.style.borderColor=rt===F.currentType?F.uiStyleSettings.toolboxAccentColor:"transparent",Tt.addEventListener("click",function(){g.setCurrentType(rt,Tt)}),M.appendChild(Tt),rt==="both"||rt==="start"){var Be=document.createElement("div");Be.style.display="flex",Be.style.alignItems="center",Be.style.minHeight="20px",Be.innerHTML=``,Be.style.marginLeft="5px",Tt.appendChild(Be)}var kt=document.createElement("div");kt.style.display="flex",kt.style.alignItems="center",kt.style.minHeight="20px",kt.style.flexGrow="2";var er=document.createElement("hr");if(er.style.minWidth="20px",er.style.border="0px",er.style.borderTop="3px solid "+(F.uiStyleSettings!==void 0?F.uiStyleSettings.toolboxColor:"#eeeeee"),er.style.flexGrow="2",kt.appendChild(er),Tt.appendChild(kt),rt==="both"||rt==="end"){var fr=document.createElement("div");fr.style.display="flex",fr.style.alignItems="center",fr.style.minHeight="20px",fr.innerHTML=``,fr.style.marginRight="5px",Tt.appendChild(fr)}F.typeBoxes.push(Tt)},F=this,ce=0;ce<4;ce++)J(ce);return M},u.prototype.setCurrentType=function(g,M){var J=this;this.currentType=g,this.typeBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings!==void 0?J.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},u}(Ge),pe=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.arrowType="end",F.arrowBaseHeight=10,F.arrowBaseWidth=10,F.getArrowPoints=F.getArrowPoints.bind(F),F.setArrowType=F.setArrowType.bind(F),F.arrowTypePanel=new de("Arrow type","end"),F.arrowTypePanel.onArrowTypeChanged=F.setArrowType,F}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.arrow1&&g!==this.arrow2)},u.prototype.getArrowPoints=function(g,M){var J=this.arrowBaseWidth+2*this.strokeWidth,F=this.arrowBaseHeight+2*this.strokeWidth;return g-J/2+","+(M+F/2)+" "+g+","+(M-F/2)+" "+(g+J/2)+","+(M+F/2)},u.prototype.createTips=function(){this.arrow1=ne.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ne.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ne.createTransform()),this.visual.appendChild(this.arrow2)},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(U.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",ne.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ne.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var g=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(g,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(M,0);var J=this.arrow2.transform.baseVal.getItem(0);J.setRotate(g+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(J,0)}},u.prototype.setArrowType=function(g){this.arrowType=g,this.adjustVisual(),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({arrowType:this.arrowType},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var M=g;this.arrowType=M.arrowType,this.createTips(),this.adjustVisual()},u.typeName="ArrowMarker",u.title="Arrow marker",u.icon='',u}(dt),ee=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.fillColor=J.defaultFillColor,F.strokeWidth=0,F.fillPanel=new je("Color",J.defaultColorSet,J.defaultFillColor),F.fillPanel.onColorChanged=F.setFillColor,F}return _e(u,U),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.typeName="CoverMarker",u.title="Cover marker",u.icon='',u}(nt),te=function(U){function u(g,M,J,F){var ce=U.call(this,g,F||'')||this;return ce.opacities=[],ce.opacityBoxes=[],ce.opacities=M,ce.currentOpacity=J,ce.setCurrentOpacity=ce.setCurrentOpacity.bind(ce),ce}return _e(u,U),u.prototype.getUi=function(){var g=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(J){var F=document.createElement("div");F.style.display="flex",F.style.alignItems="center",F.style.justifyContent="center",F.style.padding="5px",F.style.borderWidth="2px",F.style.borderStyle="solid",F.style.borderColor=J===g.currentOpacity?g.uiStyleSettings.toolboxAccentColor:"transparent",F.addEventListener("click",function(){g.setCurrentOpacity(J,F)}),M.appendChild(F);var ce=document.createElement("div");ce.innerText=100*J+"%",F.appendChild(ce),g.opacityBoxes.push(F)}),M},u.prototype.setCurrentOpacity=function(g,M){var J=this;this.currentOpacity=g,this.opacityBoxes.forEach(function(F){F.style.borderColor=F===M?J.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},u}(Ge),ie=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.setOpacity=F.setOpacity.bind(F),F.fillColor=J.defaultHighlightColor,F.strokeWidth=0,F.opacity=J.defaultHighlightOpacity,F.fillPanel=new je("Color",J.defaultColorSet,F.fillColor),F.fillPanel.onColorChanged=F.setFillColor,F.opacityPanel=new te("Opacity",J.defaultOpacitySteps,F.opacity),F.opacityPanel.onOpacityChanged=F.setOpacity,F}return _e(u,U),u.prototype.setOpacity=function(g){this.opacity=g,this.visual&&ne.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.typeName="HighlightMarker",u.title="Highlight marker",u.icon='',u}(ee),se='',ue=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.bgColor="transparent",F.tipPosition={x:0,y:0},F.tipBase1Position={x:0,y:0},F.tipBase2Position={x:0,y:0},F.tipMoving=!1,F.color=J.defaultStrokeColor,F.bgColor=J.defaultFillColor,F.fontFamily=J.defaultFontFamily,F.defaultSize={x:100,y:30},F.setBgColor=F.setBgColor.bind(F),F.getTipPoints=F.getTipPoints.bind(F),F.positionTip=F.positionTip.bind(F),F.setTipPoints=F.setTipPoints.bind(F),F.colorPanel=new je("Text color",J.defaultColorSet,F.color,''),F.colorPanel.onColorChanged=F.setColor,F.bgColorPanel=new je("Fill color",J.defaultColorSet,F.bgColor,se),F.bgColorPanel.onColorChanged=F.setBgColor,F.fontFamilyPanel=new De("Font",J.defaultFontFamilies,J.defaultFontFamily),F.fontFamilyPanel.onFontChanged=F.setFont,F.tipGrip=new st,F.tipGrip.visual.transform.baseVal.appendItem(ne.createTransform()),F.controlBox.appendChild(F.tipGrip.visual),F}return _e(u,U),u.prototype.ownsTarget=function(g){return U.prototype.ownsTarget.call(this,g)||this.tipGrip.ownsTarget(g)||this.tip===g},u.prototype.createTip=function(){ne.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ne.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},u.prototype.pointerDown=function(g,M){this.state==="new"&&U.prototype.pointerDown.call(this,g,M),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(M)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):U.prototype.pointerDown.call(this,g,M)},u.prototype.pointerUp=function(g){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,U.prototype.pointerUp.call(this,g);else{var M=this.state==="creating";U.prototype.pointerUp.call(this,g),this.setTipPoints(M),this.positionTip()}},u.prototype.manipulate=function(g){if(this.tipMoving){var M=this.unrotatePoint(g);this.tipPosition={x:M.x-this.manipulationStartLeft,y:M.y-this.manipulationStartTop},this.positionTip()}else U.prototype.manipulate.call(this,g)},u.prototype.setBgColor=function(g){this.bgRectangle&&this.tip&&(ne.setAttributes(this.bgRectangle,[["fill",g]]),ne.setAttributes(this.tip,[["fill",g]])),this.bgColor=g,this.fillColorChanged(g)},u.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},u.prototype.setTipPoints=function(g){g===void 0&&(g=!1);var M=Math.min(this.height/2,15),J=this.height/5;g&&(this.tipPosition={x:M+J/2,y:this.height+20});var F=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?F',u}(We),Se=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.fillColor="transparent",F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.opacity=1,F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.fillColor=J.defaultFillColor,F.setStrokeColor=F.setStrokeColor.bind(F),F.setFillColor=F.setFillColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.setOpacity=F.setOpacity.bind(F),F.createVisual=F.createVisual.bind(F),F.strokePanel=new je("Line color",me(J.defaultColorSet,["transparent"]),J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.fillPanel=new je("Fill color",me(J.defaultColorSet,["transparent"]),F.fillColor,se),F.fillPanel.onColorChanged=F.setFillColor,F.strokeWidthPanel=new bt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new at("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F.opacityPanel=new te("Opacity",J.defaultOpacitySteps,F.opacity),F.opacityPanel.onOpacityChanged=F.setOpacity,F}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual)},u.prototype.createVisual=function(){this.visual=ne.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)},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.state==="new"&&(this.createVisual(),this.moveVisual(g),this._state="creating")},u.prototype.manipulate=function(g){U.prototype.manipulate.call(this,g)},u.prototype.resize=function(g){U.prototype.resize.call(this,g),this.setSize()},u.prototype.setSize=function(){U.prototype.setSize.call(this),ne.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},u.prototype.pointerUp=function(g){U.prototype.pointerUp.call(this,g),this.setSize()},u.prototype.setStrokeColor=function(g){this.strokeColor=g,this.visual&&ne.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(g),this.stateChanged()},u.prototype.setFillColor=function(g){this.fillColor=g,this.visual&&ne.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(g),this.stateChanged()},u.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.visual&&ne.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},u.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.visual&&ne.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},u.prototype.setOpacity=function(g){this.opacity=g,this.visual&&ne.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){var M=g;this.fillColor=M.fillColor,this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.opacity=M.opacity,this.createVisual(),U.prototype.restoreState.call(this,g),this.setSize()},u.prototype.scale=function(g,M){U.prototype.scale.call(this,g,M),this.setSize()},u.typeName="EllipseMarker",u.title="Ellipse marker",u.icon='',u}(Qe),Pe=function(U){function u(g,M,J){return U.call(this,g,M,J)||this}return _e(u,U),Object.defineProperty(u.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.tip1&&g!==this.tip2)},u.prototype.createTips=function(){this.tip1=ne.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(ne.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ne.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(ne.createTransform()),this.visual.appendChild(this.tip2)},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.state==="creating"&&this.createTips()},u.prototype.adjustVisual=function(){if(U.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ne.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()]]),ne.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 g=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(g,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(M,0);var J=this.tip2.transform.baseVal.getItem(0);J.setRotate(g+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(J,0)}},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g),this.createTips(),this.adjustVisual()},u.typeName="MeasurementMarker",u.title="Measurement marker",u.icon='',u}(dt),Ze=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.strokePanel.colors=J.defaultColorSet,F.fillColor="transparent",F}return _e(u,U),Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=U.prototype.getState.call(this);return g.typeName=u.typeName,g},u.typeName="EllipseFrameMarker",u.title="Ellipse frame marker",u.icon='',u}(Se),qe=function(){function U(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(U.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),U.prototype.addUndoStep=function(u){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(u)||(this.undoStack.push(u),JSON.stringify(this.lastRedoStep)!==JSON.stringify(u)&&this.redoStack.splice(0,this.redoStack.length))},U.prototype.replaceLastUndoStep=function(u){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=u)},U.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},U.prototype.undo=function(){if(this.undoStack.length>1){var u=this.undoStack.pop();return u!==void 0&&this.redoStack.push(u),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},U.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},U}(),Et=function(U){function u(g,M,J){var F=U.call(this,g,M,J)||this;return F.strokeColor="transparent",F.strokeWidth=0,F.strokeDasharray="",F.curveX=0,F.curveY=0,F.manipulationStartCurveX=0,F.manipulationStartCurveY=0,F.setStrokeColor=F.setStrokeColor.bind(F),F.setStrokeWidth=F.setStrokeWidth.bind(F),F.setStrokeDasharray=F.setStrokeDasharray.bind(F),F.positionGrips=F.positionGrips.bind(F),F.addControlGrips=F.addControlGrips.bind(F),F.adjustVisual=F.adjustVisual.bind(F),F.setupControlBox=F.setupControlBox.bind(F),F.resize=F.resize.bind(F),F.strokeColor=J.defaultColor,F.strokeWidth=J.defaultStrokeWidth,F.strokeDasharray=J.defaultStrokeDasharray,F.strokePanel=new je("Line color",J.defaultColorSet,J.defaultColor),F.strokePanel.onColorChanged=F.setStrokeColor,F.strokeWidthPanel=new bt("Line width",J.defaultStrokeWidths,J.defaultStrokeWidth),F.strokeWidthPanel.onWidthChanged=F.setStrokeWidth,F.strokeStylePanel=new at("Line style",J.defaultStrokeDasharrays,J.defaultStrokeDasharray),F.strokeStylePanel.onStyleChanged=F.setStrokeDasharray,F}return _e(u,U),u.prototype.ownsTarget=function(g){return!(!U.prototype.ownsTarget.call(this,g)&&g!==this.visual&&g!==this.selectorCurve&&g!==this.visibleCurve&&!this.curveGrip.ownsTarget(g))},u.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},u.prototype.createVisual=function(){this.visual=ne.createGroup(),this.selectorCurve=ne.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ne.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)},u.prototype.pointerDown=function(g,M){U.prototype.pointerDown.call(this,g,M),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=g.x,this.curveY=g.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(M)&&(this.activeGrip=this.curveGrip,this._state="resize")},u.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ne.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ne.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ne.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},u.prototype.setupControlBox=function(){U.prototype.setupControlBox.call(this),this.curveControlLine1=ne.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ne.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)},u.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,U.prototype.addControlGrips.call(this)},u.prototype.positionGrips=function(){U.prototype.positionGrips.call(this);var g=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-g/2,this.curveY-g/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()))},u.prototype.manipulate=function(g){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+g.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+g.y-this.manipulationStartY),U.prototype.manipulate.call(this,g)},u.prototype.resize=function(g){this.activeGrip===this.curveGrip&&(this.curveX=g.x,this.curveY=g.y),U.prototype.resize.call(this,g),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},u.prototype.setStrokeColor=function(g){this.strokeColor=g,this.adjustVisual(),this.colorChanged(g)},u.prototype.setStrokeWidth=function(g){this.strokeWidth=g,this.adjustVisual()},u.prototype.setStrokeDasharray=function(g){this.strokeDasharray=g,this.adjustVisual()},u.prototype.scale=function(g,M){this.curveX=this.curveX*g,this.curveY=this.curveY*M,U.prototype.scale.call(this,g,M)},Object.defineProperty(u.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),u.prototype.getState=function(){var g=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},U.prototype.getState.call(this));return g.typeName=u.typeName,g},u.prototype.restoreState=function(g){U.prototype.restoreState.call(this,g);var M=g;this.strokeColor=M.strokeColor,this.strokeWidth=M.strokeWidth,this.strokeDasharray=M.strokeDasharray,this.curveX=M.curveX,this.curveY=M.curveY,this.createVisual(),this.adjustVisual()},u.typeName="CurveMarker",u.title="Curve marker",u.icon='',u}(gt),Pt=function(){function U(u,g){g===void 0&&(g=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=u,this.cancelable=g}return Object.defineProperty(U.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),U.prototype.preventDefault=function(){this._defaultPrevented=!0},U}(),et=function(U){function u(g,M,J){var F=U.call(this,g,!1)||this;return F.dataUrl=M,F.state=J,F}return _e(u,U),u}(Pt),ct=function(U){function u(g,M,J){J===void 0&&(J=!1);var F=U.call(this,g,J)||this;return F.marker=M,F}return _e(u,U),u}(Pt),Ft=function(){function U(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return U.prototype.addEventListener=function(u,g){this[u].push(g)},U.prototype.removeEventListener=function(u,g){var M=this[u].indexOf(g);M>-1&&this[u].splice(M,1)},U}(),Ct=function(){function U(u){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ae,this._isOpen=!1,this.undoRedoManager=new qe,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 Ft,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=U.instanceCounter++,this.styles=new Xe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=u,this.targetRoot=document.body,this.width=u.clientWidth,this.height=u.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(U.prototype,"ALL_MARKER_TYPES",{get:function(){return[ht,ge,pe,We,Ze,Se,ie,ue,Pe,ee,dt,Et]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ht,ge,pe,We,Se,ie,ue]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ht,ge,pe,We,ie]},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(u){var g=this;this._availableMarkerTypes.splice(0),u.forEach(function(M){if(typeof M=="string"){var J=g.ALL_MARKER_TYPES.find(function(F){return F.typeName===M});J!==void 0&&g._availableMarkerTypes.push(J)}else g._availableMarkerTypes.push(M)})},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(u){this._zoomLevel=u,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),U.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),we.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},U.prototype.show=function(){var u=this;this.styles.styleSheetRoot===void 0&&Ye.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Ye.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(g){return g(new Pt(u))})},U.prototype.render=function(){return Te(this,void 0,void 0,function(){var u;return Ce(this,function(g){switch(g.label){case 0:return this.setCurrentMarker(),(u=new tt).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.markersOnly=this.renderMarkersOnly,u.width=this.renderWidth,u.height=this.renderHeight,[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return g.sent(),[4,u.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,g.sent()]}})})},U.prototype.close=function(u){var g=this;if(u===void 0&&(u=!1),this.isOpen){var M=!1;u||this.eventListeners.beforeclose.forEach(function(J){var F=new Pt(g,!0);J(F),F.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(J){return J(new Pt(g))}),this.detachEvents(),this._isOpen=!1)}},U.prototype.addMarkersToToolbar=function(){for(var u,g=[],M=0;Mthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*u:this.editorCanvas.clientWidth,M=g',u.title="Powered by marker.js",u.style.display="grid",u.style.alignItems="center",u.style.justifyItems="center",u.style.padding="3px",u.style.width="20px",u.style.height="20px",this.logoUI.appendChild(u),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},U.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},U.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},U.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},U.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var u=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Me(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(u),1),u.dispose()},U.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},U.prototype.toolbarButtonClicked=function(u,g){if(u==="marker"&&g!==void 0)this.createNewMarker(g);else if(u==="action")switch(g){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},U.prototype.deleteSelectedMarker=function(){var u=this;if(this._currentMarker!==void 0){var g=!1;if(this.eventListeners.markerbeforedelete.forEach(function(J){var F=new ct(u,u._currentMarker,!0);J(F),F.defaultPrevented&&(g=!0)}),!g){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(J){return J(new ct(u,M))})}}},U.prototype.clear=function(){var u=this,g=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ce){var Ne=new ct(u,void 0,!0);ce(Ne),Ne.defaultPrevented&&(g=!0)}),!g)){this.setCurrentMarker();for(var M=function(ce){var Ne=J.markers[ce];J.setCurrentMarker(J.markers[ce]),J._currentMarker.dispose(),J.markerImage.removeChild(J._currentMarker.container),J.markers.splice(J.markers.indexOf(J._currentMarker),1),J.eventListeners.markerdelete.forEach(function(rt){return rt(new ct(u,Ne))})},J=this,F=this.markers.length-1;F>=0;F--)M(F);this.addUndoStep()}},Object.defineProperty(U.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),U.prototype.showNotesEditor=function(){var u;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=(u=this._currentMarker.notes)!==null&&u!==void 0?u:"",this.overlayContainer.appendChild(this.notesArea))},U.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},U.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},U.prototype.addUndoStep=function(){var u=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var g=this.getState(),M=this.undoRedoManager.getLastUndoStep();if(!M||M.width===g.width&&M.height===g.height){var J=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(g),J1&&this.panTo({x:u.clientX,y:u.clientY}))},U.prototype.onPointerUp=function(u){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(u.clientX,u.clientY)),this.isDragging=!1,this.addUndoStep()},U.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},U.prototype.onKeyUp=function(u){this._currentMarker===void 0||this.notesArea!==void 0||u.key!=="Delete"&&u.key!=="Backspace"||this.deleteSelectedMarker()},U.prototype.clientToLocalCoordinates=function(u,g){var M=this.markerImage.getBoundingClientRect();return{x:(u-M.left)/this.zoomLevel,y:(g-M.top)/this.zoomLevel}},U.prototype.onWindowResize=function(){this.positionUI()},U.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var u=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},U.prototype.addLicenseKey=function(u){we.addKey(u)},U.prototype.addEventListener=function(u,g){this.eventListeners.addEventListener(u,g)},U.prototype.removeEventListener=function(u,g){this.eventListeners.removeEventListener(u,g)},U.prototype.renderState=function(u){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(u),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(U.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),U.prototype.focus=function(){var u=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(g){return g(new Pt(u))}))},U.prototype.blur=function(){var u=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(g){return g(new Pt(u))}))},U.instanceCounter=0,U}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var jt=function(U,u){return(jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,M){g.__proto__=M}||function(g,M){for(var J in M)Object.prototype.hasOwnProperty.call(M,J)&&(g[J]=M[J])})(U,u)};function $t(U,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function g(){this.constructor=U}jt(U,u),U.prototype=u===null?Object.create(u):(g.prototype=u.prototype,new g)}function Lt(U,u,g,M){return new(g||(g=Promise))(function(J,F){function ce(Tt){try{rt(M.next(Tt))}catch(Be){F(Be)}}function Ne(Tt){try{rt(M.throw(Tt))}catch(Be){F(Be)}}function rt(Tt){var Be;Tt.done?J(Tt.value):(Be=Tt.value,Be instanceof g?Be:new g(function(kt){kt(Be)})).then(ce,Ne)}rt((M=M.apply(U,u||[])).next())})}function Qt(U,u){var g,M,J,F,ce={label:0,sent:function(){if(1&J[0])throw J[1];return J[1]},trys:[],ops:[]};return F={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function Ne(rt){return function(Tt){return function(Be){if(g)throw new TypeError("Generator is already executing.");for(;ce;)try{if(g=1,M&&(J=2&Be[0]?M.return:Be[0]?M.throw||((J=M.return)&&J.call(M),0):M.next)&&!(J=J.call(M,Be[1])).done)return J;switch(M=0,J&&(Be=[2&Be[0],J.value]),Be[0]){case 0:case 1:J=Be;break;case 4:return ce.label++,{value:Be[1],done:!1};case 5:ce.label++,M=Be[1],Be=[0];continue;case 7:Be=ce.ops.pop(),ce.trys.pop();continue;default:if(!(J=ce.trys,(J=J.length>0&&J[J.length-1])||Be[0]!==6&&Be[0]!==2)){ce=0;continue}if(Be[0]===3&&(!J||Be[1]>J[0]&&Be[1]0&&g>0){var M=new nr(u,g),J=M.ratio>=1?20:M.getHorizontalLength(20),F=M.ratio<1?20:M.getVerticalLength(20),ce=document.createElementNS("http://www.w3.org/2000/svg","svg");ce.setAttribute("xmlns","http://www.w3.org/2000/svg"),ce.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ce);var Ne=pt.createDefs();ce.appendChild(Ne);var rt=pt.createElement("clipPath",[["id","text-bg-clip"]]);Ne.appendChild(rt);var Tt=pt.createPath(pt.getHollowRectanglePath((24-J)/2,(24-F)/2,J,F,(24-J)/2+2,(24-F)/2+2,J-4,F-4));ce.appendChild(Tt);var Be=pt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Be.appendChild(pt.createTSpan(u+":"+g)),ce.appendChild(Be);var kt=Be.getBBox();pt.setAttributes(Be,[["x",((24-kt.width)/2).toString()],["y",((24-kt.height)/2-kt.y).toString()]]);var er=pt.createPath(pt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(kt.width))/2,(24-Math.ceil(kt.height))/2,Math.ceil(kt.width),Math.ceil(kt.height)));return rt.appendChild(er),pt.setAttributes(Tt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ce),ce.outerHTML}return''},U}(),qt=function(U){function u(g,M,J){var F=U.call(this,g,M)||this;return F.isDropdownOpen=!1,F.onClick=F.dropdownButtonClicked,F.dropdownButtons=J,F}return $t(u,U),u.prototype.setupDropdown=function(){var g=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=g.className,M.colorsClassName=g.colorsClassName,g.dropdownBlock.appendChild(M.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},u.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},u.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},u.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},u.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},u.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},u}(it),Wt=function(){function U(u,g){this.GRIP_SIZE=10,this.color=u,this.fillColor=g,this.visual=pt.createGroup(),this.visual.appendChild(pt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(pt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return U.prototype.ownsTarget=function(u){return u===this.visual||u===this.visual.childNodes[0]||u===this.visual.childNodes[1]},U.prototype.setCenter=function(u,g){this.visual.childNodes.forEach(function(M){return pt.setAttributes(M,[["cx",u.toString()],["cy",g.toString()]])})},U}(),Tr=function(){function U(u,g,M,J){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=u,this.canvasHeight=g,this.margin=M,this.container=J,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(U.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(u){this._aspectRatio=u,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.gridContainer&&pt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(u){this._zoomFactor=u,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),U.prototype.open=function(){var u=this;this.cropShadeElement=pt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=pt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var g=0;gthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-g.height/2),pt.setAttributes(this.cropRectElement,[["x",g.x.toString()],["y",g.y.toString()],["width",g.width.toString()],["height",g.height.toString()]]);var M=g.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(F,ce){var Ne=g.y+M*(ce+1);pt.setAttributes(F,[["x1",""+g.x],["y1",""+Ne],["x2",""+(g.x+g.width)],["y2",""+Ne]])});var J=g.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(F,ce){var Ne=g.x+J*(ce+1);pt.setAttributes(F,[["x1",""+Ne],["y1",""+g.y],["x2",""+Ne],["y2",""+(g.y+g.height)]])}),pt.setAttributes(this.cropShadeElement,[["d",pt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,g.x,g.y,g.width,g.height)]]),this.topLeftGrip.setCenter(g.x,g.y),this.topRightGrip.setCenter(g.x+g.width,g.y),this.bottomLeftGrip.setCenter(g.x,g.y+g.height),this.bottomRightGrip.setCenter(g.x+g.width,g.y+g.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},U.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},U.prototype.clientToLocalCoordinates=function(u,g){var M=this.container.getBoundingClientRect();return{x:u-M.left+this.margin,y:g-M.top+this.margin}},U.prototype.onPointerDown=function(u){this.container.setPointerCapture(u.pointerId),this.previousPoint=this.clientToLocalCoordinates(u.clientX,u.clientY),this.cropRectElement===u.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(u.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(u.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(u.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(u.target)&&(this.activeGrip=this.bottomRightGrip)},U.prototype.onPointerMove=function(u){if(this.isMoving)this.move(this.clientToLocalCoordinates(u.clientX,u.clientY));else if(this.activeGrip){var g=this.clientToLocalCoordinates(u.clientX,u.clientY);this.resize(g)}u.preventDefault()},U.prototype.onPointerUp=function(u){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(u.pointerId)},U.prototype.move=function(u){var g=u.x-this.previousPoint.x,M=u.y-this.previousPoint.y;this.zoomFactor!==1&&(g=-g/this.zoomFactor,M=-M/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+g),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=u},U.prototype.resize=function(u){var g=Object.assign({},this.cropRect),M=u.x-this.previousPoint.x,J=u.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:g.x+Mthis.canvasWidth*this.zoomFactor&&(M=this.canvasWidth*this.zoomFactor-g.width),g.width+=M}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(g.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(M),g.height=this.aspectRatio.getVerticalLength(g.width)):(g.y+=J,g.height=this.cropRect.y+this.cropRect.height-g.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?g.height=this.aspectRatio.getVerticalLength(g.width):g.height+=J}g.width<10&&(g.x=this.cropRect.x,g.width=10),g.height<10&&(g.y=this.cropRect.y,g.height=10),this.previousPoint=u,g.x>=this.margin&&g.y>=this.margin&&g.x-this.margin+g.width<=this.canvasWidth&&g.y-this.margin+g.height<=this.canvasHeight&&(this.cropRect=g,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},U.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var u=this.cropRect.x+this.cropRect.width/2,g=this.cropRect.y+this.cropRect.height/2,M=this.aspectRatio.getHorizontalLength(this.cropRect.height),J=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=u-this.cropRect.width/2,this.cropRect.y=g-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},U.prototype.getRescaledRect=function(u,g,M,J,F,ce){var Ne=M/u,rt=J/g;return{x:(F.x-ce)*Ne+ce,y:(F.y-ce)*rt+ce,width:F.width*Ne,height:F.height*rt}},U.prototype.scaleCanvas=function(u,g){var M=this.getRescaledRect(this.canvasWidth,this.canvasHeight,u,g,this.cropRect,this.margin);this.canvasWidth=u,this.canvasHeight=g,this.onCropChange&&this.onCropChange(M),this.setCropRectangle(M)},U}(),ir=function(){function U(u){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=u,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(U.prototype,"angle",{get:function(){return this._angle},set:function(u){this._angle=u,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),U.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},U.prototype.onPointerDown=function(u){this.controlContainer.setPointerCapture(u.pointerId),this.isDragging=!0,this.previousPoint={x:u.clientX,y:u.clientY}},U.prototype.onPointerMove=function(u){this.isDragging&&(this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.previousPoint.x=u.clientX)},U.prototype.onPointerUp=function(u){this.isDragging&&this.onAngleChange&&this.onAngleChange((u.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(u.pointerId)},U.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var u=this.angleLabelText.getBBox();pt.setAttributes(this.angleLabelElement,[["x",((this.width-u.width)/2).toString()],["y",(this.height/2).toString()]])}},U.prototype.positionScaleShape=function(){if(this.scaleShape){var u=this.scaleShape.transform.baseVal.getItem(0);u.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(u,0)}},U.prototype.getVisual=function(){var u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.setAttribute("xmlns","http://www.w3.org/2000/svg"),u.setAttribute("width",this.width+"px"),u.setAttribute("height",this.height+"px"),u.setAttribute("viewBox","0 0 "+this.width+" "+this.height),u.style.flexShrink="0",document.body.appendChild(u);for(var g="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,M=1;M<=this.width/5+10;M++){var J=M%5==0?this.height/3:this.height/6;g+="h4v"+-J+"h1v"+J}g+="v1H0Z",this.scaleShape=pt.createPath(g);var F=pt.createTransform();this.scaleShape.transform.baseVal.appendItem(F),u.appendChild(this.scaleShape),this.angleLabelElement=pt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=pt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ce=pt.createTSpan("");return ce.innerHTML="°",this.angleLabelElement.appendChild(ce),u.appendChild(this.angleLabelElement),document.body.removeChild(u),u},U}(),Rt=function(){function U(){this.naturalSize=!1,this.imageType="image/png"}return U.prototype.rasterize=function(u,g,M,J,F,ce,Ne){var rt=this;return new Promise(function(Tt){var Be=document.createElement("canvas");Be.width=u.width.baseVal.value-2*J,Be.height=u.height.baseVal.value-2*J;var kt=1,er=1;rt.naturalSize===!0?(kt=g.naturalWidth/(u.width.baseVal.value-2*J)/ce,er=g.naturalHeight/(u.height.baseVal.value-2*J)/Ne,Be.width=g.naturalWidth/ce,Be.height=g.naturalHeight/Ne):rt.width!==void 0&&rt.height!==void 0&&(kt=rt.width/M.width,er=rt.height/M.height,Be.width*=kt,Be.height*=er);var fr=Be.getContext("2d");fr.translate(Be.width/2,Be.height/2),fr.rotate(F*Math.PI/180),fr.scale(ce,Ne),fr.translate(-Be.width/2,-Be.height/2),fr.drawImage(g,0,0,Be.width,Be.height);var Gr=document.createElement("canvas");Gr.width=M.width*kt,Gr.height=M.height*er,Gr.getContext("2d").putImageData(fr.getImageData((M.x-J)*kt,(M.y-J)*er,M.width*kt,M.height*er),0,0),Tt(Gr.toDataURL(rt.imageType,rt.imageQuality))})},U}(),Ie=function(){function U(u){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=U.instanceCounter++,this.styles=new Xt(this.instanceNo),this.target=u,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(U.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(u){this._zoomToCropEnabled=u,u?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(u){this._isGridVisible=u,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"gridLines",{get:function(){return this._gridLines},set:function(u){this._gridLines=u,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(u){this._rotationAngle=u,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"aspectRatio",{get:function(){var u;return(u=this._aspectRatio)!==null&&u!==void 0?u:this.aspectRatios[0]},set:function(u){this._aspectRatio=u},enumerable:!1,configurable:!0}),U.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},U.prototype.show=function(){this.showUI(),this.open()},U.prototype.close=function(u){u===void 0&&(u=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),u||this.closeEventListeners.forEach(function(g){return g()}),this._isOpen=!1)},U.prototype.addRenderEventListener=function(u){this.renderEventListeners.push(u)},U.prototype.removeRenderEventListener=function(u){this.renderEventListeners.indexOf(u)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(u),1)},U.prototype.addCloseEventListener=function(u){this.closeEventListeners.push(u)},U.prototype.removeCloseEventListener=function(u){this.closeEventListeners.indexOf(u)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(u),1)},U.prototype.setupResizeObserver=function(){var u=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){u.resize(u.target.clientWidth,u.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},U.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var u=1*this.target.clientWidth/this.target.clientHeight,g=this.contentDiv.clientWidth/u>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*u:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,M=g+2*this.CANVAS_MARGINu+this.CANVAS_MARGIN?this.target.offsetTop-(u+this.CANVAS_MARGIN):0;this.coverDiv.style.top=g+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},U.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},U.prototype.addTopToolbar=function(){var u=this;this.topToolbar=new Ut,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 g=new St;g.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(g);var M=[];this.aspectRatios.forEach(function(er){var fr=new it(Vt.getIcon(er.horizontal,er.vertical),er.horizontal===0&&er.vertical===0?"FREE":er.horizontal+":"+er.vertical);fr.onClick=function(){return u.ratioButtonClicked(er)},M.push(fr)}),this.aspectRatioButton=new qt(Vt.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,g.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var J=new it('',"Toggle grid");J.isActive=this.isGridVisible,J.onClick=function(){u.isGridVisible=!u.isGridVisible,J.isActive=u.isGridVisible},g.addButton(J);var F=new it('',"Zoom to selection");if(F.isActive=this.zoomToCropEnabled,F.onClick=function(){u.zoomToCropEnabled=!u.zoomToCropEnabled,F.isActive=u.zoomToCropEnabled},g.addButton(F),!Zt.isLicensed){var ce=new Fe;this.topToolbar.addElementBlock(ce);var Ne=document.createElement("div");Ne.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var rt=document.createElement("a");rt.style.color="currentColor",rt.href="https://markerjs.com/products/cropro",rt.target="_blank",rt.innerHTML='',Ne.appendChild(rt),ce.addElement(Ne)}var Tt=new St;Tt.minWidth=3*this.toolbarHeight+"px",Tt.contentAlign="end",this.topToolbar.addButtonBlock(Tt);var Be=new it('',"OK");Be.onClick=this.startRenderAndClose,Tt.addButton(Be),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Be.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var kt=new it('',"Close");kt.onClick=this.close,Tt.addButton(kt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(kt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},U.prototype.addBottomToolbar=function(){var u=this;this.bottomToolbar=new Ut,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 g=new St;g.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(g);var M=new it('',"Rotate left");M.onClick=this.rotateLeftButtonClicked,g.addButton(M);var J=new it('',"Rotate right");J.onClick=this.rotateRightButtonClicked,g.addButton(J);var F=new Fe;F.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(F),this.straightener=new ir("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(Tt){u.rotateBy(Tt),u.straightener.angle=u.rotationAngle},F.addElement(this.straightener.getUI());var ce=new St;ce.minWidth=2*this.toolbarHeight+"px",ce.contentAlign="end",this.bottomToolbar.addButtonBlock(ce);var Ne=new it('',"Flip horizontal");Ne.onClick=this.flipHorizontallyButtonClicked,ce.addButton(Ne);var rt=new it('',"Flip vertical");rt.onClick=this.flipVerticallyButtonClicked,ce.addButton(rt)},U.prototype.ratioButtonClicked=function(u){this.aspectRatio=u,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},U.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Vt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},U.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new nr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},U.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},U.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},U.prototype.restoreState=function(u){if(u){var g=this.cropLayer.getRescaledRect(u.width,u.height,this.imageWidth,this.imageHeight,u.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(g),this.cropRectChanged(g),this.flippedHorizontally=u.flippedHorizontally,this.flippedVertically=u.flippedVertically,this.applyFlip(),this.rotationAngle=u.rotationAngle,this.applyRotation()}},U.prototype.clientToLocalCoordinates=function(u,g){var M=this.cropImage.getBoundingClientRect();return{x:u-M.left,y:g-M.top}},U.prototype.onWindowResize=function(){this.positionUI()},U.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var u=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=u+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},U.prototype.rotateLeftButtonClicked=function(){var u=this.rotationAngle-90;this.rotationAngle%90!=0&&(u+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(u)},U.prototype.rotateRightButtonClicked=function(){var u=this.rotationAngle+90;this.rotationAngle%90!=0&&(u-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(u)},U.prototype.rotateTo=function(u){u=(u=u>180?u-360:u)<=-180?u+360:u,this.rotationAngle=u,this.applyRotation()},U.prototype.rotateBy=function(u){this.rotateTo((this.rotationAngle+u)%360)},U.prototype.applyRotation=function(){var u=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var g=this.editingTargetRotationContainer.transform.baseVal.getItem(0);g.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(g,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=u},U.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},U.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},U.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},U.prototype.startRenderAndClose=function(){return Lt(this,void 0,void 0,function(){var u,g;return Qt(this,function(M){switch(M.label){case 0:return[4,this.render()];case 1:return u=M.sent(),g=this.getState(),this.renderEventListeners.forEach(function(J){return J(u,g)}),this.close(!0),[2]}})})},U.prototype.render=function(){return Lt(this,void 0,void 0,function(){var u;return Qt(this,function(g){switch(g.label){case 0:return(u=new Rt).naturalSize=this.renderAtNaturalSize,u.imageType=this.renderImageType,u.imageQuality=this.renderImageQuality,u.width=this.renderWidth,u.height=this.renderHeight,this.unzoomFromCrop(),pt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,u.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 g.sent(),[4,u.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,g.sent()]}})})},U.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Gt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var u=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Gt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*u)+`px;
height: `+(this.toolbarHeight-2*u)+`px;
padding: `+u+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new zt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new zt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Gt("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 Gt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*u)+`px;
padding: `+u+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Gt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},U.instanceCounter=0,U}(),xt=re("8hTe"),Pr=re.n(xt),un=/]*>/g;function dn(U){var u=document.createElement("div");return u.innerHTML=U,u.childNodes.length===0?"":u.childNodes[0].nodeValue}var xr=ft.a=function(U){var u=U.value,g=u===void 0?"":u,M=U.edit,J=M===void 0?!1:M,F=U.className,ce=U.showTextOnly,Ne=U.showLines,rt=U.replaces,Tt=U.zoomImg,Be=U.hasMask,kt=U.style,er=kt===void 0?{}:kt,fr=U.stylesPrev,Gr=fr===void 0?{}:fr,Mr=String(g),Ir=Object(P.useRef)(),cn=Object(P.useRef)(),Sn=Object(P.useState)(""),wr=Object(z.a)(Sn,2),ot=wr[0],be=wr[1],Ke=Object(P.useState)("office"),wt=Object(z.a)(Ke,2),mt=wt[0],vt=wt[1],It=function(){var tr=new Ie(cn.current);tr.displayMode="popup",tr.addRenderEventListener(function(){var pr=Object(I.a)(O.a.mark(function Ht(br){var lr;return O.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:return Ir.current.style.display="none",Nr.next=3,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:br}});case 3:lr=Nr.sent,lr!=null&&lr.id&&rt(cn.current.getAttribute("src").replace(oe.a.API_SERVER,""),"/api/attachments/".concat(lr==null?void 0:lr.id,"?type=").concat(lr.content_type));case 5:case"end":return Nr.stop()}},Ht)}));return function(Ht){return pr.apply(this,arguments)}}()),tr.show()},gr=function(){var tr=new Ct(cn.current);tr.settings.displayMode="popup",tr.addEventListener("render",function(){var pr=Object(I.a)(O.a.mark(function Ht(br){var lr;return O.a.wrap(function(Nr){for(;;)switch(Nr.prev=Nr.next){case 0:if(Ir.current.style.display="none",!cn.current){Nr.next=6;break}return Nr.next=4,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:br.dataUrl}});case 4:lr=Nr.sent,lr!=null&&lr.id&&rt(cn.current.getAttribute("src").replace(oe.a.API_SERVER,""),"/api/attachments/".concat(lr==null?void 0:lr.id,"?type=").concat(lr.content_type));case 6:case"end":return Nr.stop()}},Ht)}));return function(Ht){return pr.apply(this,arguments)}}()),tr.show(),window.markerArea=tr},cr=Object(P.useMemo)(function(){Ir.current&&(Ir.current.style.zIndex=-1);try{var or=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,tr=/\"\/api\/attachments\/|\"\/attachments\/download\//g,pr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Mr=Mr.replace(or,"("+oe.a.API_SERVER+"/api/attachments/").replace(tr,'"'+oe.a.API_SERVER+"/api/attachments/").replace(pr,'"'+oe.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(vn){}var Ht=Q(Mr),br=b();if(Mr.match(/\[TOC\]/)&&(Ht=Ht.replace("[TOC]
",l()),C()),Ht=Ht.replace(/(__special_katext_id_\d+__)/g,function(vn,Nr){var Yr=br[Nr],Yn=Yr.type,An=Yr.expression;return Object(fe.renderToString)(dn(An)||"",{displayMode:Yn==="block",throwOnError:!1,output:"html"})}),Ht=Ht.replace(/▁/g,"\u2581\u2581\u2581"),v(),ce){var lr=document.createElement("div");return lr.innerHTML=Ht,lr.innerText}return setTimeout(function(){return Sr()},500),Ht},[Mr]),hr=Object(P.useRef)();y.WebkitLineClamp=Ne,Ne&&(er=Object(N.a)(Object(N.a)({},er),y));function Lr(or){var tr=or.target;if(tr.tagName.toUpperCase()==="IMG"){if(Tt){var pr=tr.getAttribute("src");be(pr),vt("image")}}else if(tr.tagName.toUpperCase()==="A"){var Ht=tr.getAttribute("href");if(Ht.indexOf("office")>-1)or.preventDefault(),be(Ht),vt("office");else if(Ht.indexOf("application/pdf")>-1)or.preventDefault(),be(Ht),vt("pdf");else if(Ht.indexOf("text/html")>-1)or.preventDefault(),be(Ht),vt("html");else if(Ht.startsWith("#")){or.preventDefault();var br=document.getElementById(Ht.replace("#",""));br&&br.scrollIntoView(!0)}}}var Sr=function(){var tr,pr=(tr=hr.current)===null||tr===void 0?void 0:tr.querySelectorAll("video");pr==null||pr.forEach(function(Ht){if(Ht.oncontextmenu=function(){return!1},Ht.src.indexOf(".m3u8")>-1&&!Ht.canPlayType("application/vnd.apple.mpegurl")){if(q.a.isSupported()){var br=new q.a;br.loadSource(Ht.src),br.attachMedia(Ht)}}})};Object(P.useEffect)(function(){if(hr.current&&cr&&(cr.match(un)&&window.PR.prettyPrint()),hr.current)return hr.current.addEventListener("click",Lr),function(){hr.current.removeEventListener("click",Lr),v(),C()}},[cr,hr.current,Lr]);var Wr=function(tr){if(!J)return;tr.target.nodeName==="IMG"?(Ir.current.style.zIndex=1,Ir.current.style.display="flex",Ir.current.style.width=tr.target.clientWidth+"px",Ir.current.style.height=tr.target.clientHeight+"px",Ir.current.style.top=tr.target.offsetTop+"px",Ir.current.style.left=tr.target.offsetLeft+"px",cn.current.src=tr.target.getAttribute("src")):Ir.current.style.display="none"};return E.a.createElement("div",{style:{position:"relative"}},E.a.createElement("div",{ref:hr,style:Object(N.a)({},er),className:"".concat(F||""," markdown-body ").concat(Pr.a.mdBody),onMouseOver:Wr,dangerouslySetInnerHTML:{__html:cr}}),E.a.createElement("div",{ref:Ir,className:Pr.a.button},E.a.createElement($.a,null,E.a.createElement(X.a,{onClick:function(){return It()}},"\u88C1\u526A"),E.a.createElement(X.a,{onClick:function(){return gr()}},"\u7F16\u8F91"))),E.a.createElement("img",{ref:cn,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),E.a.createElement(ve.a,{close:!0,data:ot,type:ot!=null&&ot.length?mt:"",style:Object(N.a)({},Gr),onClose:function(){return be("")}}))}},"9VGf":function(At,ft,re){"use strict";re.d(ft,"a",function(){return R});var ae=re("q1tI"),$=re.n(ae);function R(X,N){var I=Object(ae.useRef)();Object(ae.useEffect)(function(){I.current=X}),Object(ae.useEffect)(function(){function z(){I.current()}if(N!==null){var j=setInterval(z,N);return function(){return clearInterval(j)}}},[N])}},Bd2K:function(At,ft,re){(function(ae){ae(re("VrN/"),re("osHv"))})(function(ae){ae.defineOption("autoCloseTags",!1,function(O,P,E){if(E!=ae.Init&&E&&O.removeKeyMap("autoCloseTags"),!P)return;var L={name:"autoCloseTags"};(typeof P!="object"||P.whenClosing!==!1)&&(L["'/'"]=function(D){return I(D)}),(typeof P!="object"||P.whenOpening!==!1)&&(L["'>'"]=function(D){return X(D)}),O.addKeyMap(L)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],R=["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 X(O){if(O.getOption("disableInput"))return ae.Pass;for(var P=O.listSelections(),E=[],L=O.getOption("autoCloseTags"),D=0;DT.ch&&(d=d.slice(0,d.length-A.end+T.ch));var m=d.toLowerCase();if(!d||A.type=="string"&&(A.end!=T.ch||!/[\"\']/.test(A.string.charAt(A.string.length-1))||A.string.length==1)||A.type=="tag"&&o.close||A.string.indexOf("/")==T.ch-A.start-1||C&&z(C,m)>-1||j(O,w.mode.xmlCurrentContext&&w.mode.xmlCurrentContext(h)||[],d,T,!0))return ae.Pass;var l=typeof L=="object"&&L.emptyTags;if(l&&z(l,d)>-1){E[D]={text:"/>",newPos:ae.Pos(T.line,T.ch+2)};continue}var S=y&&z(y,m)>-1;E[D]={indent:S,text:">"+(S?`
`:"")+""+d+">",newPos:S?ae.Pos(T.line+1,0):ae.Pos(T.line,T.ch+1)}}for(var f=typeof L=="object"&&L.dontIndentOnAutoClose,D=P.length-1;D>=0;D--){var p=E[D];O.replaceRange(p.text,P[D].head,P[D].anchor,"+insert");var s=O.listSelections().slice(0);s[D]={head:p.newPos,anchor:p.newPos},O.setSelections(s),!f&&p.indent&&(O.indentLine(p.newPos.line,null,!0),O.indentLine(p.newPos.line+1,null,!0))}}function N(O,P){for(var E=O.listSelections(),L=[],D=P?"/":"",T=O.getOption("autoCloseTags"),A=typeof T=="object"&&T.dontIndentOnSlash,w=0;w"&&(C+=">"),L[w]=C}if(O.replaceSelections(L),E=O.listSelections(),!A)for(var w=0;w=0&&P[h]==E;h--)++w;L=A.to;for(var h=1;h0){for(var P=0;P1&&arguments[1]!==void 0?arguments[1]:"",P=[],E=0;Ege.length)&&(de=ge.length);for(var pe=0,ee=new Array(de);pe=ge.length?{done:!0}:{done:!1,value:ge[ee++]}}}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 pe=ge[Symbol.iterator](),pe.next.bind(pe)}function I(ge,de){return de={exports:{}},ge(de,de.exports),de.exports}var z=I(function(ge){function de(){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 pe(ee){ge.exports.defaults=ee}ge.exports={defaults:de(),getDefaults:de,changeDefaults:pe}}),j=z.defaults,O=z.getDefaults,P=z.changeDefaults,E=/[&<>"']/,L=/[&<>"']/g,D=/[<>"']|&(?!#?\w+;)/,T=/[<>"']|&(?!#?\w+;)/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"},w=function(de){return A[de]};function h(ge,de){if(de){if(E.test(ge))return ge.replace(L,w)}else if(D.test(ge))return ge.replace(T,w);return ge}var o=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function d(ge){return ge.replace(o,function(de,pe){return pe=pe.toLowerCase(),pe==="colon"?":":pe.charAt(0)==="#"?pe.charAt(1)==="x"?String.fromCharCode(parseInt(pe.substring(2),16)):String.fromCharCode(+pe.substring(1)):""})}var c=/(^|[^\[])\^/g;function C(ge,de){ge=ge.source||ge,de=de||"";var pe={replace:function(te,ie){return ie=ie.source||ie,ie=ie.replace(c,"$1"),ge=ge.replace(te,ie),pe},getRegex:function(){return new RegExp(ge,de)}};return pe}var y=/[^\w:]/g,m=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function l(ge,de,pe){if(ge){var ee;try{ee=decodeURIComponent(d(pe)).replace(y,"").toLowerCase()}catch(te){return null}if(ee.indexOf("javascript:")===0||ee.indexOf("vbscript:")===0||ee.indexOf("data:")===0)return null}de&&!m.test(pe)&&(pe=a(de,pe));try{pe=encodeURI(pe).replace(/%25/g,"%")}catch(te){return null}return pe}var S={},f=/^[^:]+:\/*[^/]*$/,p=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function a(ge,de){S[" "+ge]||(f.test(ge)?S[" "+ge]=ge+"/":S[" "+ge]=k(ge,"/",!0)),ge=S[" "+ge];var pe=ge.indexOf(":")===-1;return de.substring(0,2)==="//"?pe?de:ge.replace(p,"$1")+de:de.charAt(0)==="/"?pe?de:ge.replace(s,"$1")+de:ge+de}var b={exec:function(){}};function v(ge){for(var de=1,pe,ee;de=0&&ue[Pe]==="\\";)Se=!Se;return Se?"|":" |"}),ee=pe.split(/ \|/),te=0;if(ee.length>de)ee.splice(de);else for(;ee.length=ee.length?te.slice(ee.length):te}).join(`
`)}var Ee=function(){function ge(pe){this.options=pe||G}var de=ge.prototype;return de.space=function(ee){var te=this.rules.block.newline.exec(ee);if(te)return te[0].length>1?{type:"space",raw:te[0]}:{raw:`
`}},de.code=function(ee,te){var ie=this.rules.block.code.exec(ee);if(ie){var se=te[te.length-1];if(se&&se.type==="paragraph")return{raw:ie[0],text:ie[0].trimRight()};var ue=ie[0].replace(/^ {4}/gm,"");return{type:"code",raw:ie[0],codeBlockStyle:"indented",text:this.options.pedantic?ue:W(ue,`
`)}}},de.fences=function(ee){var te=this.rules.block.fences.exec(ee);if(te){var ie=te[0],se=ke(ie,te[3]||"");return{type:"code",raw:ie,lang:te[2]?te[2].trim():te[2],text:se}}},de.heading=function(ee){var te=this.rules.block.heading.exec(ee);if(te)return{type:"heading",raw:te[0],depth:te[1].length,text:te[2]}},de.nptable=function(ee){var te=this.rules.block.nptable.exec(ee);if(te){var ie={type:"table",header:q(te[1].replace(/^ *| *\| *$/g,"")),align:te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:te[3]?te[3].replace(/\n$/,"").split(`
`):[],raw:te[0]};if(ie.header.length===ie.align.length){var se=ie.align.length,ue;for(ue=0;ue ?/gm,"");return{type:"blockquote",raw:te[0],text:ie}}},de.list=function(ee){var te=this.rules.block.list.exec(ee);if(te){for(var ie=te[0],se=te[2],ue=se.length>1,Se=se[se.length-1]===")",Pe={type:"list",raw:ie,ordered:ue,start:ue?+se.slice(0,-1):"",loose:!1,items:[]},Ze=te[0].match(this.rules.block.item),qe=!1,Et,Pt,et,ct,Ft,Ct,jt,$t=Ze.length,Lt=0;Lt<$t;Lt++)Et=Ze[Lt],ie=Et,Pt=Et.length,Et=Et.replace(/^ *([*+-]|\d+[.)]) */,""),~Et.indexOf(`
`)&&(Pt-=Et.length,Et=this.options.pedantic?Et.replace(/^ {1,4}/gm,""):Et.replace(new RegExp("^ {1,"+Pt+"}","gm"),"")),Lt!==$t-1&&(et=this.rules.block.bullet.exec(Ze[Lt+1])[0],(ue?et.length===1||!Se&&et[et.length-1]===")":et.length>1||this.options.smartLists&&et!==se)&&(ct=Ze.slice(Lt+1).join(`
`),Pe.raw=Pe.raw.substring(0,Pe.raw.length-ct.length),Lt=$t-1)),Ft=qe||/\n\n(?!\s*$)/.test(Et),Lt!==$t-1&&(qe=Et.charAt(Et.length-1)===`
`,Ft||(Ft=qe)),Ft&&(Pe.loose=!0),Ct=/^\[[ xX]\] /.test(Et),jt=void 0,Ct&&(jt=Et[1]!==" ",Et=Et.replace(/^\[[ xX]\] +/,"")),Pe.items.push({type:"list_item",raw:ie,task:Ct,checked:jt,loose:Ft,text:Et});return Pe}},de.html=function(ee){var te=this.rules.block.html.exec(ee);if(te)return{type:this.options.sanitize?"paragraph":"html",raw:te[0],pre:!this.options.sanitizer&&(te[1]==="pre"||te[1]==="script"||te[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(te[0]):oe(te[0]):te[0]}},de.def=function(ee){var te=this.rules.block.def.exec(ee);if(te){te[3]&&(te[3]=te[3].substring(1,te[3].length-1));var ie=te[1].toLowerCase().replace(/\s+/g," ");return{tag:ie,raw:te[0],href:te[2],title:te[3]}}},de.table=function(ee){var te=this.rules.block.table.exec(ee);if(te){var ie={type:"table",header:q(te[1].replace(/^ *| *\| *$/g,"")),align:te[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:te[3]?te[3].replace(/\n$/,"").split(`
`):[]};if(ie.header.length===ie.align.length){ie.raw=te[0];var se=ie.align.length,ue;for(ue=0;ue/i.test(se[0])&&(te=!1),!ie&&/^<(pre|code|kbd|script)(\s|>)/i.test(se[0])?ie=!0:ie&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(se[0])&&(ie=!1),{type:this.options.sanitize?"text":"html",raw:se[0],inLink:te,inRawBlock:ie,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):oe(se[0]):se[0]}},de.link=function(ee){var te=this.rules.inline.link.exec(ee);if(te){var ie=fe(te[2],"()");if(ie>-1){var se=te[0].indexOf("!")===0?5:4,ue=se+te[1].length+ie;te[2]=te[2].substring(0,ie),te[0]=te[0].substring(0,ue).trim(),te[3]=""}var Se=te[2],Pe="";if(this.options.pedantic){var Ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Se);Ze?(Se=Ze[1],Pe=Ze[3]):Pe=""}else Pe=te[3]?te[3].slice(1,-1):"";Se=Se.trim().replace(/^<([\s\S]*)>$/,"$1");var qe=ve(te,{href:Se&&Se.replace(this.rules.inline._escapes,"$1"),title:Pe&&Pe.replace(this.rules.inline._escapes,"$1")},te[0]);return qe}},de.reflink=function(ee,te){var ie;if((ie=this.rules.inline.reflink.exec(ee))||(ie=this.rules.inline.nolink.exec(ee))){var se=(ie[2]||ie[1]).replace(/\s+/g," ");if(se=te[se.toLowerCase()],!se||!se.href){var ue=ie[0].charAt(0);return{type:"text",raw:ue,text:ue}}var Se=ve(ie,se,ie[0]);return Se}},de.strong=function(ee,te,ie){ie===void 0&&(ie="");var se=this.rules.inline.strong.start.exec(ee);if(se&&(!se[1]||se[1]&&(ie===""||this.rules.inline.punctuation.exec(ie)))){te=te.slice(-1*ee.length);var ue=se[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ue.lastIndex=0;for(var Se;(se=ue.exec(te))!=null;)if(Se=this.rules.inline.strong.middle.exec(te.slice(0,se.index+3)),Se)return{type:"strong",raw:ee.slice(0,Se[0].length),text:ee.slice(2,Se[0].length-2)}}},de.em=function(ee,te,ie){ie===void 0&&(ie="");var se=this.rules.inline.em.start.exec(ee);if(se&&(!se[1]||se[1]&&(ie===""||this.rules.inline.punctuation.exec(ie)))){te=te.slice(-1*ee.length);var ue=se[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ue.lastIndex=0;for(var Se;(se=ue.exec(te))!=null;)if(Se=this.rules.inline.em.middle.exec(te.slice(0,se.index+2)),Se)return{type:"em",raw:ee.slice(0,Se[0].length),text:ee.slice(1,Se[0].length-1)}}},de.codespan=function(ee){var te=this.rules.inline.code.exec(ee);if(te){var ie=te[2].replace(/\n/g," "),se=/[^ ]/.test(ie),ue=ie.startsWith(" ")&&ie.endsWith(" ");return se&&ue&&(ie=ie.substring(1,ie.length-1)),ie=oe(ie,!0),{type:"codespan",raw:te[0],text:ie}}},de.br=function(ee){var te=this.rules.inline.br.exec(ee);if(te)return{type:"br",raw:te[0]}},de.del=function(ee){var te=this.rules.inline.del.exec(ee);if(te)return{type:"del",raw:te[0],text:te[1]}},de.autolink=function(ee,te){var ie=this.rules.inline.autolink.exec(ee);if(ie){var se,ue;return ie[2]==="@"?(se=oe(this.options.mangle?te(ie[1]):ie[1]),ue="mailto:"+se):(se=oe(ie[1]),ue=se),{type:"link",raw:ie[0],text:se,href:ue,tokens:[{type:"text",raw:se,text:se}]}}},de.url=function(ee,te){var ie;if(ie=this.rules.inline.url.exec(ee)){var se,ue;if(ie[2]==="@")se=oe(this.options.mangle?te(ie[0]):ie[0]),ue="mailto:"+se;else{var Se;do Se=ie[0],ie[0]=this.rules.inline._backpedal.exec(ie[0])[0];while(Se!==ie[0]);se=oe(ie[0]),ie[1]==="www."?ue="http://"+se:ue=se}return{type:"link",raw:ie[0],text:se,href:ue,tokens:[{type:"text",raw:se,text:se}]}}},de.inlineText=function(ee,te,ie){var se=this.rules.inline.text.exec(ee);if(se){var ue;return te?ue=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(se[0]):oe(se[0]):se[0]:ue=oe(this.options.smartypants?ie(se[0]):se[0]),{type:"text",raw:se[0],text:ue}}},ge}(),_e=Q.noopTest,Te=Q.edit,Ce=Q.merge,me={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:_e,table:_e,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=Te(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,me.item=Te(me.item,"gm").replace(/bull/g,me.bullet).getRegex(),me.list=Te(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._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",me._comment=//,me.html=Te(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=Te(me._paragraph).replace("hr",me.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",me._tag).getRegex(),me.blockquote=Te(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=Ce({},me),me.gfm=Ce({},me.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*|$)"}),me.gfm.nptable=Te(me.gfm.nptable).replace("hr",me.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",me._tag).getRegex(),me.gfm.table=Te(me.gfm.table).replace("hr",me.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",me._tag).getRegex(),me.pedantic=Ce({},me.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._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:_e,paragraph:Te(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:_e,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:_e,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ne.punctuation=Te(ne.punctuation).replace(/punctuation/g,ne._punctuation).getRegex(),ne._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ne._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ne.em.start=Te(ne.em.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.middle=Te(ne.em.middle).replace(/punctuation/g,ne._punctuation).replace(/overlapSkip/g,ne._overlapSkip).getRegex(),ne.em.endAst=Te(ne.em.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.em.endUnd=Te(ne.em.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.start=Te(ne.strong.start).replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.middle=Te(ne.strong.middle).replace(/punctuation/g,ne._punctuation).replace(/blockSkip/g,ne._blockSkip).getRegex(),ne.strong.endAst=Te(ne.strong.endAst,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.strong.endUnd=Te(ne.strong.endUnd,"g").replace(/punctuation/g,ne._punctuation).getRegex(),ne.blockSkip=Te(ne._blockSkip,"g").getRegex(),ne.overlapSkip=Te(ne._overlapSkip,"g").getRegex(),ne._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ne._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])?)+(?![-_])/,ne.autolink=Te(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex(),ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ne.tag=Te(ne.tag).replace("comment",me._comment).replace("attribute",ne._attribute).getRegex(),ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ne._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ne.link=Te(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex(),ne.reflink=Te(ne.reflink).replace("label",ne._label).getRegex(),ne.reflinkSearch=Te(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex(),ne.normal=Ce({},ne),ne.pedantic=Ce({},ne.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()}),ne.gfm=Ce({},ne.normal,{escape:Te(ne.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&&(ee="x"+ee.toString(16)),de+=""+ee+";";return de}var Me=function(){function ge(pe){this.tokens=[],this.tokens.links=Object.create(null),this.options=pe||tt,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ee={block:Ye.normal,inline:Xe.normal};this.options.pedantic?(ee.block=Ye.pedantic,ee.inline=Xe.pedantic):this.options.gfm&&(ee.block=Ye.gfm,this.options.breaks?ee.inline=Xe.breaks:ee.inline=Xe.gfm),this.tokenizer.rules=ee}ge.lex=function(ee,te){var ie=new ge(te);return ie.lex(ee)};var de=ge.prototype;return de.lex=function(ee){return ee=ee.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ee,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function(ee,te,ie){te===void 0&&(te=[]),ie===void 0&&(ie=!0),ee=ee.replace(/^ +$/gm,"");for(var se,ue,Se,Pe;ee;){if(se=this.tokenizer.space(ee)){ee=ee.substring(se.raw.length),se.type&&te.push(se);continue}if(se=this.tokenizer.code(ee,te)){ee=ee.substring(se.raw.length),se.type?te.push(se):(Pe=te[te.length-1],Pe.raw+=`
`+se.raw,Pe.text+=`
`+se.text);continue}if(se=this.tokenizer.fences(ee)){ee=ee.substring(se.raw.length),te.push(se);continue}if(se=this.tokenizer.heading(ee)){ee=ee.substring(se.raw.length),te.push(se);continue}if(se=this.tokenizer.nptable(ee)){ee=ee.substring(se.raw.length),te.push(se);continue}if(se=this.tokenizer.hr(ee)){ee=ee.substring(se.raw.length),te.push(se);continue}if(se=this.tokenizer.blockquote(ee)){ee=ee.substring(se.raw.length),se.tokens=this.blockTokens(se.text,[],ie),te.push(se);continue}if(se=this.tokenizer.list(ee)){for(ee=ee.substring(se.raw.length),Se=se.items.length,ue=0;ue0)for(;(Ze=this.tokenizer.rules.inline.reflinkSearch.exec(Pe))!=null;)qe.includes(Ze[0].slice(Ze[0].lastIndexOf("[")+1,-1))&&(Pe=Pe.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+Pe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ze=this.tokenizer.rules.inline.blockSkip.exec(Pe))!=null;)Pe=Pe.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+Pe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ee;){if(Se=this.tokenizer.escape(ee)){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(Se=this.tokenizer.tag(ee,ie,se)){ee=ee.substring(Se.raw.length),ie=Se.inLink,se=Se.inRawBlock,te.push(Se);continue}if(Se=this.tokenizer.link(ee)){ee=ee.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,se)),te.push(Se);continue}if(Se=this.tokenizer.reflink(ee,this.tokens.links)){ee=ee.substring(Se.raw.length),Se.type==="link"&&(Se.tokens=this.inlineTokens(Se.text,[],!0,se)),te.push(Se);continue}if(Se=this.tokenizer.strong(ee,Pe,ue)){ee=ee.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ie,se),te.push(Se);continue}if(Se=this.tokenizer.em(ee,Pe,ue)){ee=ee.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ie,se),te.push(Se);continue}if(Se=this.tokenizer.codespan(ee)){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(Se=this.tokenizer.br(ee)){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(Se=this.tokenizer.del(ee)){ee=ee.substring(Se.raw.length),Se.tokens=this.inlineTokens(Se.text,[],ie,se),te.push(Se);continue}if(Se=this.tokenizer.autolink(ee,Le)){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(!ie&&(Se=this.tokenizer.url(ee,Le))){ee=ee.substring(Se.raw.length),te.push(Se);continue}if(Se=this.tokenizer.inlineText(ee,se,Ve)){ee=ee.substring(Se.raw.length),ue=Se.raw.slice(-1),te.push(Se);continue}if(ee){var Et="Infinite loop on byte: "+ee.charCodeAt(0);if(this.options.silent){console.error(Et);break}else throw new Error(Et)}}return te},$(ge,null,[{key:"rules",get:function(){return{block:Ye,inline:Xe}}}]),ge}(),He=z.defaults,Ge=Q.cleanUrl,je=Q.escape,Ue=function(){function ge(pe){this.options=pe||He}var de=ge.prototype;return de.code=function(ee,te,ie){var se=(te||"").match(/\S*/)[0];if(this.options.highlight){var ue=this.options.highlight(ee,se);ue!=null&&ue!==ee&&(ie=!0,ee=ue)}return se?''+(ie?ee:je(ee,!0))+`
`:""+(ie?ee:je(ee,!0))+`
`},de.blockquote=function(ee){return`
`+ee+`
`},de.html=function(ee){return ee},de.heading=function(ee,te,ie,se){return this.options.headerIds?"
`:""+ee+"
`},de.hr=function(){return this.options.xhtml?`
`:`
`},de.list=function(ee,te,ie){var se=te?"ol":"ul",ue=te&&ie!==1?' start="'+ie+'"':"";return"<"+se+ue+`>
`+ee+""+se+`>
`},de.listitem=function(ee){return""+ee+`
`},de.checkbox=function(ee){return" "},de.paragraph=function(ee){return""+ee+`
`},de.table=function(ee,te){return te&&(te=""+te+""),`
`},de.tablerow=function(ee){return`
`+ee+`
`},de.tablecell=function(ee,te){var ie=te.header?"th":"td",se=te.align?"<"+ie+' align="'+te.align+'">':"<"+ie+">";return se+ee+""+ie+`>
`},de.strong=function(ee){return""+ee+""},de.em=function(ee){return""+ee+""},de.codespan=function(ee){return""+ee+""},de.br=function(){return this.options.xhtml?"
":"
"},de.del=function(ee){return""+ee+""},de.link=function(ee,te,ie){if(ee=Ge(this.options.sanitize,this.options.baseUrl,ee),ee===null)return ie;var se='"+ie+"",se},de.image=function(ee,te,ie){if(ee=Ge(this.options.sanitize,this.options.baseUrl,ee),ee===null)return ie;var se='
":">",se},de.text=function(ee){return ee},ge}(),Re=function(){function ge(){}var de=ge.prototype;return de.strong=function(ee){return ee},de.em=function(ee){return ee},de.codespan=function(ee){return ee},de.del=function(ee){return ee},de.html=function(ee){return ee},de.text=function(ee){return ee},de.link=function(ee,te,ie){return""+ie},de.image=function(ee,te,ie){return""+ie},de.br=function(){return""},ge}(),st=function(){function ge(){this.seen={}}var de=ge.prototype;return de.slug=function(ee){var te=ee.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(te)){var ie=te;do this.seen[ie]++,te=ie+"-"+this.seen[ie];while(this.seen.hasOwnProperty(te))}return this.seen[te]=0,te},ge}(),Je=z.defaults,Qe=Q.unescape,nt=function(){function ge(pe){this.options=pe||Je,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Re,this.slugger=new st}ge.parse=function(ee,te){var ie=new ge(te);return ie.parse(ee)};var de=ge.prototype;return de.parse=function(ee,te){te===void 0&&(te=!0);var ie="",se,ue,Se,Pe,Ze,qe,Et,Pt,et,ct,Ft,Ct,jt,$t,Lt,Qt,Zt,pt,Xt=ee.length;for(se=0;se0&&Lt.tokens[0].type==="text"?(Lt.tokens[0].text=pt+" "+Lt.tokens[0].text,Lt.tokens[0].tokens&&Lt.tokens[0].tokens.length>0&&Lt.tokens[0].tokens[0].type==="text"&&(Lt.tokens[0].tokens[0].text=pt+" "+Lt.tokens[0].tokens[0].text)):Lt.tokens.unshift({type:"text",text:pt}):$t+=pt),$t+=this.parse(Lt.tokens,jt),et+=this.renderer.listitem($t,Zt,Qt);ie+=this.renderer.list(et,Ft,Ct);continue}case"html":{ie+=this.renderer.html(ct.text);continue}case"paragraph":{ie+=this.renderer.paragraph(this.parseInline(ct.tokens));continue}case"text":{for(et=ct.tokens?this.parseInline(ct.tokens):ct.text;se+1An error occurred:
"+ht(Se.message+"",!0)+"
";throw Se}}De.options=De.setOptions=function(ge){return bt(De.defaults,ge),gt(De.defaults),De},De.getDefaults=Ae,De.defaults=dt,De.use=function(ge){var de=bt({},ge);if(ge.renderer&&function(){var ee=De.defaults.renderer||new Ue,te=function(ue){var Se=ee[ue];ee[ue]=function(){for(var Pe=arguments.length,Ze=new Array(Pe),qe=0;qe`,triples:"",explode:"[]{}"},R=ae.Pos;ae.defineOption("autoCloseBrackets",!1,function(A,w,h){h&&h!=ae.Init&&(A.removeKeyMap(N),A.state.closeBrackets=null),w&&(I(X(w,"pairs")),A.state.closeBrackets=w,A.addKeyMap(N))});function X(A,w){return w=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[w]!=null?A[w]:$[w]}var N={Backspace:O,Enter:P};function I(A){for(var w=0;w=0;d--){var C=o[d].head;A.replaceRange("",R(C.line,C.ch-1),R(C.line,C.ch+1),"+delete")}}function P(A){var w=j(A),h=w&&X(w,"explode");if(!h||A.getOption("disableInput"))return ae.Pass;for(var o=A.listSelections(),d=0;d0;return{anchor:new R(A.anchor.line,A.anchor.ch+(w?-1:1)),head:new R(A.head.line,A.head.ch+(w?1:-1))}}function L(A,w){var h=j(A);if(!h||A.getOption("disableInput"))return ae.Pass;var o=X(h,"pairs"),d=o.indexOf(w);if(d==-1)return ae.Pass;for(var c=X(h,"closeBefore"),C=X(h,"triples"),y=o.charAt(d+1)==w,m=A.listSelections(),l=d%2==0,S,f=0;f=0&&A.getRange(s,R(s.line,s.ch+3))==w+w+w?a="skipThree":a="skip";else if(y&&s.ch>1&&C.indexOf(w)>=0&&A.getRange(R(s.line,s.ch-2),s)==w+w){if(s.ch>2&&/\bstring/.test(A.getTokenTypeAt(R(s.line,s.ch-2))))return ae.Pass;a="addFour"}else if(y){var v=s.ch==0?" ":A.getRange(R(s.line,s.ch-1),s);if(!ae.isWordChar(b)&&v!=w&&!ae.isWordChar(v))a="both";else return ae.Pass}else if(l&&(b.length===0||/\s/.test(b)||c.indexOf(b)>-1))a="both";else return ae.Pass;if(!S)S=a;else if(S!=a)return ae.Pass}var x=d%2?o.charAt(d-1):w,k=d%2?w:o.charAt(d+1);A.operation(function(){if(S=="skip")A.execCommand("goCharRight");else if(S=="skipThree")for(var H=0;H<3;H++)A.execCommand("goCharRight");else if(S=="surround"){for(var V=A.getSelections(),H=0;H1&&arguments[1]!==void 0?arguments[1]:1,pe=Re.length,ee=0;ee1&&arguments[1]!==void 0?arguments[1]:!1;return Object(l.a)(W).map(function(oe,fe){if(!N.isValidElement(oe)||!oe.type)return null;var ve=oe.type.isSelectOptGroup,ke=oe.key,Ee=oe.props,_e=Ee.children,Te=Object(z.a)(Ee,["children"]);return q||!ve?S(oe):Object(m.a)(Object(m.a)({key:"__RC_SELECT_GRP__".concat(ke===null?fe:ke,"__"),label:ke},Te),{},{options:f(_e)})}).filter(function(oe){return oe})}var p=re("2Qr1"),s=re("qNPg"),a=re("U8pU"),b=re("Kwbf"),v=re("WKfj");function x(W){var q=W.mode,oe=W.options,fe=W.children,ve=W.backfill,ke=W.allowClear,Ee=W.placeholder,_e=W.getInputElement,Te=W.showSearch,Ce=W.onSearch,me=W.defaultOpen,ne=W.autoFocus,we=W.labelInValue,tt=W.value,Ye=W.inputValue,Xe=W.optionLabelProp,Ve=q==="multiple"||q==="tags",Le=Te!==void 0?Te:Ve||q==="combobox",Me=oe||f(fe);if(Object(b.a)(q!=="tags"||Me.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),q==="tags"||q==="combobox"){var He=Me.some(function(Ue){return Ue.options?Ue.options.some(function(Re){return typeof("value"in Re?Re.value:Re.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(b.a)(!He,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(b.a)(q!=="combobox"||!Xe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(b.a)(q==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(b.a)(q==="combobox"||!_e,"`getInputElement` only work with `combobox` mode."),Object(b.b)(q!=="combobox"||!_e||!ke||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ce&&!Le&&q!=="combobox"&&q!=="tags"&&Object(b.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(b.b)(!me||ne,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),tt!=null){var Ge=Object(v.d)(tt);Object(b.a)(!we||Ge.every(function(Ue){return Object(a.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(b.a)(!Ve||Array.isArray(tt),"`value` should be array when `mode` is `multiple` or `tags`")}if(fe){var je=null;Object(l.a)(fe).some(function(Ue){if(!N.isValidElement(Ue)||!Ue.type)return!1;var Re=Ue.type;if(Re.isSelectOption)return!1;if(Re.isSelectOptGroup){var st=Object(l.a)(Ue.props.children).every(function(Je){return!N.isValidElement(Je)||!Ue.type||Je.type.isSelectOption?!0:(je=Je.type,!1)});return!st}return je=Re,!0}),je&&Object(b.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(je.displayName||je.name||je,"`.")),Object(b.a)(Ye===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var k=x,H=Object(s.a)({prefixCls:"rc-select",components:{optionList:o},convertChildrenToData:f,flattenOptions:p.d,getLabeledValue:p.e,filterOptions:p.b,isValueDisabled:p.g,findValueOption:p.c,warningProps:k,fillOptionsWithMissingValue:p.a}),V=function(W){Object(R.a)(oe,W);var q=Object(X.a)(oe);function oe(){var fe;return Object(ae.a)(this,oe),fe=q.apply(this,arguments),fe.selectRef=N.createRef(),fe.focus=function(){fe.selectRef.current.focus()},fe.blur=function(){fe.selectRef.current.blur()},fe}return Object($.a)(oe,[{key:"render",value:function(){return N.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),oe}(N.Component);V.Option=c,V.OptGroup=y;var Q=V,G=ft.c=Q},M8RZ:function(At,ft,re){"use strict";re.d(ft,"a",function(){return O});var ae=re("fWQN"),$=re("mtLc"),R=re("yKVA"),X=re("879j"),N=re("q1tI"),I=re.n(N),z=re("i8i4"),j=re.n(z),O=function(P){Object(R.a)(L,P);var E=Object(X.a)(L);function L(D){var T;Object(ae.a)(this,L),T=E.call(this,D);var A=window.document;return T.node=A.createElement("div"),A.body.appendChild(T.node),T}return Object($.a)(L,[{key:"render",value:function(){var T=this.props.children;return Object(z.createPortal)(T,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),L}(I.a.Component)},O2Wb:function(At,ft,re){At.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES:function(At,ft,re){"use strict";var ae=re("U8pU"),$=re("VTBJ"),R=re("Ff2n"),X=re("q1tI"),N=re("uciX"),I=re("7ixt"),z=function(D){var T=D.overlay,A=D.prefixCls,w=D.id,h=D.overlayInnerStyle;return X.createElement("div",{className:"".concat(A,"-inner"),id:w,role:"tooltip",style:h},typeof T=="function"?T():T)},j=z,O=function(D,T){var A=D.overlayClassName,w=D.trigger,h=w===void 0?["hover"]:w,o=D.mouseEnterDelay,d=o===void 0?0:o,c=D.mouseLeaveDelay,C=c===void 0?.1:c,y=D.overlayStyle,m=D.prefixCls,l=m===void 0?"rc-tooltip":m,S=D.children,f=D.onVisibleChange,p=D.afterVisibleChange,s=D.transitionName,a=D.animation,b=D.placement,v=b===void 0?"right":b,x=D.align,k=x===void 0?{}:x,H=D.destroyTooltipOnHide,V=H===void 0?!1:H,Q=D.defaultVisible,G=D.getTooltipContainer,W=D.overlayInnerStyle,q=Object(R.a)(D,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),oe=Object(X.useRef)(null);Object(X.useImperativeHandle)(T,function(){return oe.current});var fe=Object($.a)({},q);"visible"in D&&(fe.popupVisible=D.visible);var ve=function(){var Ce=D.arrowContent,me=Ce===void 0?null:Ce,ne=D.overlay,we=D.id;return[X.createElement("div",{className:"".concat(l,"-arrow"),key:"arrow"},me),X.createElement(j,{key:"content",prefixCls:l,id:we,overlay:ne,overlayInnerStyle:W})]},ke=!1,Ee=!1;if(typeof V=="boolean")ke=V;else if(V&&Object(ae.a)(V)==="object"){var _e=V.keepParent;ke=_e===!0,Ee=_e===!1}return X.createElement(N.a,Object.assign({popupClassName:A,prefixCls:l,popup:ve,action:h,builtinPlacements:I.a,popupPlacement:v,ref:oe,popupAlign:k,getPopupContainer:G,onPopupVisibleChange:f,afterPopupVisibleChange:p,popupTransitionName:s,popupAnimation:a,defaultPopupVisible:Q,destroyPopupOnHide:ke,autoDestroy:Ee,mouseLeaveDelay:C,popupStyle:y,mouseEnterDelay:d},fe),S)},P=Object(X.forwardRef)(O),E=ft.a=P},Ot1p:function(At,ft,re){"use strict";var ae=re("2qtc"),$=re("kLXV"),R=re("rAM+"),X=re("miYZ"),N=re("tsqr"),I=re("9og8"),z=re("tJVT"),j=re("jrin"),O=re("WmNS"),P=re.n(O),E=re("q1tI"),L=re.n(E),D=re("VrN/"),T=re.n(D),A=re("bdgK"),w=re("p77/"),h=re("Bd2K"),o=re("ELLl"),d=re("19Vz"),c=re("lZu9"),C=re("+NIl"),y=re("kSUc"),m=re("9Bee"),l=function(ue){var Se=ue.value,Pe=Se===void 0?"":Se,Ze=ue.className,qe=ue.showTextOnly,Et=ue.showLines,Pt=ue.style,et=Pt===void 0?{}:Pt,ct=Object(E.useMemo)(function(){return""},[Pe]);return L.a.createElement(L.a.Fragment,null,L.a.createElement("div",{dangerouslySetInnerHTML:{__html:ct}}))},S=re("0Owb"),f=re("dejd"),p=re("C+DQ"),s=re("1vsH"),a=re("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 v(ue){var Se=ue.onActionCallback,Pe=ue.title,Ze=ue.icon,qe=ue.actionName,Et=ue.className,Pt=Et===void 0?"":Et,et=ue.children;function ct(){Se(qe)}return L.a.createElement("a",{title:Pe,className:Pt,onClick:ct},L.a.createElement("i",{className:"md-iconfont ".concat(Ze)}),et)}var x=function(ue){var Se=ue.watch,Pe=ue.showNullButton,Ze=ue.onActionCallback,qe=ue.fullScreen,Et=ue.insertTemp,Pt=ue.hidetoolBar,et=ue.uuid,ct=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(et,"&api=").concat(encodeURIComponent(a.a.PROXY_SERVER)));var Ft=[].concat(b,[{title:"".concat(Se?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Se?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return L.a.createElement("ul",{className:"markdown-toolbar-container"},!Pt&&Ft.map(function(Ct,jt){return L.a.createElement("li",{key:jt},Ct.actionName?L.a.createElement(v,Object(S.a)({},Ct,{onActionCallback:Ze})):L.a.createElement("span",{className:"v-line"}))}),Pe?L.a.createElement("li",null,L.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ze},L.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Et&&L.a.createElement("li",null,L.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Et),onActionCallback:Ze},L.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),L.a.createElement("li",{className:"btn-full-screen"},L.a.createElement(v,{icon:"".concat(qe?"icon-shrink":"icon-enlarge"),title:qe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ze})))},k=re("M8RZ"),H=re("+L6B"),V=re("2/Rp"),Q=re("y8nQ"),G=re("Vl3Y"),W=re("5NDa"),q=re("5rEg"),oe={labelCol:{span:4},wrapperCol:{span:20}},fe=function(ue){var Se=ue.callback,Pe=ue.onCancel;function Ze(qe){Se(qe)}return L.a.createElement(G.a,Object(S.a)({},oe,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ze}),L.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},L.a.createElement(q.a,null)),L.a.createElement(G.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},L.a.createElement(q.a,null)),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(V.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))},ve=re("7ahc"),ke=re("HmJG"),Ee=re("BjJ7"),_e=G.a.useForm,Te={width:280,marginRight:10},Ce={labelCol:{span:5},wrapperCol:{span:19}},me=function(ue){var Se=ue.callback,Pe=ue.onCancel,Ze=_e(),qe=Object(z.a)(Ze,1),Et=qe[0];function Pt(Ft){Se(Ft)}function et(Ft,Ct){if(Ft.status===-1){N.b.error(Ft.message);return}Et.setFieldsValue({src:"/api/attachments/".concat(Ft.id),type:Ct.type})}function ct(Ft){var Ct=Ft.target.files[0];we(Ct,et)}return L.a.createElement(G.a,Object(S.a)({form:Et},Ce,{className:"upload-image-panel",onFinish:Pt}),L.a.createElement(G.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},L.a.createElement("div",{className:"flex-container"},L.a.createElement(G.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},L.a.createElement(q.a,{style:Te})),L.a.createElement(ne,{onFileChange:ct}))),L.a.createElement(G.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},L.a.createElement(q.a,{style:{width:264}})),L.a.createElement(G.a.Item,{style:{textAlign:"right"}},L.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(V.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))};function ne(ue){var Se=ue.onFileChange;return L.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",L.a.createElement("input",{type:"file",onChange:Se}))}function we(ue,Se){if(!ue)throw new String("\u6CA1\u6709\u6587\u4EF6");var Pe=new FormData;Pe.append("editormd-image-file",ue),Pe.append("file_param_name","editormd-image-file"),Pe.append("byxhr","true");var Ze=new window.XMLHttpRequest;Ze.withCredentials=!0,Ze.addEventListener("load",function(qe){Se(JSON.parse(qe.target.responseText),ue)},!1),Ze.addEventListener("error",function(qe){console.error(qe)},!1),Ze.open("POST","".concat(Ee.a,"/api/attachments.json")),Ze.send(Pe)}var tt=re("giR+"),Ye=re("fyUT"),Xe=re("7Kak"),Ve=re("9yH6"),Le=Ve.a.Group,Me={margin:"0 8px"},He=function(ue){var Se=ue.callback,Pe=ue.onCancel;function Ze(qe){Se(qe)}return L.a.createElement(G.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ze},L.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},L.a.createElement("span",{style:Me},"\u5355\u5143\u683C\u6570\uFF1A"),L.a.createElement("span",{style:Me},"\u884C\u6570"),L.a.createElement(G.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},L.a.createElement(Ye.a,null)),L.a.createElement("span",{style:Me},"\u5217\u6570"),L.a.createElement(G.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},L.a.createElement(Ye.a,null))),L.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},L.a.createElement("span",{style:Me},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),L.a.createElement(G.a.Item,{name:"align"},L.a.createElement(Le,null,L.a.createElement(Ve.a,{value:"default"},L.a.createElement("i",{className:"fa fa-align-justify"})),L.a.createElement(Ve.a,{value:"left"},L.a.createElement("i",{className:"fa fa-align-left"})),L.a.createElement(Ve.a,{value:"center"},L.a.createElement("i",{className:"fa fa-align-center"})),L.a.createElement(Ve.a,{value:"right"},L.a.createElement("i",{className:"fa fa-align-right"}))))),L.a.createElement("div",{className:"flex-container flex-end"},L.a.createElement(V.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),L.a.createElement(V.a,{type:"ghost",onClick:Pe},"\u53D6\u6D88")))},Ge=re("ErOA"),je=re("7Cbv"),Ue="link",Re="upload-image",st="code-block",Je="add-table",Qe="------------",nt={default:Qe,left:":".concat(Qe),center:":".concat(Qe,":"),right:"".concat(Qe,":")},bt=re("9VGf"),at,ht;function Ae(){}var gt=0,dt=1e4,De="\u2581",We=`
**\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 ge(ue){return/^\d+$/.test(ue)?"".concat(ue,"px"):ue}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,pe=de?"Cmd":"Ctrl",ee=["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"],te=(at={},Object(j.a)(at,pe+"-B","bold"),Object(j.a)(at,pe+"-I","italic"),at),ie=(ht={},Object(j.a)(ht,Ue,"\u6DFB\u52A0\u94FE\u63A5"),Object(j.a)(ht,st,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(j.a)(ht,Re,"\u6DFB\u52A0\u6587\u4EF6"),Object(j.a)(ht,Je,"\u6DFB\u52A0\u8868\u683C"),ht),se=ft.a=function(ue){var Se=ue.defaultValue,Pe=Se===void 0?"":Se,Ze=ue.onChange,qe=ue.width,Et=qe===void 0?"100%":qe,Pt=ue.height,et=Pt===void 0?400:Pt,ct=ue.miniToolbar,Ft=ct===void 0?!1:ct,Ct=ue.isFocus,jt=Ct===void 0?!1:Ct,$t=ue.watch,Lt=ue.insertTemp,Qt=ue.mode,Zt=Qt===void 0?"markdown":Qt,pt=ue.id,Xt=pt===void 0?"markdown-editor-id":pt,zt=ue.showResizeBar,Gt=zt===void 0?!1:zt,Ut=ue.noStorage,Mt=Ut===void 0?!1:Ut,St=ue.showNullButton,it=St===void 0?!1:St,Fe=ue.hidetoolBar,nr=Fe===void 0?!1:Fe,Vt=ue.fullScreen,qt=Vt===void 0?!1:Vt,Wt=ue.onBlur,Tr=ue.onCMBeforeChange,ir=ue.onFullScreen,Rt=ue.className,Ie=Rt===void 0?"":Rt,xt=ue.disablePaste,Pr=xt===void 0?!1:xt,un=ue.placeholder,dn=un===void 0?"":un,xr=ue.values,U=xr===void 0?"":xr,u=Object(E.useState)(null),g=Object(z.a)(u,2),M=g[0],J=g[1],F=Object(E.useState)(Pe),ce=Object(z.a)(F,2),Ne=ce[0],rt=ce[1],Tt=Object(E.useState)($t),Be=Object(z.a)(Tt,2),kt=Be[0],er=Be[1],fr=Object(E.useState)(qt),Gr=Object(z.a)(fr,2),Mr=Gr[0],Ir=Gr[1],cn=Object(E.useState)(""),Sn=Object(z.a)(cn,2),wr=Sn[0],ot=Sn[1],be=Object(E.useState)(0),Ke=Object(z.a)(be,2),wt=Ke[0],mt=Ke[1],vt=Object(E.useState)(et),It=Object(z.a)(vt,2),gr=It[0],cr=It[1],hr=Object(E.useState)(!1),Lr=Object(z.a)(hr,2),Sr=Lr[0],Wr=Lr[1],or=Object(E.useRef)(Object(je.a)()),tr=Object(E.useRef)(!1),pr=Object(E.useRef)(),Ht=Object(E.useRef)(),br=Object(E.useRef)(),lr=Object(E.useRef)(),vn=Object(E.useRef)(),Nr=function(){var Dt=Object(I.a)(P.a.mark(function Kt(){var Nt,Jt;return P.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return vr.next=2,Object(Ge.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:or.current}});case 2:Jt=vr.sent,Jt!=null&&(Nt=Jt.attachments)!==null&&Nt!==void 0&&Nt.length&&(console.log("cm:",M,Ht),Jt.attachments.map(function(ar){ar.content_type.indexOf("image")>-1?M.replaceSelection(".concat(ar.content_type,")")):ar.content_type.indexOf("video")>-1?M.replaceSelection('')):ar.content_type.indexOf("pdf")>-1?M.replaceSelection('').concat(ar.name,"")):M.replaceSelection("[".concat(ar.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(ar.id,"?type=").concat(ar.content_type,")"))}));case 4:case"end":return vr.stop()}},Kt)}));return function(){return Dt.apply(this,arguments)}}();Object(E.useEffect)(function(){rt(U),M==null||M.setValue(U)},[U]),Object(E.useEffect)(function(){ir==null||ir(Mr)},[Mr]),Object(E.useEffect)(function(){if(Ht.current){var Dt=T.a.fromTextArea(Ht.current,{mode:Zt,lineNumbers:!Ft,lineWrapping:!0,value:Pe,autoCloseTags:!0,autoCloseBrackets:!0});jt&&Dt.focus();function Kt(Nt,Jt){if(Pr){Jt.preventDefault();return}var sr=Jt.clipboardData;if(sr){var vr=sr.types.toString(),ar=sr.items;if(vr==="Files"||sr.types.indexOf("Files")>-1){if(Jt.preventDefault(),Zt=="stex")return;try{var kr,Qr=ar[1];((kr=ar[0])===null||kr===void 0?void 0:kr.kind)==="file"&&(Qr=ar[0]);var rr=Qr.getAsFile(),Cn=rr.name.split(".").pop();we(rr,function(ur){if(ur.id){var Zr,Kr,hn;(rr==null||((Zr=rr.type)===null||Zr===void 0)?void 0:Zr.indexOf("image"))>-1?Dt.replaceSelection(".concat(ur.content_type,")")):(rr==null||((Kr=rr.type)===null||Kr===void 0)?void 0:Kr.indexOf("video"))>-1?Dt.replaceSelection('')):(rr==null||((hn=rr.type)===null||hn===void 0)?void 0:hn.indexOf("pdf"))>-1?Dt.replaceSelection('').concat(rr.name,"")):ee.includes(Cn)?Dt.replaceSelection('').concat(rr.name,"")):Dt.replaceSelection("[".concat(rr.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(ur.id,"?type=").concat(ur.content_type,")"))}else(ur==null?void 0:ur.status)===401&&(document.location.href="/user/login")})}catch(ur){N.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Dt.on("paste",Kt),Dt.on("dragleave",function(Nt,Jt){br.current.classList.remove("mouse-hover-md")}),Dt.on("dragover",function(Nt,Jt){br.current.classList.add("mouse-hover-md")}),Dt.on("drop",function(Nt,Jt){br.current.classList.add("mouse-hover-md");var sr;if(sr=Jt.dataTransfer.files,sr.length>0){Jt.preventDefault(),Jt.stopPropagation();for(var vr=function(Qr){var rr=sr[Qr],Cn=rr.name.split(".").pop();we(rr,function(ur){if(ur.id){var Zr,Kr,hn;(rr==null||((Zr=rr.type)===null||Zr===void 0)?void 0:Zr.indexOf("image"))>-1?Dt.replaceSelection(".concat(ur.content_type,")")):(rr==null||((Kr=rr.type)===null||Kr===void 0)?void 0:Kr.indexOf("video"))>-1?Dt.replaceSelection('')):(rr==null||((hn=rr.type)===null||hn===void 0)?void 0:hn.indexOf("pdf"))>-1?Dt.replaceSelection('').concat(rr.name,"")):ee.includes(Cn)?Dt.replaceSelection('').concat(rr.name,"")):Dt.replaceSelection("[".concat(rr.name,"](").concat(a.a.API_SERVER,"/api/attachments/").concat(ur.id,"?type=").concat(ur.content_type,")"))}else(ur==null?void 0:ur.status)===401&&(document.location.href="/user/login")})},ar=0;ar0||ar.target.offsetWidth>0)&&(Yr(),M.setSize("100%","100%"),M.refresh())}}catch(kr){sr.e(kr)}finally{sr.f()}});return Nt.observe(Ht.current.parentElement),Nt}if(M){var Kt=Dt();return function(){Kt.unobserve(Ht.current.parentElement)}}},[M,Yr]),Object(E.useEffect)(function(){if(M){for(var Dt=[],Kt=function(){var ar=Jt[Nt];sr=Object(z.a)(ar,2);var kr=sr[0],Qr=sr[1],rr=Object(j.a)({},kr,function(){Yn(Qr)});Dt.push(rr),M.addKeyMap(rr)},Nt=0,Jt=Object.entries(te);Nt0){var Dt=new Date().getTime(),Kt=window.sessionStorage.getItem(Xt);Dt>=wt+dt&&(!Kt||Kt!==Ne)&&(window.sessionStorage.setItem(Xt,Ne),Wr(!0))}},dt),Object(E.useEffect)(function(){er($t)},[M,$t]),Object(E.useEffect)(function(){M&&(jt&&M.focus())},[M,jt]),Object(E.useEffect)(function(){if(kt&&M){var Dt=M.getScrollerElement();function Kt(Nt){var Jt=Nt.target;if(vn.current){var sr=Jt.scrollTop/Jt.scrollHeight;vn.current.scrollTop=vn.current.scrollHeight*sr}}return Dt.addEventListener("scroll",Kt),function(){Dt.removeEventListener("scroll",Kt)}}},[M,kt]),Object(E.useEffect)(function(){if(M&&Tr){function Dt(Kt,Nt){Tr(Kt,Nt)}return M.on("beforeChange",Dt),function(){M.off("beforeChange",Dt)}}},[M,Tr]),Object(E.useEffect)(function(){if(M&&Wt){function Dt(){Wt(M.getValue())}return M.on("blur",Dt),function(){M.off("blur",Dt)}}},[M,Wt]),Object(E.useEffect)(function(){if(M){function Dt(Kt){var Nt=Kt.getValue();rt(Nt),mt(new Date().getTime()),Kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ze&&Ze(Nt)}return M.on("change",Dt),function(){M.off("change",Dt)}}},[M,Ze]),Object(E.useEffect)(function(){M&&(Pe==null?(M.setValue(""),rt("")):Pe!==M.getValue()&&(M.setValue(Pe),rt(Pe),M.setCursor(M.lineCount(),0)))},[M,Pe]);var Yn=Object(E.useCallback)(function(Dt){var Kt=M.getCursor(),Nt=M.getSelection(),Jt=Nt.split(`
`);switch(Dt){case"bold":return M.replaceSelection("**"+Nt+"**"),Nt===""&&M.setCursor(Kt.line,Kt.ch+2),M.focus();case"italic":return M.replaceSelection("*"+Nt+"*"),Nt===""&&M.setCursor(Kt.line,Kt.ch+1),M.focus();case"code":return M.replaceSelection("`"+Nt+"`"),Nt===""&&M.setCursor(Kt.line,Kt.ch+1),M.focus();case"inline-latex":return M.replaceSelection("`$$"+Nt+"$$`"),Nt===""&&M.setCursor(Kt.line,Kt.ch+3),M.focus();case"latex":return M.replaceSelection("```latex\n"+Nt+"\n```"),M.setCursor(Kt.line+1,Nt.length+1),M.focus();case"line-break":return M.replaceSelection(`
`),M.focus();case"list-ul":return Nt===""?M.replaceSelection("- "+Nt):M.replaceSelection(Jt.map(function(sr){return sr===""?"":"- ".concat(sr)}).join(`
`)),M.focus();case"list-ol":return Nt===""?M.replaceSelection("1. "+Nt):M.replaceSelection(Jt.map(function(sr,vr){return sr===""?"":"".concat(vr+1,". ").concat(sr)}).join(`
`)),M.focus();case"add-null-ch":return Nt===""&&M.setCursor(Kt.line,Kt.ch+1),M.replaceSelection(De),M.focus();case"inster-template-1":return Nt===""&&M.setCursor(Kt.line,Kt.ch),M.replaceSelection(We),M.focus();case"eraser":return M.setValue(""),M.focus();case"trigger-watch":return er(!kt),M.focus();case"trigger-full-screen":return Ir(!Mr),M.focus();case Ue:ot(Ue);return;case st:ot(st);return;case Re:ot(Re);return;case Je:ot(Je);return;default:throw new Error}},[M,kt,Mr]),An=Object(E.useCallback)(function(Dt){ot("");switch(wr){case Ue:var Kt=Dt.title,Nt=Dt.link;return M.replaceSelection("[".concat(Kt,"](").concat(Nt,")")),M.focus();case st:var Jt=Dt.language,sr=Dt.content;return M.replaceSelection(["```"+Jt,sr,"```"].join(`
`)),M.focus();case Re:var vr=Dt.src,ar=Dt.alt;return ar?M.replaceSelection(".concat(vr,' "').concat(ar,'" )')):M.replaceSelection("")),M.focus();case Je:for(var kr=Dt.row,Qr=Dt.col,rr=Dt.align,Cn=`
`,ur=0;ur300&&(kr=300);var Qr=et+kr+"px";cr(Qr)}}return Dt.addEventListener("mousedown",Jt),document.addEventListener("mousemove",vr),document.addEventListener("mouseup",sr),function(){Dt.removeEventListener("mousedown",Jt),document.removeEventListener("mousemove",vr),document.removeEventListener("mouseup",sr)}}},[M,lr]),Object(E.useEffect)(function(){cr(et)},[et]);var yn=ge(Et),fi=ge(gr),fn={width:yn,height:fi},pi=Object(E.useMemo)(function(){if(wt){var Dt=new Date(wt),Kt=Dt.getHours(),Nt=Dt.getMinutes(),Jt=Dt.getSeconds();return Kt=Kt<10?"0"+Kt:Kt,Nt=Nt<10?"0"+Nt:Nt,Jt=Jt<10?"0"+Jt:Jt,"".concat(Kt,":").concat(Nt,":").concat(Jt)}return 0},[wt]);function ji(){window.sessionStorage.removeItem(Xt),Wr(!1),mt(0)}function Un(){Wr(!1),mt(0),M.setValue(window.sessionStorage.getItem(Xt))}function ua(Dt,Kt){var Nt=M.getValue();Nt=Nt.replace(Dt,Kt),rt(Nt),M==null||M.setValue(Nt)}return L.a.createElement(E.Fragment,null,L.a.createElement("div",{className:"markdown-editor-wrapper",ref:br},L.a.createElement("div",{className:"markdown-editor-container ".concat(Ie," ").concat(kt?"on-preview":""," ").concat(Ft?"mini":""," ").concat(Mr?"full-screen":""),style:fn},L.a.createElement(x,{insertTemp:Lt,watch:kt,fullScreen:Mr,showNullButton:it,onActionCallback:Yn,hidetoolBar:nr,uuid:or.current,setOpenPhones:function(){tr.current=!0}}),L.a.createElement("div",{className:"markdown-editor-body"},L.a.createElement("div",{className:"codemirror-container"},L.a.createElement("textarea",{ref:Ht,placeholder:dn})),kt?L.a.createElement("div",{ref:vn,className:"preview-container"},Zt==="stex"&&L.a.createElement(l,{value:Ne}),Zt!=="stex"&&L.a.createElement(m.a,{edit:!0,value:Ne,replaces:ua})):null))),Gt?L.a.createElement("a",{ref:lr,className:"editor-resize"}):null,L.a.createElement(k.a,null,ie[wr]?L.a.createElement($.a,{centered:!0,title:ie[wr],visible:!0,onCancel:Ln,footer:null,className:"markdown-popup-form"},hi):null))}},PGNT:function(At,ft,re){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,ft,re){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"}},"RZ/O":function(At,ft,re){At.exports=re.p+"static/bi.9c9b0364.svg"},SJMd:function(At,ft){/**
* @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 re,ae,$,R=!1,X,N;window.PR_SHOULD_USE_CONTINUATION=!0;var I,z;(function(){var j=window,O=["break,continue,do,else,for,if,return,while"],P=[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"],E=[P,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],L=[E,"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=[E,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],T=[E,"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"],A="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",w=[E,"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",o=[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"],d=[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=[L,T,D,w,h,o,d,c],y=/^(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",l="kwd",S="com",f="typ",p="lit",s="pun",a="pln",b="tag",v="dec",x="src",k="atn",H="atv",V="nocode",Q="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function G(Le){for(var Me=0,He=!1,Ge=!1,je=0,Ue=Le.length;je122||(ee<65||pe>90||gt.push([Math.max(65,pe)|32,Math.min(ee,90)|32]),ee<97||pe>122||gt.push([Math.max(97,pe)&~32,Math.min(ee,122)&~32]))}}gt.sort(function(ue,Se){return ue[0]-Se[0]||Se[1]-ue[1]});for(var te=[],ie=[],We=0;Wese[0]&&(se[1]+1>se[0]&&De.push("-"),De.push(Qe(se[1])))}return De.push("]"),De.join("")}function bt(ht){for(var Ae=ht.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")),gt=Ae.length,dt=[],De=0,We=0;De=2&&pe==="["?Ae[De]=nt(ge):pe!=="\\"&&(Ae[De]=ge.replace(/[a-zA-Z]/g,function(ie){var se=ie.charCodeAt(0);return"["+String.fromCharCode(se&~32,se|32)+"]"}))}return Ae.join("")}for(var at=[],je=0,Ue=Le.length;je=0;)He[at.charAt(ht)]=bt;var Ae=bt[1],gt=""+Ae;Je.hasOwnProperty(gt)||(st.push(Ae),Je[gt]=null)}st.push(/[\0-\uffff]/),Ge=G(st)})();var je=Me.length,Ue=function(Re){for(var st=Re.sourceCode,Je=Re.basePos,Qe=Re.sourceNode,nt=[Je,a],bt=0,at=st.match(Ge)||[],ht={},Ae=0,gt=at.length;Ae=5&&De.substring(0,5)==="lang-",ge&&!(We&&typeof We[1]=="string")&&(ge=!1,De=x),ge||(ht[dt]=De)}var ee=bt;if(bt+=dt.length,!ge)nt.push(Je+ee,De);else{var te=We[1],ie=dt.indexOf(te),se=ie+te.length;We[2]&&(se=dt.length-We[2].length,ie=se-te.length);var ue=De.substring(5);q(Qe,Je+ee,dt.substring(0,ie),Ue,nt),q(Qe,Je+ee+ie,te,ne(ue,te),nt),q(Qe,Je+ee+se,dt.substring(se),Ue,nt)}}Re.decorations=nt};return Ue}function ke(Le){var Me=[],He=[];Le.tripleQuotedStrings?Me.push([m,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Le.multiLineStrings?Me.push([m,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Me.push([m,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Le.verbatimStrings&&He.push([m,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ge=Le.hashComments;Ge&&(Le.cStyleComments?(Ge>1?Me.push([S,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Me.push([S,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),He.push([m,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Me.push([S,/^#[^\r\n]*/,null,"#"])),Le.cStyleComments&&(He.push([S,/^\/\/[^\r\n]*/,null]),He.push([S,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var je=Le.regexLiterals;if(je){var Ue=je>1?"":`
\r`,Re=Ue?".":"[\\S\\s]",st="/(?=[^/*"+Ue+"])(?:[^/\\x5B\\x5C"+Ue+"]|\\x5C"+Re+"|\\x5B(?:[^\\x5C\\x5D"+Ue+"]|\\x5C"+Re+")*(?:\\x5D|$))+/";He.push(["lang-regex",RegExp("^"+Q+"("+st+")")])}var Je=Le.types;Je&&He.push([f,Je]);var Qe=(""+Le.keywords).replace(/^ | $/g,"");Qe.length&&He.push([l,new RegExp("^(?:"+Qe.replace(/[\s,]+/g,"|")+")\\b"),null]),Me.push([a,/^\s+/,null,` \r
\xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return Le.regexLiterals&&(nt+="(?!s*/)"),He.push([p,/^@[a-z_$][a-z_$@0-9]*/i,null],[f,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[a,/^[a-z_$][a-z_$@0-9]*/i,null],[p,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]),ve(Me,He)}var Ee=ke({keywords:C,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function _e(Le,Me,He){for(var Ge=/(?:^|\s)nocode(?:\s|$)/,je=/\r\n?|\n/,Ue=Le.ownerDocument,Re=Ue.createElement("li");Le.firstChild;)Re.appendChild(Le.firstChild);var st=[Re];function Je(Ae){var gt=Ae.nodeType;if(gt==1&&!Ge.test(Ae.className))if(Ae.nodeName==="br")Qe(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var dt=Ae.firstChild;dt;dt=dt.nextSibling)Je(dt);else if((gt==3||gt==4)&&He){var De=Ae.nodeValue,We=De.match(je);if(We){var ge=De.substring(0,We.index);Ae.nodeValue=ge;var de=De.substring(We.index+We[0].length);if(de){var pe=Ae.parentNode;pe.insertBefore(Ue.createTextNode(de),Ae.nextSibling)}Qe(Ae),ge||Ae.parentNode.removeChild(Ae)}}}function Qe(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function gt(We,ge){var de=ge?We.cloneNode(!1):We,pe=We.parentNode;if(pe){var ee=gt(pe,1),te=We.nextSibling;ee.appendChild(de);for(var ie=te;ie;ie=te)te=ie.nextSibling,ee.appendChild(ie)}return de}for(var dt=gt(Ae.nextSibling,0),De;(De=dt.parentNode)&&De.nodeType===1;)dt=De;st.push(dt)}for(var nt=0;nt=pe&&(Je+=2),Ue>=ee&&(bt+=2)}}finally{De&&(De.style.display=We)}}var Ce={};function me(Le,Me){for(var He=Me.length;--He>=0;){var Ge=Me[He];Ce.hasOwnProperty(Ge)?j.console&&console.warn("cannot override language handler %s",Ge):Ce[Ge]=Le}}function ne(Le,Me){return Le&&Ce.hasOwnProperty(Le)||(Le=/^\s*]*(?:>|$)/],[S,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[s,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^