(window.webpackJsonp=window.webpackJsonp||[]).push([[191,3,5,7,8,19],{"+NIl":function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){"use strict";q.defineMode("stex",function(V,M){"use strict";function z(d,s){d.cmdState.push(s)}function U(d){return d.cmdState.length>0?d.cmdState[d.cmdState.length-1]:null}function L(d){var s=d.cmdState.pop();s&&s.closeBracket()}function H(d){for(var s=d.cmdState,l=s.length-1;l>=0;l--){var r=s[l];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function F(d,s,l){return function(){this.name=d,this.bracketNo=0,this.style=s,this.styles=l,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var D={};D.importmodule=F("importmodule","tag",["string","builtin"]),D.documentclass=F("documentclass","tag",["","atom"]),D.usepackage=F("usepackage","tag",["atom"]),D.begin=F("begin","tag",["atom"]),D.end=F("end","tag",["atom"]),D.label=F("label","tag",["atom"]),D.ref=F("ref","tag",["atom"]),D.eqref=F("eqref","tag",["atom"]),D.cite=F("cite","tag",["atom"]),D.bibitem=F("bibitem","tag",["atom"]),D.Bibitem=F("Bibitem","tag",["atom"]),D.RBibitem=F("RBibitem","tag",["atom"]),D.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function I(d,s){d.f=s}function g(d,s){var l;if(d.match(/^\\[a-zA-Z@]+/)){var r=d.current().slice(1);return l=D.hasOwnProperty(r)?D[r]:D.DEFAULT,l=new l,z(s,l),I(s,u),l.style}if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/\\]/))return"tag";if(d.match("\\["))return I(s,function(n,h){return f(n,h,"\\]")}),"keyword";if(d.match("\\("))return I(s,function(n,h){return f(n,h,"\\)")}),"keyword";if(d.match("$$"))return I(s,function(n,h){return f(n,h,"$$")}),"keyword";if(d.match("$"))return I(s,function(n,h){return f(n,h,"$")}),"keyword";var a=d.next();if(a=="%")return d.skipToEnd(),"comment";if(a=="}"||a=="]"){if(l=U(s),l)l.closeBracket(a),I(s,u);else return"error";return"bracket"}else return a=="{"||a=="["?(l=D.DEFAULT,l=new l,z(s,l),"bracket"):/\d/.test(a)?(d.eatWhile(/[\w.%]/),"atom"):(d.eatWhile(/[\w\-_]/),l=H(s),l.name=="begin"&&(l.argument=d.current()),l.styleIdentifier())}function f(d,s,l){if(d.eatSpace())return null;if(l&&d.match(l))return I(s,g),"keyword";if(d.match(/^\\[a-zA-Z@]+/))return"tag";if(d.match(/^[a-zA-Z]+/))return"variable-2";if(d.match(/^\\[$&%#{}_]/))return"tag";if(d.match(/^\\[,;!\/]/))return"tag";if(d.match(/^[\^_&]/))return"tag";if(d.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(d.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=d.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(d.skipToEnd(),"comment"):"error"}function u(d,s){var l=d.peek(),r;return l=="{"||l=="["?(r=U(s),r.openBracket(l),d.eat(l),I(s,g),"bracket"):/[ \t\r]/.test(l)?(d.eat(l),null):(I(s,g),L(s),g(d,s))}return{startState:function(){var d=M.inMathMode?function(s,l){return f(s,l)}:g;return{cmdState:[],f:d}},copyState:function(d){return{cmdState:d.cmdState.slice(),f:d.f}},token:function(d,s){return s.f(d,s)},blankLine:function(d){d.f=g,d.cmdState.length=0},lineComment:"%"}}),q.defineMIME("text/x-stex","stex"),q.defineMIME("text/x-latex","stex")})},"+aKw":function(Fe,Se,W){"use strict";var q=W("tJVT"),V=W("q1tI"),M=W.n(V),z=function(H){return String(H).length===1?"0".concat(H):H},U=function(H){var F=H.className,D=F===void 0?"":F,I=H.onChange,g=H.defaultValue,f=g===void 0?0:g,u=Object(V.useState)(f),d=Object(q.a)(u,2),s=d[0],l=d[1];Object(V.useEffect)(function(){var h=setTimeout(function(){l(s+1e3)},1e3);return I(s+1e3),function(){clearInterval(h)}},[s]);var r=parseInt(s/(60*6e4))||"00",a=parseInt(s%(60*6e4)/6e4)||"00",n=parseInt(s%6e4/1e3)||"00";return M.a.createElement("div",{className:D},z(r),":",z(a),":",z(n))};Se.a=U},"+k/U":function(Fe,Se,W){Fe.exports={pagination:"pagination___2XcQw",info:"info___12Y4R"}},"+ua5":function(Fe,Se,W){},"07cG":function(Fe,Se,W){Fe.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){q.defineOption("placeholder","",function(F,D,I){var g=I&&I!=q.Init;if(D&&!g)F.on("blur",U),F.on("change",L),F.on("swapDoc",L),q.on(F.getInputField(),"compositionupdate",F.state.placeholderCompose=function(){z(F)}),L(F);else if(!D&&g){F.off("blur",U),F.off("change",L),F.off("swapDoc",L),q.off(F.getInputField(),"compositionupdate",F.state.placeholderCompose),V(F);var f=F.getWrapperElement();f.className=f.className.replace(" CodeMirror-empty","")}D&&!F.hasFocus()&&U(F)});function V(F){F.state.placeholder&&(F.state.placeholder.parentNode.removeChild(F.state.placeholder),F.state.placeholder=null)}function M(F){V(F);var D=F.state.placeholder=document.createElement("pre");D.style.cssText="height: 0; overflow: visible",D.style.direction=F.getOption("direction"),D.className="CodeMirror-placeholder CodeMirror-line-like";var I=F.getOption("placeholder");typeof I=="string"&&(I=document.createTextNode(I)),D.appendChild(I),F.display.lineSpace.insertBefore(D,F.display.lineSpace.firstChild)}function z(F){setTimeout(function(){var D=!1,I=F.getInputField();I.nodeName=="TEXTAREA"?D=!I.value:F.lineCount()==1&&(D=!/[^\u200b]/.test(I.querySelector(".CodeMirror-line").textContent)),D?M(F):V(F)},20)}function U(F){H(F)&&M(F)}function L(F){var D=F.getWrapperElement(),I=H(F);D.className=D.className.replace(" CodeMirror-empty","")+(I?" CodeMirror-empty":""),I?M(F):V(F)}function H(F){return F.lineCount()===1&&F.getLine(0)===""}})},"1eCo":function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){"use strict";var V={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},M={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};q.defineMode("xml",function(z,U){var L=z.indentUnit,H={},F=U.htmlMode?V:M;for(var D in F)H[D]=F[D];for(var D in U)H[D]=U[D];var I,g;function f(c,E){function y(N){return E.tokenize=N,N(c,E)}var _=c.next();if(_=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?y(s("atom","]]>")):null:c.match("--")?y(s("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),y(l(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),E.tokenize=s("meta","?>"),"meta"):(I=c.eat("/")?"closeTag":"openTag",E.tokenize=u,"tag bracket");if(_=="&"){var P;return c.eat("#")?c.eat("x")?P=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):P=c.eatWhile(/[\d]/)&&c.eat(";"):P=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),P?"atom":"error"}else return c.eatWhile(/[^&<]/),null}f.isInText=!0;function u(c,E){var y=c.next();if(y==">"||y=="/"&&c.eat(">"))return E.tokenize=f,I=y==">"?"endTag":"selfcloseTag","tag bracket";if(y=="=")return I="equals",null;if(y=="<"){E.tokenize=f,E.state=h,E.tagName=E.tagStart=null;var _=E.tokenize(c,E);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(y)?(E.tokenize=d(y),E.stringStartCol=c.column(),E.tokenize(c,E)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(c){var E=function(y,_){for(;!y.eol();)if(y.next()==c){_.tokenize=u;break}return"string"};return E.isInAttribute=!0,E}function s(c,E){return function(y,_){for(;!y.eol();){if(y.match(E)){_.tokenize=f;break}y.next()}return c}}function l(c){return function(E,y){for(var _;(_=E.next())!=null;){if(_=="<")return y.tokenize=l(c+1),y.tokenize(E,y);if(_==">")if(c==1){y.tokenize=f;break}else return y.tokenize=l(c-1),y.tokenize(E,y)}return"meta"}}function r(c,E,y){this.prev=c.context,this.tagName=E,this.indent=c.indented,this.startOfLine=y,(H.doNotIndent.hasOwnProperty(E)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function a(c){c.context&&(c.context=c.context.prev)}function n(c,E){for(var y;;){if(!c.context)return;if(y=c.context.tagName,!H.contextGrabbers.hasOwnProperty(y)||!H.contextGrabbers[y].hasOwnProperty(E))return;a(c)}}function h(c,E,y){return c=="openTag"?(y.tagStart=E.column(),O):c=="closeTag"?S:h}function O(c,E,y){return c=="word"?(y.tagName=E.current(),g="tag",C):H.allowMissingTagName&&c=="endTag"?(g="tag bracket",C(c,E,y)):(g="error",O)}function S(c,E,y){if(c=="word"){var _=E.current();return y.context&&y.context.tagName!=_&&H.implicitlyClosed.hasOwnProperty(y.context.tagName)&&a(y),y.context&&y.context.tagName==_||H.matchClosing===!1?(g="tag",x):(g="tag error",A)}else return H.allowMissingTagName&&c=="endTag"?(g="tag bracket",x(c,E,y)):(g="error",A)}function x(c,E,y){return c!="endTag"?(g="error",x):(a(y),h)}function A(c,E,y){return g="error",x(c,E,y)}function C(c,E,y){if(c=="word")return g="attribute",b;if(c=="endTag"||c=="selfcloseTag"){var _=y.tagName,P=y.tagStart;return y.tagName=y.tagStart=null,c=="selfcloseTag"||H.autoSelfClosers.hasOwnProperty(_)?n(y,_):(n(y,_),y.context=new r(y,_,P==y.indented)),h}return g="error",C}function b(c,E,y){return c=="equals"?v:(H.allowMissing||(g="error"),C(c,E,y))}function v(c,E,y){return c=="string"?p:c=="word"&&H.allowUnquoted?(g="string",C):(g="error",C(c,E,y))}function p(c,E,y){return c=="string"?p:C(c,E,y)}return{startState:function(c){var E={tokenize:f,state:h,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(E.baseIndent=c),E},token:function(c,E){if(!E.tagName&&c.sol()&&(E.indented=c.indentation()),c.eatSpace())return null;I=null;var y=E.tokenize(c,E);return(y||I)&&y!="comment"&&(g=null,E.state=E.state(I||y,c,E),g&&(y=g=="error"?y+" error":g)),y},indent:function(c,E,y){var _=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+L;if(_&&_.noIndent)return q.Pass;if(c.tokenize!=u&&c.tokenize!=f)return y?y.match(/^(\s*)/)[0].length:0;if(c.tagName)return H.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+L*(H.multilineTagIndentFactor||1);if(H.alignCDATA&&/$/,blockCommentStart:"",configuration:H.htmlMode?"html":"xml",helperType:H.htmlMode?"html":"xml",skipAttribute:function(c){c.state==v&&(c.state=C)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var E=[],y=c.context;y;y=y.prev)y.tagName&&E.push(y.tagName);return E.reverse()}}}),q.defineMIME("text/xml","xml"),q.defineMIME("application/xml","xml"),q.mimeModes.hasOwnProperty("text/html")||q.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1j5w":function(Fe,Se,W){"use strict";W.d(Se,"d",function(){return vt}),W.d(Se,"b",function(){return be}),W.d(Se,"c",function(){return Xe}),W.d(Se,"a",function(){return bt});var q=W("VTBJ"),V=W("1OyB"),M=W("vuIU"),z=W("JX7q"),U=W("Ji7U"),L=W("LK+K"),H=W("q1tI"),F=W("I8Z2"),D=W("BGR+"),I=W("wx14"),g=W("rePB"),f=W("4IlW"),u=W("2GS6"),d=W("Gytx"),s=W.n(d),l=W("TSYQ"),r=W.n(l),a=W("U8pU"),n=W("ODXe"),h=/iPhone/i,O=/iPod/i,S=/iPad/i,x=/\bAndroid(?:.+)Mobile\b/i,A=/Android/i,C=/\bAndroid(?:.+)SD4930UR\b/i,b=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,v=/Windows Phone/i,p=/\bWindows(?:.+)ARM\b/i,c=/BlackBerry/i,E=/BB10/i,y=/Opera Mini/i,_=/\b(CriOS|Chrome)(?:.+)Mobile/i,P=/Mobile(?:.+)Firefox\b/i;function N(at,Be){return at.test(Be)}function K(at){var Be=at||(typeof navigator!="undefined"?navigator.userAgent:""),We=Be.split("[FBAN");if(typeof We[1]!="undefined"){var Me=We,se=Object(n.a)(Me,1);Be=se[0]}if(We=Be.split("Twitter"),typeof We[1]!="undefined"){var ve=We,Ke=Object(n.a)(ve,1);Be=Ke[0]}var Pe={apple:{phone:N(h,Be)&&!N(v,Be),ipod:N(O,Be),tablet:!N(h,Be)&&N(S,Be)&&!N(v,Be),device:(N(h,Be)||N(O,Be)||N(S,Be))&&!N(v,Be)},amazon:{phone:N(C,Be),tablet:!N(C,Be)&&N(b,Be),device:N(C,Be)||N(b,Be)},android:{phone:!N(v,Be)&&N(C,Be)||!N(v,Be)&&N(x,Be),tablet:!N(v,Be)&&!N(C,Be)&&!N(x,Be)&&(N(b,Be)||N(A,Be)),device:!N(v,Be)&&(N(C,Be)||N(b,Be)||N(x,Be)||N(A,Be))||N(/\bokhttp\b/i,Be)},windows:{phone:N(v,Be),tablet:N(p,Be),device:N(v,Be)||N(p,Be)},other:{blackberry:N(c,Be),blackberry10:N(E,Be),opera:N(y,Be),firefox:N(P,Be),chrome:N(_,Be),device:N(c,Be)||N(E,Be)||N(y,Be)||N(P,Be)||N(_,Be)},any:null,phone:null,tablet:null};return Pe.any=Pe.apple.device||Pe.android.device||Pe.windows.device||Pe.other.device,Pe.phone=Pe.apple.phone||Pe.android.phone||Pe.windows.phone,Pe.tablet=Pe.apple.tablet||Pe.android.tablet||Pe.windows.tablet,Pe}var $=Object(q.a)(Object(q.a)({},K()),{},{isMobile:K}),B=$;function R(){}function G(at,Be,We){var Me=Be||"";return at.key||"".concat(Me,"item_").concat(We)}function Q(at){return"".concat(at,"-menu-")}function ne(at,Be){var We=-1;H.Children.forEach(at,function(Me){We+=1,Me&&Me.type&&Me.type.isMenuItemGroup?H.Children.forEach(Me.props.children,function(se){We+=1,Be(se,We)}):Be(Me,We)})}function le(at,Be,We){if(!at||We.find)return;H.Children.forEach(at,function(Me){if(Me){var se=Me.type;if(!se||!(se.isSubMenu||se.isMenuItem||se.isMenuItemGroup))return;Be.indexOf(Me.key)!==-1?We.find=!0:Me.props.children&&le(Me.props.children,Be,We)}})}var _e=["defaultSelectedKeys","selectedKeys","defaultOpenKeys","openKeys","mode","getPopupContainer","onSelect","onDeselect","onDestroy","openTransitionName","openAnimation","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","triggerSubMenuAction","level","selectable","multiple","onOpenChange","visible","focusable","defaultActiveFirst","prefixCls","inlineIndent","parentMenu","title","rootPrefixCls","eventKey","active","onItemHover","onTitleMouseEnter","onTitleMouseLeave","onTitleClick","popupAlign","popupOffset","isOpen","renderMenuItem","manualRef","subMenuKey","disabled","index","isSelected","store","activeKey","builtinPlacements","overflowedIndicator","motion","attribute","value","popupClassName","inlineCollapsed","menu","theme","itemIcon","expandIcon"],pe=function(Be){var We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=Be&&typeof Be.getBoundingClientRect=="function"&&Be.getBoundingClientRect().width;if(Me){if(We){var se=getComputedStyle(Be),ve=se.marginLeft,Ke=se.marginRight;Me+=+ve.replace("px","")+ +Ke.replace("px","")}Me=+Me.toFixed(6)}return Me||0},Ee=function(Be,We,Me){Be&&Object(a.a)(Be.style)==="object"&&(Be.style[We]=Me)},Oe=function(){return B.any},we=W("KQm4"),he=W("Ff2n"),oe=W("i8i4"),Le=W("bdgK"),Ye=W("uciX"),nt=W("8XRh"),qe={adjustX:1,adjustY:1},it={topLeft:{points:["bl","tl"],overflow:qe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qe,offset:[0,7]},leftTop:{points:["tr","tl"],overflow:qe,offset:[-4,0]},rightTop:{points:["tl","tr"],overflow:qe,offset:[4,0]}},He={topLeft:{points:["bl","tl"],overflow:qe,offset:[0,-7]},bottomLeft:{points:["tl","bl"],overflow:qe,offset:[0,7]},rightTop:{points:["tr","tl"],overflow:qe,offset:[-4,0]},leftTop:{points:["tl","tr"],overflow:qe,offset:[4,0]}},$e=it,Qe=0,gt={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"},et=function(Be,We,Me){var se=Q(We),ve=Be.getState();Be.setState({defaultActiveFirst:Object(q.a)(Object(q.a)({},ve.defaultActiveFirst),{},Object(g.a)({},se,Me))})},tt=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(Me){var se;Object(V.a)(this,We),se=Be.call(this,Me),se.onDestroy=function(Te){se.props.onDestroy(Te)},se.onKeyDown=function(Te){var ke=Te.keyCode,rt=se.menuInstance,Ct=se.props,At=Ct.isOpen,cn=Ct.store;if(ke===f.a.ENTER)return se.onTitleClick(Te),et(cn,se.props.eventKey,!0),!0;if(ke===f.a.RIGHT)return At?rt.onKeyDown(Te):(se.triggerOpenChange(!0),et(cn,se.props.eventKey,!0)),!0;if(ke===f.a.LEFT){var yn;if(At)yn=rt.onKeyDown(Te);else return;return yn||(se.triggerOpenChange(!1),yn=!0),yn}return At&&(ke===f.a.UP||ke===f.a.DOWN)?rt.onKeyDown(Te):void 0},se.onOpenChange=function(Te){se.props.onOpenChange(Te)},se.onPopupVisibleChange=function(Te){se.triggerOpenChange(Te,Te?"mouseenter":"mouseleave")},se.onMouseEnter=function(Te){var ke=se.props,rt=ke.eventKey,Ct=ke.onMouseEnter,At=ke.store;et(At,se.props.eventKey,!1),Ct({key:rt,domEvent:Te})},se.onMouseLeave=function(Te){var ke=se.props,rt=ke.parentMenu,Ct=ke.eventKey,At=ke.onMouseLeave;rt.subMenuInstance=Object(z.a)(se),At({key:Ct,domEvent:Te})},se.onTitleMouseEnter=function(Te){var ke=se.props,rt=ke.eventKey,Ct=ke.onItemHover,At=ke.onTitleMouseEnter;Ct({key:rt,hover:!0}),At({key:rt,domEvent:Te})},se.onTitleMouseLeave=function(Te){var ke=se.props,rt=ke.parentMenu,Ct=ke.eventKey,At=ke.onItemHover,cn=ke.onTitleMouseLeave;rt.subMenuInstance=Object(z.a)(se),At({key:Ct,hover:!1}),cn({key:Ct,domEvent:Te})},se.onTitleClick=function(Te){var ke=Object(z.a)(se),rt=ke.props;if(rt.onTitleClick({key:rt.eventKey,domEvent:Te}),rt.triggerSubMenuAction==="hover")return;se.triggerOpenChange(!rt.isOpen,"click"),et(rt.store,se.props.eventKey,!1)},se.onSubMenuClick=function(Te){typeof se.props.onClick=="function"&&se.props.onClick(se.addKeyPath(Te))},se.onSelect=function(Te){se.props.onSelect(Te)},se.onDeselect=function(Te){se.props.onDeselect(Te)},se.getPrefixCls=function(){return"".concat(se.props.rootPrefixCls,"-submenu")},se.getActiveClassName=function(){return"".concat(se.getPrefixCls(),"-active")},se.getDisabledClassName=function(){return"".concat(se.getPrefixCls(),"-disabled")},se.getSelectedClassName=function(){return"".concat(se.getPrefixCls(),"-selected")},se.getOpenClassName=function(){return"".concat(se.props.rootPrefixCls,"-submenu-open")},se.saveMenuInstance=function(Te){se.menuInstance=Te},se.addKeyPath=function(Te){return Object(q.a)(Object(q.a)({},Te),{},{keyPath:(Te.keyPath||[]).concat(se.props.eventKey)})},se.triggerOpenChange=function(Te,ke){var rt=se.props.eventKey,Ct=function(){se.onOpenChange({key:rt,item:Object(z.a)(se),trigger:ke,open:Te})};ke==="mouseenter"?se.mouseenterTimeout=setTimeout(function(){Ct()},0):Ct()},se.isChildrenSelected=function(){var Te={find:!1};return le(se.props.children,se.props.selectedKeys,Te),Te.find},se.isOpen=function(){return se.props.openKeys.indexOf(se.props.eventKey)!==-1},se.adjustWidth=function(){if(!se.subMenuTitle||!se.menuInstance)return;var Te=oe.findDOMNode(se.menuInstance);if(Te.offsetWidth>=se.subMenuTitle.offsetWidth)return;Te.style.minWidth="".concat(se.subMenuTitle.offsetWidth,"px")},se.saveSubMenuTitle=function(Te){se.subMenuTitle=Te},se.getBaseProps=function(){var Te=Object(z.a)(se),ke=Te.props;return{mode:ke.mode==="horizontal"?"vertical":ke.mode,visible:se.props.isOpen,level:ke.level+1,inlineIndent:ke.inlineIndent,focusable:!1,onClick:se.onSubMenuClick,onSelect:se.onSelect,onDeselect:se.onDeselect,onDestroy:se.onDestroy,selectedKeys:ke.selectedKeys,eventKey:"".concat(ke.eventKey,"-menu-"),openKeys:ke.openKeys,motion:ke.motion,onOpenChange:se.onOpenChange,subMenuOpenDelay:ke.subMenuOpenDelay,parentMenu:Object(z.a)(se),subMenuCloseDelay:ke.subMenuCloseDelay,forceSubMenuRender:ke.forceSubMenuRender,triggerSubMenuAction:ke.triggerSubMenuAction,builtinPlacements:ke.builtinPlacements,defaultActiveFirst:ke.store.getState().defaultActiveFirst[Q(ke.eventKey)],multiple:ke.multiple,prefixCls:ke.rootPrefixCls,id:se.internalMenuId,manualRef:se.saveMenuInstance,itemIcon:ke.itemIcon,expandIcon:ke.expandIcon,direction:ke.direction}},se.getMotion=function(Te,ke){var rt=Object(z.a)(se),Ct=rt.haveRendered,At=se.props,cn=At.motion,yn=At.rootPrefixCls,en=Object(q.a)(Object(q.a)({},cn),{},{leavedClassName:"".concat(yn,"-hidden"),removeOnLeave:!1,motionAppear:Ct||!ke||Te!=="inline"});return en};var ve=Me.store,Ke=Me.eventKey,Pe=ve.getState(),st=Pe.defaultActiveFirst;se.isRootMenu=!1;var dt=!1;return st&&(dt=st[Ke]),et(ve,Ke,dt),se}return Object(M.a)(We,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var se=this,ve=this.props,Ke=ve.mode,Pe=ve.parentMenu,st=ve.manualRef;if(st&&st(this),Ke!=="horizontal"||!Pe.isRootMenu||!this.props.isOpen)return;this.minWidthTimeout=setTimeout(function(){return se.adjustWidth()},0)}},{key:"componentWillUnmount",value:function(){var se=this.props,ve=se.onDestroy,Ke=se.eventKey;ve&&ve(Ke),this.minWidthTimeout&&clearTimeout(this.minWidthTimeout),this.mouseenterTimeout&&clearTimeout(this.mouseenterTimeout)}},{key:"renderChildren",value:function(se){var ve=this,Ke=this.getBaseProps(),Pe=this.getMotion(Ke.mode,Ke.visible);if(this.haveRendered=!0,this.haveOpened=this.haveOpened||Ke.visible||Ke.forceSubMenuRender,!this.haveOpened)return H.createElement("div",null);var st=Ke.direction;return H.createElement(nt.default,Object.assign({visible:Ke.visible},Pe),function(dt){var Te=dt.className,ke=dt.style,rt=r()("".concat(Ke.prefixCls,"-sub"),Te,Object(g.a)({},"".concat(Ke.prefixCls,"-rtl"),st==="rtl"));return H.createElement(ge,Object.assign({},Ke,{id:ve.internalMenuId,className:rt,style:ke}),se)})}},{key:"render",value:function(){var se,ve=Object(q.a)({},this.props),Ke=ve.isOpen,Pe=this.getPrefixCls(),st=ve.mode==="inline",dt=r()(Pe,"".concat(Pe,"-").concat(ve.mode),(se={},Object(g.a)(se,ve.className,!!ve.className),Object(g.a)(se,this.getOpenClassName(),Ke),Object(g.a)(se,this.getActiveClassName(),ve.active||Ke&&!st),Object(g.a)(se,this.getDisabledClassName(),ve.disabled),Object(g.a)(se,this.getSelectedClassName(),this.isChildrenSelected()),se));this.internalMenuId||(ve.eventKey?this.internalMenuId="".concat(ve.eventKey,"$Menu"):(Qe+=1,this.internalMenuId="$__$".concat(Qe,"$Menu")));var Te={},ke={},rt={};ve.disabled||(Te={onMouseLeave:this.onMouseLeave,onMouseEnter:this.onMouseEnter},ke={onClick:this.onTitleClick},rt={onMouseEnter:this.onTitleMouseEnter,onMouseLeave:this.onTitleMouseLeave});var Ct={},At=ve.direction;st&&(At==="rtl"?Ct.paddingRight=ve.inlineIndent*ve.level:Ct.paddingLeft=ve.inlineIndent*ve.level);var cn={};this.props.isOpen&&(cn={"aria-owns":this.internalMenuId});var yn=null;ve.mode!=="horizontal"&&(yn=this.props.expandIcon,typeof this.props.expandIcon=="function"&&(yn=H.createElement(this.props.expandIcon,Object(q.a)({},this.props))));var en=H.createElement("div",Object.assign({ref:this.saveSubMenuTitle,style:Ct,className:"".concat(Pe,"-title"),role:"button"},rt,ke,{"aria-expanded":Ke},cn,{"aria-haspopup":"true",title:typeof ve.title=="string"?ve.title:void 0}),ve.title,yn||H.createElement("i",{className:"".concat(Pe,"-arrow")})),Dt=this.renderChildren(ve.children),Rn=ve.parentMenu.isRootMenu?ve.parentMenu.props.getPopupContainer:function(ui){return ui.parentNode},Fn=gt[ve.mode],Cn=ve.popupOffset?{offset:ve.popupOffset}:{},Qt=ve.mode==="inline"?"":ve.popupClassName;Qt+=At==="rtl"?" ".concat(Pe,"-rtl"):"";var Sn=ve.disabled,Bn=ve.triggerSubMenuAction,li=ve.subMenuOpenDelay,ct=ve.forceSubMenuRender,St=ve.subMenuCloseDelay,zn=ve.builtinPlacements;_e.forEach(function(ui){return delete ve[ui]}),delete ve.onClick;var pi=At==="rtl"?Object.assign({},He,zn):Object.assign({},it,zn);return delete ve.direction,H.createElement("li",Object.assign({},ve,Te,{className:dt,role:"menuitem"}),st&&en,st&&Dt,!st&&H.createElement(Ye.a,{prefixCls:Pe,popupClassName:r()("".concat(Pe,"-popup"),Qt),getPopupContainer:Rn,builtinPlacements:pi,popupPlacement:Fn,popupVisible:Ke,popupAlign:Cn,popup:Dt,action:Sn?[]:[Bn],mouseEnterDelay:li,mouseLeaveDelay:St,onPopupVisibleChange:this.onPopupVisibleChange,forceRender:ct},en))}}]),We}(H.Component);tt.defaultProps={onMouseEnter:R,onMouseLeave:R,onTitleMouseEnter:R,onTitleMouseLeave:R,onTitleClick:R,manualRef:R,mode:"vertical",title:""};var Je=Object(F.b)(function(at,Be){var We=at.openKeys,Me=at.activeKey,se=at.selectedKeys,ve=Be.eventKey,Ke=Be.subMenuKey;return{isOpen:We.indexOf(ve)>-1,active:Me[Ke]===ve,selectedKeys:se}})(tt);Je.isSubMenu=!0;var vt=Je,wt="menuitem-overflowed",Et=.5,xt=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(){var Me;return Object(V.a)(this,We),Me=Be.apply(this,arguments),Me.resizeObserver=null,Me.mutationObserver=null,Me.originalTotalWidth=0,Me.overflowedItems=[],Me.menuItemSizes=[],Me.cancelFrameId=null,Me.state={lastVisibleIndex:void 0},Me.getMenuItemNodes=function(){var se=Me.props.prefixCls,ve=oe.findDOMNode(Object(z.a)(Me));return ve?[].slice.call(ve.children).filter(function(Ke){return Ke.className.split(" ").indexOf("".concat(se,"-overflowed-submenu"))<0}):[]},Me.getOverflowedSubMenuItem=function(se,ve,Ke){var Pe=Me.props,st=Pe.overflowedIndicator,dt=Pe.level,Te=Pe.mode,ke=Pe.prefixCls,rt=Pe.theme;if(dt!==1||Te!=="horizontal")return null;var Ct=Me.props.children[0],At=Ct.props,cn=At.children,yn=At.title,en=At.style,Dt=Object(he.a)(At,["children","title","style"]),Rn=Object(q.a)({},en),Fn="".concat(se,"-overflowed-indicator"),Cn="".concat(se,"-overflowed-indicator");ve.length===0&&Ke!==!0?Rn=Object(q.a)(Object(q.a)({},Rn),{},{display:"none"}):Ke&&(Rn=Object(q.a)(Object(q.a)({},Rn),{},{visibility:"hidden",position:"absolute"}),Fn="".concat(Fn,"-placeholder"),Cn="".concat(Cn,"-placeholder"));var Qt=rt?"".concat(ke,"-").concat(rt):"",Sn={};return _e.forEach(function(Bn){Dt[Bn]!==void 0&&(Sn[Bn]=Dt[Bn])}),H.createElement(vt,Object.assign({title:st,className:"".concat(ke,"-overflowed-submenu"),popupClassName:Qt},Sn,{key:Fn,eventKey:Cn,disabled:!1,style:Rn}),ve)},Me.setChildrenWidthAndResize=function(){if(Me.props.mode!=="horizontal")return;var se=oe.findDOMNode(Object(z.a)(Me));if(!se)return;var ve=se.children;if(!ve||ve.length===0)return;var Ke=se.children[ve.length-1];Ee(Ke,"display","inline-block");var Pe=Me.getMenuItemNodes(),st=Pe.filter(function(dt){return dt.className.split(" ").indexOf(wt)>=0});st.forEach(function(dt){Ee(dt,"display","inline-block")}),Me.menuItemSizes=Pe.map(function(dt){return pe(dt,!0)}),st.forEach(function(dt){Ee(dt,"display","none")}),Me.overflowedIndicatorWidth=pe(se.children[se.children.length-1],!0),Me.originalTotalWidth=Me.menuItemSizes.reduce(function(dt,Te){return dt+Te},0),Me.handleResize(),Ee(Ke,"display","none")},Me.handleResize=function(){if(Me.props.mode!=="horizontal")return;var se=oe.findDOMNode(Object(z.a)(Me));if(!se)return;var ve=pe(se);Me.overflowedItems=[];var Ke=0,Pe;Me.originalTotalWidth>ve+Et&&(Pe=-1,Me.menuItemSizes.forEach(function(st){Ke+=st,Ke+Me.overflowedIndicatorWidth<=ve&&(Pe+=1)})),Me.setState({lastVisibleIndex:Pe})},Me}return Object(M.a)(We,[{key:"componentDidMount",value:function(){var se=this;if(this.setChildrenWidthAndResize(),this.props.level===1&&this.props.mode==="horizontal"){var ve=oe.findDOMNode(this);if(!ve)return;this.resizeObserver=new Le.default(function(Ke){Ke.forEach(function(){var Pe=se.cancelFrameId;cancelAnimationFrame(Pe),se.cancelFrameId=requestAnimationFrame(se.setChildrenWidthAndResize)})}),[].slice.call(ve.children).concat(ve).forEach(function(Ke){se.resizeObserver.observe(Ke)}),typeof MutationObserver!="undefined"&&(this.mutationObserver=new MutationObserver(function(){se.resizeObserver.disconnect(),[].slice.call(ve.children).concat(ve).forEach(function(Ke){se.resizeObserver.observe(Ke)}),se.setChildrenWidthAndResize()}),this.mutationObserver.observe(ve,{attributes:!1,childList:!0,subTree:!1}))}}},{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),cancelAnimationFrame(this.cancelFrameId)}},{key:"renderChildren",value:function(se){var ve=this,Ke=this.state.lastVisibleIndex;return(se||[]).reduce(function(Pe,st,dt){var Te=st;if(ve.props.mode==="horizontal"){var ke=ve.getOverflowedSubMenuItem(st.props.eventKey,[]);Ke!==void 0&&ve.props.className.indexOf("".concat(ve.props.prefixCls,"-root"))!==-1&&(dt>Ke&&(Te=H.cloneElement(st,{style:{display:"none"},eventKey:"".concat(st.props.eventKey,"-hidden"),className:"".concat(wt)})),dt===Ke+1&&(ve.overflowedItems=se.slice(Ke+1).map(function(Ct){return H.cloneElement(Ct,{key:Ct.props.eventKey,mode:"vertical-left"})}),ke=ve.getOverflowedSubMenuItem(st.props.eventKey,ve.overflowedItems)));var rt=[].concat(Object(we.a)(Pe),[ke,Te]);return dt===se.length-1&&rt.push(ve.getOverflowedSubMenuItem(st.props.eventKey,[],!0)),rt}return[].concat(Object(we.a)(Pe),[Te])},[])}},{key:"render",value:function(){var se=this.props,ve=se.visible,Ke=se.prefixCls,Pe=se.overflowedIndicator,st=se.mode,dt=se.level,Te=se.tag,ke=se.children,rt=se.theme,Ct=Object(he.a)(se,["visible","prefixCls","overflowedIndicator","mode","level","tag","children","theme"]),At=Te;return H.createElement(At,Object.assign({},Ct),this.renderChildren(ke))}}]),We}(H.Component);xt.defaultProps={tag:"div",className:""};var kt=xt;function Ot(at){return at.length?at.every(function(Be){return!!Be.props.disabled}):!0}function Ae(at,Be,We){var Me=at.getState();at.setState({activeKey:Object(q.a)(Object(q.a)({},Me.activeKey),{},Object(g.a)({},Be,We))})}function Ce(at){return at.eventKey||"0-menu-"}function Ge(at,Be){var We=Be,Me=at.children,se=at.eventKey;if(We){var ve;if(ne(Me,function(Ke,Pe){Ke&&Ke.props&&!Ke.props.disabled&&We===G(Ke,se,Pe)&&(ve=!0)}),ve)return We}return We=null,at.defaultActiveFirst&&ne(Me,function(Ke,Pe){!We&&Ke&&!Ke.props.disabled&&(We=G(Ke,se,Pe))}),We}function ze(at){if(at){var Be=this.instanceArray.indexOf(at);Be!==-1?this.instanceArray[Be]=at:this.instanceArray.push(at)}}var Re=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(Me){var se;return Object(V.a)(this,We),se=Be.call(this,Me),se.onKeyDown=function(ve,Ke){var Pe=ve.keyCode,st;if(se.getFlatInstanceArray().forEach(function(Te){Te&&Te.props.active&&Te.onKeyDown&&(st=Te.onKeyDown(ve))}),st)return 1;var dt=null;return(Pe===f.a.UP||Pe===f.a.DOWN)&&(dt=se.step(Pe===f.a.UP?-1:1)),dt?(ve.preventDefault(),Ae(se.props.store,Ce(se.props),dt.props.eventKey),typeof Ke=="function"&&Ke(dt),1):void 0},se.onItemHover=function(ve){var Ke=ve.key,Pe=ve.hover;Ae(se.props.store,Ce(se.props),Pe?Ke:null)},se.onDeselect=function(ve){se.props.onDeselect(ve)},se.onSelect=function(ve){se.props.onSelect(ve)},se.onClick=function(ve){se.props.onClick(ve)},se.onOpenChange=function(ve){se.props.onOpenChange(ve)},se.onDestroy=function(ve){se.props.onDestroy(ve)},se.getFlatInstanceArray=function(){return se.instanceArray},se.step=function(ve){var Ke=se.getFlatInstanceArray(),Pe=se.props.store.getState().activeKey[Ce(se.props)],st=Ke.length;if(!st)return null;ve<0&&(Ke=Ke.concat().reverse());var dt=-1;if(Ke.every(function(Ct,At){return Ct&&Ct.props.eventKey===Pe?(dt=At,!1):!0}),!se.props.defaultActiveFirst&&dt!==-1&&Ot(Ke.slice(dt,st-1)))return;var Te=(dt+1)%st,ke=Te;do{var rt=Ke[ke];if(!rt||rt.props.disabled)ke=(ke+1)%st;else return rt}while(ke!==Te);return null},se.renderCommonMenuItem=function(ve,Ke,Pe){var st=se.props.store.getState(),dt=Object(z.a)(se),Te=dt.props,ke=G(ve,Te.eventKey,Ke),rt=ve.props;if(!rt||typeof ve.type=="string")return ve;var Ct=ke===st.activeKey,At=Object(q.a)(Object(q.a)({mode:rt.mode||Te.mode,level:Te.level,inlineIndent:Te.inlineIndent,renderMenuItem:se.renderMenuItem,rootPrefixCls:Te.prefixCls,index:Ke,parentMenu:Te.parentMenu,manualRef:rt.disabled?void 0:Object(u.a)(ve.ref,ze.bind(Object(z.a)(se))),eventKey:ke,active:!rt.disabled&&Ct,multiple:Te.multiple,onClick:function(yn){(rt.onClick||R)(yn),se.onClick(yn)},onItemHover:se.onItemHover,motion:Te.motion,subMenuOpenDelay:Te.subMenuOpenDelay,subMenuCloseDelay:Te.subMenuCloseDelay,forceSubMenuRender:Te.forceSubMenuRender,onOpenChange:se.onOpenChange,onDeselect:se.onDeselect,onSelect:se.onSelect,builtinPlacements:Te.builtinPlacements,itemIcon:rt.itemIcon||se.props.itemIcon,expandIcon:rt.expandIcon||se.props.expandIcon},Pe),{},{direction:Te.direction});return(Te.mode==="inline"||Oe())&&(At.triggerSubMenuAction="click"),H.cloneElement(ve,At)},se.renderMenuItem=function(ve,Ke,Pe){if(!ve)return null;var st=se.props.store.getState(),dt={openKeys:st.openKeys,selectedKeys:st.selectedKeys,triggerSubMenuAction:se.props.triggerSubMenuAction,subMenuKey:Pe};return se.renderCommonMenuItem(ve,Ke,dt)},Me.store.setState({activeKey:Object(q.a)(Object(q.a)({},Me.store.getState().activeKey),{},Object(g.a)({},Me.eventKey,Ge(Me,Me.activeKey)))}),se.instanceArray=[],se}return Object(M.a)(We,[{key:"componentDidMount",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"shouldComponentUpdate",value:function(se){return this.props.visible||se.visible||this.props.className!==se.className||!s()(this.props.style,se.style)}},{key:"componentDidUpdate",value:function(se){var ve=this.props,Ke="activeKey"in ve?ve.activeKey:ve.store.getState().activeKey[Ce(ve)],Pe=Ge(ve,Ke);if(Pe!==Ke)Ae(ve.store,Ce(ve),Pe);else if("activeKey"in se){var st=Ge(se,se.activeKey);Pe!==st&&Ae(ve.store,Ce(ve),Pe)}}},{key:"render",value:function(){var se=this,ve=Object(I.a)({},this.props);this.instanceArray=[];var Ke=r()(ve.prefixCls,ve.className,"".concat(ve.prefixCls,"-").concat(ve.mode)),Pe={className:Ke,role:ve.role||"menu"};ve.id&&(Pe.id=ve.id),ve.focusable&&(Pe.tabIndex=0,Pe.onKeyDown=this.onKeyDown);var st=ve.prefixCls,dt=ve.eventKey,Te=ve.visible,ke=ve.level,rt=ve.mode,Ct=ve.overflowedIndicator,At=ve.theme;return _e.forEach(function(cn){return delete ve[cn]}),delete ve.onClick,H.createElement(kt,Object.assign({},ve,{prefixCls:st,mode:rt,tag:"ul",level:ke,theme:At,visible:Te,overflowedIndicator:Ct},Pe),H.Children.map(ve.children,function(cn,yn){return se.renderMenuItem(cn,yn,dt||"0-menu-")}))}}]),We}(H.Component);Re.defaultProps={prefixCls:"rc-menu",className:"",mode:"vertical",level:1,inlineIndent:24,visible:!0,focusable:!0,style:{},manualRef:R};var je=Object(F.b)()(Re),ge=je,de=W("Kwbf");function ce(at,Be,We){var Me=at.prefixCls,se=at.motion,ve=at.defaultMotions,Ke=ve===void 0?{}:ve,Pe=at.openAnimation,st=at.openTransitionName,dt=Be.switchingModeFromInline;if(se)return se;if(Object(a.a)(Pe)==="object"&&Pe)Object(de.a)(!1,"Object type of `openAnimation` is removed. Please use `motion` instead.");else if(typeof Pe=="string")return{motionName:"".concat(Me,"-open-").concat(Pe)};if(st)return{motionName:st};var Te=Ke[We];return Te||(dt?null:Ke.other)}var re=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(Me){var se;Object(V.a)(this,We),se=Be.call(this,Me),se.inlineOpenKeys=[],se.onSelect=function(Pe){var st=Object(z.a)(se),dt=st.props;if(dt.selectable){var Te=se.store.getState(),ke=Te.selectedKeys,rt=Pe.key;dt.multiple?ke=ke.concat([rt]):ke=[rt],"selectedKeys"in dt||se.store.setState({selectedKeys:ke}),dt.onSelect(Object(q.a)(Object(q.a)({},Pe),{},{selectedKeys:ke}))}},se.onClick=function(Pe){var st=se.getRealMenuMode(),dt=Object(z.a)(se),Te=dt.store,ke=dt.props.onOpenChange;st!=="inline"&&!("openKeys"in se.props)&&(Te.setState({openKeys:[]}),ke([])),se.props.onClick(Pe)},se.onKeyDown=function(Pe,st){se.innerMenu.getWrappedInstance().onKeyDown(Pe,st)},se.onOpenChange=function(Pe){var st=Object(z.a)(se),dt=st.props,Te=se.store.getState().openKeys.concat(),ke=!1,rt=function(At){var cn=!1;if(At.open)cn=Te.indexOf(At.key)===-1,cn&&Te.push(At.key);else{var yn=Te.indexOf(At.key);cn=yn!==-1,cn&&Te.splice(yn,1)}ke=ke||cn};Array.isArray(Pe)?Pe.forEach(rt):rt(Pe),ke&&("openKeys"in se.props||se.store.setState({openKeys:Te}),dt.onOpenChange(Te))},se.onDeselect=function(Pe){var st=Object(z.a)(se),dt=st.props;if(dt.selectable){var Te=se.store.getState().selectedKeys.concat(),ke=Pe.key,rt=Te.indexOf(ke);rt!==-1&&Te.splice(rt,1),"selectedKeys"in dt||se.store.setState({selectedKeys:Te}),dt.onDeselect(Object(q.a)(Object(q.a)({},Pe),{},{selectedKeys:Te}))}},se.onMouseEnter=function(Pe){se.restoreModeVerticalFromInline();var st=se.props.onMouseEnter;st&&st(Pe)},se.onTransitionEnd=function(Pe){var st=Pe.propertyName==="width"&&Pe.target===Pe.currentTarget,dt=Pe.target.className,Te=Object.prototype.toString.call(dt)==="[object SVGAnimatedString]"?dt.animVal:dt,ke=Pe.propertyName==="font-size"&&Te.indexOf("anticon")>=0;(st||ke)&&se.restoreModeVerticalFromInline()},se.setInnerMenu=function(Pe){se.innerMenu=Pe},se.isRootMenu=!0;var ve=Me.defaultSelectedKeys,Ke=Me.defaultOpenKeys;return"selectedKeys"in Me&&(ve=Me.selectedKeys||[]),"openKeys"in Me&&(Ke=Me.openKeys||[]),se.store=Object(F.c)({selectedKeys:ve,openKeys:Ke,activeKey:{"0-menu-":Ge(Me,Me.activeKey)}}),se.state={switchingModeFromInline:!1},se}return Object(M.a)(We,[{key:"componentDidMount",value:function(){this.updateMiniStore(),this.updateMenuDisplay()}},{key:"componentDidUpdate",value:function(se){this.updateOpentKeysWhenSwitchMode(se),this.updateMiniStore();var ve=this.props,Ke=ve.siderCollapsed,Pe=ve.inlineCollapsed,st=ve.onOpenChange;(!se.inlineCollapsed&&Pe||!se.siderCollapsed&&Ke)&&st([]),this.updateMenuDisplay()}},{key:"updateOpentKeysWhenSwitchMode",value:function(se){var ve=this.props,Ke=this.store,Pe=this.inlineOpenKeys,st=Ke.getState(),dt={};se.mode==="inline"&&ve.mode!=="inline"&&this.setState({switchingModeFromInline:!0}),"openKeys"in ve||((ve.inlineCollapsed&&!se.inlineCollapsed||ve.siderCollapsed&&!se.siderCollapsed)&&(this.setState({switchingModeFromInline:!0}),this.inlineOpenKeys=st.openKeys.concat(),dt.openKeys=[]),(!ve.inlineCollapsed&&se.inlineCollapsed||!ve.siderCollapsed&&se.siderCollapsed)&&(dt.openKeys=Pe,this.inlineOpenKeys=[])),Object.keys(dt).length&&Ke.setState(dt)}},{key:"updateMenuDisplay",value:function(){var se=this.props.collapsedWidth,ve=this.store,Ke=this.prevOpenKeys,Pe=this.getInlineCollapsed()&&(se===0||se==="0"||se==="0px");Pe?(this.prevOpenKeys=ve.getState().openKeys.concat(),this.store.setState({openKeys:[]})):Ke&&(this.store.setState({openKeys:Ke}),this.prevOpenKeys=null)}},{key:"getRealMenuMode",value:function(){var se=this.props.mode,ve=this.state.switchingModeFromInline,Ke=this.getInlineCollapsed();return ve&&Ke?"inline":Ke?"vertical":se}},{key:"getInlineCollapsed",value:function(){var se=this.props,ve=se.inlineCollapsed,Ke=se.siderCollapsed;return Ke!==void 0?Ke:ve}},{key:"restoreModeVerticalFromInline",value:function(){var se=this.state.switchingModeFromInline;se&&this.setState({switchingModeFromInline:!1})}},{key:"updateMiniStore",value:function(){"selectedKeys"in this.props&&this.store.setState({selectedKeys:this.props.selectedKeys||[]}),"openKeys"in this.props&&this.store.setState({openKeys:this.props.openKeys||[]})}},{key:"render",value:function(){var se=Object(q.a)({},Object(D.default)(this.props,["collapsedWidth","siderCollapsed","defaultMotions"])),ve=this.getRealMenuMode();return se.className+=" ".concat(se.prefixCls,"-root"),se.direction==="rtl"&&(se.className+=" ".concat(se.prefixCls,"-rtl")),se=Object(q.a)(Object(q.a)({},se),{},{mode:ve,onClick:this.onClick,onOpenChange:this.onOpenChange,onDeselect:this.onDeselect,onSelect:this.onSelect,onMouseEnter:this.onMouseEnter,onTransitionEnd:this.onTransitionEnd,parentMenu:this,motion:ce(this.props,this.state,ve)}),delete se.openAnimation,delete se.openTransitionName,H.createElement(F.a,{store:this.store},H.createElement(ge,Object.assign({},se,{ref:this.setInnerMenu}),this.props.children))}}]),We}(H.Component);re.defaultProps={selectable:!0,onClick:R,onSelect:R,onOpenChange:R,onDeselect:R,defaultSelectedKeys:[],defaultOpenKeys:[],subMenuOpenDelay:.1,subMenuCloseDelay:.1,triggerSubMenuAction:"hover",prefixCls:"rc-menu",className:"",mode:"vertical",style:{},builtinPlacements:{},overflowedIndicator:H.createElement("span",null,"\xB7\xB7\xB7")};var ae=re,ue=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(){var Me;return Object(V.a)(this,We),Me=Be.apply(this,arguments),Me.onKeyDown=function(se){var ve=se.keyCode;return ve===f.a.ENTER?(Me.onClick(se),!0):void 0},Me.onMouseLeave=function(se){var ve=Me.props,Ke=ve.eventKey,Pe=ve.onItemHover,st=ve.onMouseLeave;Pe({key:Ke,hover:!1}),st({key:Ke,domEvent:se})},Me.onMouseEnter=function(se){var ve=Me.props,Ke=ve.eventKey,Pe=ve.onItemHover,st=ve.onMouseEnter;Pe({key:Ke,hover:!0}),st({key:Ke,domEvent:se})},Me.onClick=function(se){var ve=Me.props,Ke=ve.eventKey,Pe=ve.multiple,st=ve.onClick,dt=ve.onSelect,Te=ve.onDeselect,ke=ve.isSelected,rt={key:Ke,keyPath:[Ke],item:Object(z.a)(Me),domEvent:se};st(rt),Pe?ke?Te(rt):dt(rt):ke||dt(rt)},Me.saveNode=function(se){Me.node=se},Me}return Object(M.a)(We,[{key:"componentDidMount",value:function(){this.callRef()}},{key:"componentDidUpdate",value:function(){this.callRef()}},{key:"componentWillUnmount",value:function(){var se=this.props;se.onDestroy&&se.onDestroy(se.eventKey)}},{key:"getPrefixCls",value:function(){return"".concat(this.props.rootPrefixCls,"-item")}},{key:"getActiveClassName",value:function(){return"".concat(this.getPrefixCls(),"-active")}},{key:"getSelectedClassName",value:function(){return"".concat(this.getPrefixCls(),"-selected")}},{key:"getDisabledClassName",value:function(){return"".concat(this.getPrefixCls(),"-disabled")}},{key:"callRef",value:function(){this.props.manualRef&&this.props.manualRef(this)}},{key:"render",value:function(){var se,ve=Object(q.a)({},this.props),Ke=r()(this.getPrefixCls(),ve.className,(se={},Object(g.a)(se,this.getActiveClassName(),!ve.disabled&&ve.active),Object(g.a)(se,this.getSelectedClassName(),ve.isSelected),Object(g.a)(se,this.getDisabledClassName(),ve.disabled),se)),Pe=Object(q.a)(Object(q.a)({},ve.attribute),{},{title:typeof ve.title=="string"?ve.title:void 0,className:Ke,role:ve.role||"menuitem","aria-disabled":ve.disabled});ve.role==="option"?Pe=Object(q.a)(Object(q.a)({},Pe),{},{role:"option","aria-selected":ve.isSelected}):(ve.role===null||ve.role==="none")&&(Pe.role="none");var st={onClick:ve.disabled?null:this.onClick,onMouseLeave:ve.disabled?null:this.onMouseLeave,onMouseEnter:ve.disabled?null:this.onMouseEnter},dt=Object(q.a)({},ve.style);ve.mode==="inline"&&(ve.direction==="rtl"?dt.paddingRight=ve.inlineIndent*ve.level:dt.paddingLeft=ve.inlineIndent*ve.level),_e.forEach(function(ke){return delete ve[ke]}),delete ve.direction;var Te=this.props.itemIcon;return typeof this.props.itemIcon=="function"&&(Te=H.createElement(this.props.itemIcon,this.props)),H.createElement("li",Object.assign({},Object(D.default)(ve,["onClick","onMouseEnter","onMouseLeave","onSelect"]),Pe,st,{style:dt,ref:this.saveNode}),ve.children,Te)}}]),We}(H.Component);ue.isMenuItem=!0,ue.defaultProps={onSelect:R,onMouseEnter:R,onMouseLeave:R,manualRef:R};var fe=Object(F.b)(function(at,Be){var We=at.activeKey,Me=at.selectedKeys,se=Be.eventKey,ve=Be.subMenuKey;return{active:We[ve]===se,isSelected:Me.indexOf(se)!==-1}})(ue),be=fe,Ie=function(at){Object(U.a)(We,at);var Be=Object(L.a)(We);function We(){var Me;return Object(V.a)(this,We),Me=Be.apply(this,arguments),Me.renderInnerMenuItem=function(se){var ve=Me.props,Ke=ve.renderMenuItem,Pe=ve.index;return Ke(se,Pe,Me.props.subMenuKey)},Me}return Object(M.a)(We,[{key:"render",value:function(){var se=Object(I.a)({},this.props),ve=se.className,Ke=ve===void 0?"":ve,Pe=se.rootPrefixCls,st="".concat(Pe,"-item-group-title"),dt="".concat(Pe,"-item-group-list"),Te=se.title,ke=se.children;return _e.forEach(function(rt){return delete se[rt]}),delete se.onClick,delete se.direction,H.createElement("li",Object.assign({},se,{className:"".concat(Ke," ").concat(Pe,"-item-group")}),H.createElement("div",{className:st,title:typeof Te=="string"?Te:void 0},Te),H.createElement("ul",{className:dt},H.Children.map(ke,this.renderInnerMenuItem)))}}]),We}(H.Component);Ie.isMenuItemGroup=!0,Ie.defaultProps={disabled:!0};var Xe=Ie,ut=function(Be){var We=Be.className,Me=Be.rootPrefixCls,se=Be.style;return H.createElement("li",{className:"".concat(We," ").concat(Me,"-item-divider"),style:se})};ut.defaultProps={disabled:!0,className:"",style:{}};var bt=ut,ft=Se.e=ae},"55Ip":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return n});var q=W("Ty5D"),V=W("dI71"),M=W("q1tI"),z=W.n(M),U=W("YS25"),L=W("17x9"),H=W.n(L),F=W("wx14"),D=W("zLVn"),I=W("9R94"),g=function(v){Object(V.a)(p,v);function p(){for(var E,y=arguments.length,_=new Array(y),P=0;P=0||y.relatedTarget.className.indexOf("".concat(K,"-next"))>=0))return;v.setState({goInputText:""}),N(v.getValidValue())},v.go=function(y){var _=v.state.goInputText;if(_==="")return;(y.keyCode===d.ENTER||y.type==="click")&&(v.setState({goInputText:""}),v.props.quickGo(v.getValidValue()))},v}return Object(U.a)(b,[{key:"getValidValue",value:function(){var p=this.state,c=p.goInputText,E=p.current;return!c||isNaN(c)?E:Number(c)}},{key:"getPageSizeOptions",value:function(){var p=this.props,c=p.pageSize,E=p.pageSizeOptions;return E.some(function(y){return y.toString()===c.toString()})?E:E.concat([c.toString()]).sort(function(y,_){var P=isNaN(Number(y))?0:Number(y),N=isNaN(Number(_))?0:Number(_);return P-N})}},{key:"render",value:function(){var p=this,c=this.props,E=c.pageSize,y=c.locale,_=c.rootPrefixCls,P=c.changeSize,N=c.quickGo,K=c.goButton,$=c.selectComponentClass,B=c.buildOptionText,R=c.selectPrefixCls,G=c.disabled,Q=this.state.goInputText,ne="".concat(_,"-options"),le=$,_e=null,pe=null,Ee=null;if(!P&&!N)return null;var Oe=this.getPageSizeOptions();if(P&&le){var we=Oe.map(function(he,oe){return D.a.createElement(le.Option,{key:oe,value:he.toString()},(B||p.buildOptionText)(he))});_e=D.a.createElement(le,{disabled:G,prefixCls:R,showSearch:!1,className:"".concat(ne,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||Oe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(oe){return oe.parentNode}},we)}return N&&(K&&(Ee=typeof K=="boolean"?D.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:G,className:"".concat(ne,"-quick-jumper-button")},y.jump_to_confirm):D.a.createElement("span",{onClick:this.go,onKeyUp:this.go},K)),pe=D.a.createElement("div",{className:"".concat(ne,"-quick-jumper")},y.jump_to,D.a.createElement("input",{disabled:G,type:"text",value:Q,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),y.page,Ee)),D.a.createElement("li",{className:"".concat(ne)},_e,pe)}}]),b}(D.a.Component);s.defaultProps={pageSizeOptions:["10","20","50","100"]};var l=s,r=W("N2Kk");function a(){}function n(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function h(A,C,b){return b}function O(A,C,b){var v=typeof A=="undefined"?C.pageSize:A;return Math.floor((b.total-1)/v)+1}var S=function(A){Object(L.a)(b,A);var C=Object(H.a)(b);function b(v){var p;Object(z.a)(this,b),p=C.call(this,v),p.getJumpPrevPage=function(){return Math.max(1,p.state.current-(p.props.showLessItems?3:5))},p.getJumpNextPage=function(){return Math.min(O(void 0,p.state,p.props),p.state.current+(p.props.showLessItems?3:5))},p.getItemIcon=function(P,N){var K=p.props.prefixCls,$=P||D.a.createElement("button",{type:"button","aria-label":N,className:"".concat(K,"-item-link")});return typeof P=="function"&&($=D.a.createElement(P,Object(M.a)({},p.props))),$},p.savePaginationNode=function(P){p.paginationNode=P},p.isValid=function(P){return n(P)&&P!==p.state.current},p.shouldDisplayQuickJumper=function(){var P=p.props,N=P.showQuickJumper,K=P.pageSize,$=P.total;return $<=K?!1:N},p.handleKeyDown=function(P){(P.keyCode===d.ARROW_UP||P.keyCode===d.ARROW_DOWN)&&P.preventDefault()},p.handleKeyUp=function(P){var N=p.getValidValue(P),K=p.state.currentInputValue;N!==K&&p.setState({currentInputValue:N}),P.keyCode===d.ENTER?p.handleChange(N):P.keyCode===d.ARROW_UP?p.handleChange(N-1):P.keyCode===d.ARROW_DOWN&&p.handleChange(N+1)},p.changePageSize=function(P){var N=p.state.current,K=O(P,p.state,p.props);N=N>K?K:N,K===0&&(N=p.state.current),typeof P=="number"&&("pageSize"in p.props||p.setState({pageSize:P}),"current"in p.props||p.setState({current:N,currentInputValue:N})),p.props.onShowSizeChange(N,P),"onChange"in p.props&&p.props.onChange&&p.props.onChange(N,P)},p.handleChange=function(P){var N=p.props.disabled,K=P;if(p.isValid(K)&&!N){var $=O(void 0,p.state,p.props);K>$?K=$:K<1&&(K=1),"current"in p.props||p.setState({current:K,currentInputValue:K});var B=p.state.pageSize;return p.props.onChange(K,B),K}return p.state.current},p.prev=function(){p.hasPrev()&&p.handleChange(p.state.current-1)},p.next=function(){p.hasNext()&&p.handleChange(p.state.current+1)},p.jumpPrev=function(){p.handleChange(p.getJumpPrevPage())},p.jumpNext=function(){p.handleChange(p.getJumpNextPage())},p.hasPrev=function(){return p.state.current>1},p.hasNext=function(){return p.state.current2?K-2:0),B=2;B=E?_=E:_=Number(c),_}},{key:"getShowSizeChanger",value:function(){var p=this.props,c=p.showSizeChanger,E=p.total,y=p.totalBoundaryShowSizeChanger;return typeof c!="undefined"?c:E>y}},{key:"renderPrev",value:function(p){var c=this.props,E=c.prevIcon,y=c.itemRender,_=y(p,"prev",this.getItemIcon(E,"prev page")),P=!this.hasPrev();return Object(F.isValidElement)(_)?Object(F.cloneElement)(_,{disabled:P}):_}},{key:"renderNext",value:function(p){var c=this.props,E=c.nextIcon,y=c.itemRender,_=y(p,"next",this.getItemIcon(E,"next page")),P=!this.hasNext();return Object(F.isValidElement)(_)?Object(F.cloneElement)(_,{disabled:P}):_}},{key:"render",value:function(){var p=this,c=this.props,E=c.prefixCls,y=c.className,_=c.style,P=c.disabled,N=c.hideOnSinglePage,K=c.total,$=c.locale,B=c.showQuickJumper,R=c.showLessItems,G=c.showTitle,Q=c.showTotal,ne=c.simple,le=c.itemRender,_e=c.showPrevNextJumpers,pe=c.jumpPrevIcon,Ee=c.jumpNextIcon,Oe=c.selectComponentClass,we=c.selectPrefixCls,he=c.pageSizeOptions,oe=this.state,Le=oe.current,Ye=oe.pageSize,nt=oe.currentInputValue;if(N===!0&&K<=Ye)return null;var qe=O(void 0,this.state,this.props),it=[],He=null,$e=null,Qe=null,gt=null,et=null,tt=B&&B.goButton,Je=R?1:2,vt=Le-1>0?Le-1:0,wt=Le+1=Je*2&&Le!==1+2&&(it[0]=Object(F.cloneElement)(it[0],{className:"".concat(E,"-item-after-jump-prev")}),it.unshift(He)),qe-Le>=Je*2&&Le!==qe-2&&(it[it.length-1]=Object(F.cloneElement)(it[it.length-1],{className:"".concat(E,"-item-before-jump-next")}),it.push($e)),Ge!==1&&it.unshift(Qe),ze!==qe&&it.push(gt)}var ge=null;Q&&(ge=D.a.createElement("li",{className:"".concat(E,"-total-text")},Q(K,[K===0?0:(Le-1)*Ye+1,Le*Ye>K?K:Le*Ye])));var de=!this.hasPrev()||!qe,ce=!this.hasNext()||!qe;return D.a.createElement("ul",Object(q.a)({className:g()(E,y,Object(V.a)({},"".concat(E,"-disabled"),P)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},Et),ge,D.a.createElement("li",{title:G?$.prev_page:null,onClick:this.prev,tabIndex:de?null:0,onKeyPress:this.runIfEnterPrev,className:g()("".concat(E,"-prev"),Object(V.a)({},"".concat(E,"-disabled"),de)),"aria-disabled":de},this.renderPrev(vt)),it,D.a.createElement("li",{title:G?$.next_page:null,onClick:this.next,tabIndex:ce?null:0,onKeyPress:this.runIfEnterNext,className:g()("".concat(E,"-next"),Object(V.a)({},"".concat(E,"-disabled"),ce)),"aria-disabled":ce},this.renderNext(wt)),D.a.createElement(l,{disabled:P,locale:$,rootPrefixCls:E,selectComponentClass:Oe,selectPrefixCls:we,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Le,pageSize:Ye,pageSizeOptions:he,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:tt}))}}],[{key:"getDerivedStateFromProps",value:function(p,c){var E={};if("current"in p&&(E.current=p.current,p.current!==c.current&&(E.currentInputValue=E.current)),"pageSize"in p&&p.pageSize!==c.pageSize){var y=c.current,_=O(p.pageSize,c,p);y=y>_?_:y,"current"in p||(E.current=y,E.currentInputValue=y),E.pageSize=p.pageSize}return E}}]),b}(D.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:a,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:a,locale:r.a,style:{},itemRender:h,totalBoundaryShowSizeChanger:50};var x=S},"6RRn":function(Fe,Se,W){"use strict";var q=W("wCXF"),V=W("n6Qo");W.d(Se,"b",function(){return V.a});var M=W("IBYe"),z=W("6eGT"),U=W("hW8S");W.d(Se,"a",function(){return U.a}),Se.c=q.b},"6UM0":function(Fe,Se,W){var q,V;(function(){var M;(function(){"use strict";var U=[function(D,I,g){var f=g(1).Beautifier,u=g(5).Options;function d(s,l){var r=new f(s,l);return r.beautify()}D.exports=d,D.exports.defaultOptions=function(){return new u}},function(D,I,g){var f=g(2).Output,u=g(3).Token,d=g(4),s=g(5).Options,l=g(7).Tokenizer,r=g(7).line_starters,a=g(7).positionable_operators,n=g(7).TOKEN;function h(R,G){return G.indexOf(R)!==-1}function O(R){return R.replace(/^\s+/g,"")}function S(R){for(var G={},Q=0;QQ&&(Q=R.line_indent_level));var ne={mode:G,parent:R,last_token:R?R.last_token:new u(n.START_BLOCK,""),last_word:R?R.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Q,alignment:0,line_indent_level:R?R.line_indent_level:Q,start_line_index:this._output.get_line_number(),ternary_depth:0};return ne},$.prototype._reset=function(R){var G=R.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,G),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(c.BlockStatement);var Q=new l(R,this._options);return this._tokens=Q.tokenize(),R},$.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,G=this._reset(this._source_text),Q=this._options.eol;this._options.eol==="auto"&&(Q=`
`,G&&d.lineBreak.test(G||"")&&(Q=G.match(d.lineBreak)[0]));for(var ne=this._tokens.next();ne;)this.handle_token(ne),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ne,ne=this._tokens.next();return R=this._output.get_code(Q),R},$.prototype.handle_token=function(R,G){R.type===n.START_EXPR?this.handle_start_expr(R):R.type===n.END_EXPR?this.handle_end_expr(R):R.type===n.START_BLOCK?this.handle_start_block(R):R.type===n.END_BLOCK?this.handle_end_block(R):R.type===n.WORD?this.handle_word(R):R.type===n.RESERVED?this.handle_word(R):R.type===n.SEMICOLON?this.handle_semicolon(R):R.type===n.STRING?this.handle_string(R):R.type===n.EQUALS?this.handle_equals(R):R.type===n.OPERATOR?this.handle_operator(R):R.type===n.COMMA?this.handle_comma(R):R.type===n.BLOCK_COMMENT?this.handle_block_comment(R,G):R.type===n.COMMENT?this.handle_comment(R,G):R.type===n.DOT?this.handle_dot(R):R.type===n.EOF?this.handle_eof(R):R.type===n.UNKNOWN?this.handle_unknown(R,G):this.handle_unknown(R,G)},$.prototype.handle_whitespace_and_comments=function(R,G){var Q=R.newlines,ne=this._options.keep_array_indentation&&_(this._flags.mode);if(R.comments_before)for(var le=R.comments_before.next();le;)this.handle_whitespace_and_comments(le,G),this.handle_token(le,G),le=R.comments_before.next();if(ne)for(var _e=0;_e0,G);else if(this._options.max_preserve_newlines&&Q>this._options.max_preserve_newlines&&(Q=this._options.max_preserve_newlines),this._options.preserve_newlines&&Q>1){this.print_newline(!1,G);for(var pe=1;pe0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},$.prototype.set_mode=function(R){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,R),this._flags=this.create_flags(this._previous_flags,R),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},$.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===c.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},$.prototype.start_of_object_property=function(){return this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"]))},$.prototype.start_of_statement=function(R){var G=!1;return G=G||A(this._flags.last_token,["var","let","const"])&&R.type===n.WORD,G=G||x(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===c.ObjectLiteral&&this._flags.mode===c.Statement)&&A(this._flags.last_token,B)&&!R.newlines,G=G||x(this._flags.last_token,"else")&&!(x(R,"if")&&!R.comments_before),G=G||this._flags.last_token.type===n.END_EXPR&&(this._previous_flags.mode===c.ForInitializer||this._previous_flags.mode===c.Conditional),G=G||this._flags.last_token.type===n.WORD&&this._flags.mode===c.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==n.WORD&&R.type!==n.RESERVED,G=G||this._flags.mode===c.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),G?(this.set_mode(c.Statement),this.indent(),this.handle_whitespace_and_comments(R,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R,A(R,["do","for","if","while"])),!0):!1},$.prototype.handle_start_expr=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R);var G=c.Expression;if(R.text==="["){if(this._flags.last_token.type===n.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,r)&&(this._output.space_before_token=!0),this.print_token(R),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=c.ArrayLiteral,_(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),h(this._flags.last_token.type,[n.START_EXPR,n.END_EXPR,n.WORD,n.OPERATOR,n.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===n.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,G=c.ForInitializer):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=c.Conditional):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&R.whitespace_before===""?this._output.space_before_token=!1:(h(this._flags.last_token.text,r)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R);else if(this._flags.last_token.type===n.WORD){this._output.space_before_token=!1;var Q=this._tokens.peek(-3);if(this._options.space_after_named_function&&Q){var ne=this._tokens.peek(-4);A(Q,["async","function"])||Q.text==="*"&&A(ne,["async","function"])?this._output.space_before_token=!0:this._flags.mode===c.ObjectLiteral?(Q.text==="{"||Q.text===","||Q.text==="*"&&(ne.text==="{"||ne.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(R);(this._flags.last_token.type===n.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&h(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===n.START_BLOCK?this.print_newline():(this._flags.last_token.type===n.END_EXPR||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===n.COMMA)&&this.allow_wrap_or_preserved_newline(R,R.newlines),this.print_token(R),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},$.prototype.handle_end_expr=function(R){for(;this._flags.mode===c.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(R,R.text==="]"&&_(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===n.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(R),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===c.Conditional&&(this._previous_flags.mode=c.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},$.prototype.handle_start_block=function(R){this.handle_whitespace_and_comments(R);var G=this._tokens.peek(),Q=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===n.END_EXPR?(this.set_mode(c.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(c.BlockStatement):Q&&(h(Q.text,[":",","])&&h(G.type,[n.STRING,n.WORD,n.RESERVED])||h(G.text,["get","set","..."])&&h(Q.type,[n.WORD,n.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h(Q.text,[":",","])?this.set_mode(c.BlockStatement):this.set_mode(c.ObjectLiteral):this._flags.last_token.type===n.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(c.BlockStatement):h(this._flags.last_token.type,[n.EQUALS,n.START_EXPR,n.COMMA,n.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(c.ObjectLiteral):this.set_mode(c.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ne=!G.comments_before&&G.text==="}",le=ne&&this._flags.last_word==="function"&&this._flags.last_token.type===n.END_EXPR;if(this._options.brace_preserve_inline){var _e=0,pe=null;this._flags.inline_frame=!0;do if(_e+=1,pe=this._tokens.peek(_e-1),pe.newlines){this._flags.inline_frame=!1;break}while(pe.type!==n.EOF&&!(pe.type===n.END_BLOCK&&pe.opened===R))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==n.OPERATOR&&(le||this._flags.last_token.type===n.EQUALS||A(this._flags.last_token,C)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(this._previous_flags.mode)&&(this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.COMMA)&&((this._flags.last_token.type===n.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(R),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==n.OPERATOR&&this._flags.last_token.type!==n.START_EXPR&&(this._flags.last_token.type===n.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(R),this.indent(),!ne&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},$.prototype.handle_end_block=function(R){for(this.handle_whitespace_and_comments(R);this._flags.mode===c.Statement;)this.restore_mode();var G=this._flags.last_token.type===n.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(_(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(R)},$.prototype.handle_word=function(R){if(R.type===n.RESERVED){if(h(R.text,["set","get"])&&this._flags.mode!==c.ObjectLiteral)R.type=n.WORD;else if(R.text==="import"&&h(this._tokens.peek().text,["(","."]))R.type=n.WORD;else if(h(R.text,["as","from"])&&!this._flags.import_block)R.type=n.WORD;else if(this._flags.mode===c.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(R.type=n.WORD)}}if(this.start_of_statement(R)?A(this._flags.last_token,["var","let","const"])&&R.type===n.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!P(this._flags.mode)&&(this._flags.last_token.type!==n.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==n.EQUALS&&(this._options.preserve_newlines||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(R),this.print_newline()):this.handle_whitespace_and_comments(R),this._flags.do_block&&!this._flags.do_while)if(x(R,"while")){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&x(R,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===c.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&A(R,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(R),this._flags.in_case=!0;return}if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R)),x(R,"function")){(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(h(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===n.OPERATOR))&&(!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,B)?this._output.space_before_token=!0:x(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===n.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(P(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var Q="NONE";if(this._flags.last_token.type===n.END_BLOCK?this._previous_flags.inline_frame?Q="SPACE":A(R,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines?Q="NEWLINE":(Q="SPACE",this._output.space_before_token=!0):Q="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&this._flags.mode===c.BlockStatement?Q="NEWLINE":this._flags.last_token.type===n.SEMICOLON&&P(this._flags.mode)?Q="SPACE":this._flags.last_token.type===n.STRING?Q="NEWLINE":this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===c.ObjectLiteral&&h(this._last_last_text,["{",","]))?Q="SPACE":this._flags.last_token.type===n.START_BLOCK?this._flags.inline_frame?Q="SPACE":Q="NEWLINE":this._flags.last_token.type===n.END_EXPR&&(this._output.space_before_token=!0,Q="NEWLINE"),A(R,r)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Q="SPACE":Q="NEWLINE"),A(R,["else","catch","finally"]))if((!(this._flags.last_token.type===n.END_BLOCK&&this._previous_flags.mode===c.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ne=this._output.current_line;ne.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Q==="NEWLINE"?A(this._flags.last_token,C)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(R,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==n.END_EXPR?(this._flags.last_token.type!==n.START_EXPR||!A(R,["var","let","const"]))&&this._flags.last_token.text!==":"&&(x(R,"if")&&x(R.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(R,r)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Q==="SPACE"&&(this._output.space_before_token=!0);R.previous&&(R.previous.type===n.WORD||R.previous.type===n.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===n.RESERVED&&(R.text==="do"?this._flags.do_block=!0:R.text==="if"?this._flags.if_block=!0:R.text==="import"?this._flags.import_block=!0:this._flags.import_block&&x(R,"from")&&(this._flags.import_block=!1))},$.prototype.handle_semicolon=function(R){this.start_of_statement(R)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(R);for(var G=this._tokens.peek();this._flags.mode===c.Statement&&!(this._flags.if_block&&x(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(R)},$.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===n.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),this._flags.last_token.type===n.RESERVED||this._flags.last_token.type===n.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR||this._flags.last_token.type===n.EQUALS||this._flags.last_token.type===n.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R):R.text.startsWith("`")&&this._flags.last_token.type===n.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},$.prototype.handle_equals=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0},$.prototype.handle_comma=function(R){this.handle_whitespace_and_comments(R,!0),this.print_token(R),this._output.space_before_token=!0,this._flags.declaration_statement?(P(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)):this._flags.mode===c.ObjectLiteral||this._flags.mode===c.Statement&&this._flags.parent.mode===c.ObjectLiteral?(this._flags.mode===c.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)},$.prototype.handle_operator=function(R){var G=R.text==="*"&&(A(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[n.START_BLOCK,n.COMMA,n.END_BLOCK,n.SEMICOLON])),Q=h(R.text,["-","+"])&&(h(this._flags.last_token.type,[n.START_BLOCK,n.START_EXPR,n.EQUALS,n.OPERATOR])||h(this._flags.last_token.text,r)||this._flags.last_token.text===",");if(!this.start_of_statement(R)){var ne=!G;this.handle_whitespace_and_comments(R,ne)}if(R.text==="*"&&this._flags.last_token.type===n.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(this._flags.last_token.type===n.OPERATOR&&h(this._options.operator_position,p)&&this.allow_wrap_or_preserved_newline(R),R.text===":"&&this._flags.in_case){this.print_token(R),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==n.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var le=!0,_e=!0,pe=!1;if(R.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,pe=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!Q&&!G&&this._options.preserve_newlines&&h(R.text,a)){var Ee=R.text===":",Oe=Ee&&pe,we=Ee&&!pe;switch(this._options.operator_position){case v.before_newline:this._output.space_before_token=!we,this.print_token(R),(!Ee||Oe)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case v.after_newline:this._output.space_before_token=!0,!Ee||Oe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(R):this._output.space_before_token=!1,this.print_token(R),this._output.space_before_token=!0;return;case v.preserve_newline:we||this.allow_wrap_or_preserved_newline(R),le=!(this._output.just_added_newline()||we),this._output.space_before_token=le,this.print_token(R),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(R),le=!1;var he=this._tokens.peek();_e=he&&h(he.type,[n.WORD,n.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),le=this._flags.last_token.type===n.START_BLOCK,_e=!1;else if(h(R.text,["--","++","!","~"])||Q){if((this._flags.last_token.type===n.COMMA||this._flags.last_token.type===n.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),le=!1,_e=!1,R.newlines&&(R.text==="--"||R.text==="++"||R.text==="~")){var oe=A(this._flags.last_token,C)&&R.newlines;oe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(oe,!0)}this._flags.last_token.text===";"&&P(this._flags.mode)&&(le=!0),this._flags.last_token.type===n.RESERVED?le=!0:this._flags.last_token.type===n.END_EXPR?le=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===n.OPERATOR&&(le=h(R.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(R.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(_e=!0)),(this._flags.mode===c.BlockStatement&&!this._flags.inline_frame||this._flags.mode===c.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||le,this.print_token(R),this._output.space_before_token=_e},$.prototype.handle_block_comment=function(R,G){if(this._output.raw){this._output.add_raw_token(R),R.directives&&R.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(R.directives){this.print_newline(!1,G),this.print_token(R),R.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!d.newline.test(R.text)&&!R.newlines){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0;return}else this.print_block_commment(R,G)},$.prototype.print_block_commment=function(R,G){var Q=y(R.text),ne,le=!1,_e=!1,pe=R.whitespace_before,Ee=pe.length;if(this.print_newline(!1,G),this.print_token_line_indentation(R),this._output.add_token(Q[0]),this.print_newline(!1,G),Q.length>1){for(Q=Q.slice(1),le=N(Q,"*"),_e=K(Q,pe),le&&(this._flags.alignment=1),ne=0;ne=0;d--)if(this.__items[d].match(u))return!0;return!1},I.prototype.set_indent=function(u,d){this.is_empty()&&(this.__indent_count=u||0,this.__alignment_count=d||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},I.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},I.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},I.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var u=this.__parent.current_line;return u.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),u.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),u.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,u.__items[0]===" "&&(u.__items.splice(0,1),u.__character_count-=1),!0}return!1},I.prototype.is_empty=function(){return this.__items.length===0},I.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},I.prototype.push=function(u){this.__items.push(u);var d=u.lastIndexOf(`
`);d!==-1?this.__character_count=u.length-d:this.__character_count+=u.length},I.prototype.pop=function(){var u=null;return this.is_empty()||(u=this.__items.pop(),this.__character_count-=u.length),u},I.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},I.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},I.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},I.prototype.toString=function(){var u="";return this.is_empty()?this.__parent.indent_empty_lines&&(u=this.__parent.get_indent_string(this.__indent_count)):(u=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),u+=this.__items.join("")),u};function g(u,d){this.__cache=[""],this.__indent_size=u.indent_size,this.__indent_string=u.indent_char,u.indent_with_tabs||(this.__indent_string=new Array(u.indent_size+1).join(u.indent_char)),d=d||"",u.indent_level>0&&(d=new Array(u.indent_level+1).join(this.__indent_string)),this.__base_string=d,this.__base_string_length=d.length}g.prototype.get_indent_size=function(u,d){var s=this.__base_string_length;return d=d||0,u<0&&(s=0),s+=u*this.__indent_size,s+=d,s},g.prototype.get_indent_string=function(u,d){var s=this.__base_string;return d=d||0,u<0&&(u=0,s=""),d+=u*this.__indent_size,this.__ensure_cache(d),s+=this.__cache[d],s},g.prototype.__ensure_cache=function(u){for(;u>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var u=this.__cache.length,d=0,s="";this.__indent_size&&u>=this.__indent_size&&(d=Math.floor(u/this.__indent_size),u-=d*this.__indent_size,s=new Array(d+1).join(this.__indent_string)),u&&(s+=new Array(u+1).join(" ")),this.__cache.push(s)};function f(u,d){this.__indent_cache=new g(u,d),this.raw=!1,this._end_with_newline=u.end_with_newline,this.indent_size=u.indent_size,this.wrap_line_length=u.wrap_line_length,this.indent_empty_lines=u.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new I(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(u,d){return this.__indent_cache.get_indent_string(u,d)},f.prototype.get_indent_size=function(u,d){return this.__indent_cache.get_indent_size(u,d)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(u){return this.is_empty()||!u&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(u){this.trim(!0);var d=this.current_line.pop();d&&(d[d.length-1]===`
`&&(d=d.replace(/\n+$/g,"")),this.current_line.push(d)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return u!==`
`&&(s=s.replace(/[\n]/g,u)),s},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(u,d){return u=u||0,d=d||0,this.next_line.set_indent(u,d),this.__lines.length>1?(this.current_line.set_indent(u,d),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(u){for(var d=0;d1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(u,d){for(var s=this.__lines.length-2;s>=0;){var l=this.__lines[s];if(l.is_empty())break;if(l.item(0).indexOf(u)!==0&&l.item(-1)!==d){this.__lines.splice(s+1,0,new I(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},D.exports.Output=f},function(D){function I(g,f,u,d){this.type=g,this.text=f,this.comments_before=null,this.newlines=u||0,this.whitespace_before=d||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}D.exports.Token=I},function(D,I){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",u="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",d="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",s="(?:\\\\u[0-9a-fA-F]{4}|["+g+u+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+f+u+d+"])*";I.identifier=new RegExp(s+l,"g"),I.identifierStart=new RegExp(s),I.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+u+d+"])+");var r=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;I.newline=/[\n\r\u2028\u2029]/,I.lineBreak=new RegExp(`\r
|`+I.newline.source),I.allLineBreaks=new RegExp(I.lineBreak.source,"g")},function(D,I,g){var f=g(6).Options,u=["before-newline","after-newline","preserve-newline"];function d(s){f.call(this,s,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var a=0;a>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),b=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";b=b.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),b="\\?\\.(?!\\d) "+b,b=b.replace(/ /g,"|");var v=new RegExp(b),p="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),c=p.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+c.join("|")+")$"),y,_=function(N,K){u.call(this,N,K),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var $=new r(this._input),B=new a(this._input).read_options(this._options);this.__patterns={template:B,identifier:B.starting_with(l.identifier).matching(l.identifierMatch),number:$.matching(S),punct:$.matching(v),comment:$.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:$.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:$.matching(//),include:$.starting_with(/#include/).until_after(l.lineBreak),shebang:$.starting_with(/#!/).until_after(l.lineBreak),xml:$.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:B.until(/['\\\n\r\u2028\u2029]/),double_quote:B.until(/["\\\n\r\u2028\u2029]/),template_text:B.until(/[`\\$]/),template_expression:B.until(/[`}\\]/)}};_.prototype=new u,_.prototype._is_comment=function(N){return N.type===h.COMMENT||N.type===h.BLOCK_COMMENT||N.type===h.UNKNOWN},_.prototype._is_opening=function(N){return N.type===h.START_BLOCK||N.type===h.START_EXPR},_.prototype._is_closing=function(N,K){return(N.type===h.END_BLOCK||N.type===h.END_EXPR)&&K&&(N.text==="]"&&K.text==="["||N.text===")"&&K.text==="("||N.text==="}"&&K.text==="{")},_.prototype._reset=function(){y=!1},_.prototype._get_next_token=function(N,K){var $=null;this._readWhitespace();var B=this._input.peek();return B===null?this._create_token(h.EOF,""):($=$||this._read_non_javascript(B),$=$||this._read_string(B),$=$||this._read_word(N),$=$||this._read_singles(B),$=$||this._read_comment(B),$=$||this._read_regexp(B,N),$=$||this._read_xml(B,N),$=$||this._read_punctuation(),$=$||this._create_token(h.UNKNOWN,this._input.next()),$)},_.prototype._read_word=function(N){var K;if(K=this.__patterns.identifier.read(),K!=="")return K=K.replace(l.allLineBreaks,`
`),!(N.type===h.DOT||N.type===h.RESERVED&&(N.text==="set"||N.text==="get"))&&E.test(K)?(K==="in"||K==="of")&&(N.type===h.WORD||N.type===h.STRING)?this._create_token(h.OPERATOR,K):this._create_token(h.RESERVED,K):this._create_token(h.WORD,K);if(K=this.__patterns.number.read(),K!=="")return this._create_token(h.WORD,K)},_.prototype._read_singles=function(N){var K=null;return N==="("||N==="["?K=this._create_token(h.START_EXPR,N):N===")"||N==="]"?K=this._create_token(h.END_EXPR,N):N==="{"?K=this._create_token(h.START_BLOCK,N):N==="}"?K=this._create_token(h.END_BLOCK,N):N===";"?K=this._create_token(h.SEMICOLON,N):N==="."&&A.test(this._input.peek(1))?K=this._create_token(h.DOT,N):N===","&&(K=this._create_token(h.COMMA,N)),K&&this._input.next(),K},_.prototype._read_punctuation=function(){var N=this.__patterns.punct.read();if(N!=="")return N==="="?this._create_token(h.EQUALS,N):N==="?."?this._create_token(h.DOT,N):this._create_token(h.OPERATOR,N)},_.prototype._read_non_javascript=function(N){var K="";if(N==="#"){if(this._is_first_token()&&(K=this.__patterns.shebang.read(),K))return this._create_token(h.UNKNOWN,K.trim()+`
`);if(K=this.__patterns.include.read(),K)return this._create_token(h.UNKNOWN,K.trim()+`
`);N=this._input.next();var $="#";if(this._input.hasNext()&&this._input.testChar(x)){do N=this._input.next(),$+=N;while(this._input.hasNext()&&N!=="#"&&N!=="=");return N==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?($+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&($+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,$)}this._input.back()}else if(N==="<"&&this._is_first_token()){if(K=this.__patterns.html_comment_start.read(),K){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)K+=this._input.next();return y=!0,this._create_token(h.COMMENT,K)}}else if(y&&N==="-"&&(K=this.__patterns.html_comment_end.read(),K))return y=!1,this._create_token(h.COMMENT,K);return null},_.prototype._read_comment=function(N){var K=null;if(N==="/"){var $="";if(this._input.peek(1)==="*"){$=this.__patterns.block_comment.read();var B=O.get_directives($);B&&B.ignore==="start"&&($+=O.readIgnored(this._input)),$=$.replace(l.allLineBreaks,`
`),K=this._create_token(h.BLOCK_COMMENT,$),K.directives=B}else this._input.peek(1)==="/"&&($=this.__patterns.comment.read(),K=this._create_token(h.COMMENT,$))}return K},_.prototype._read_string=function(N){if(N==="`"||N==="'"||N==='"'){var K=this._input.next();return this.has_char_escapes=!1,N==="`"?K+=this._read_string_recursive("`",!0,"${"):K+=this._read_string_recursive(N),this.has_char_escapes&&this._options.unescape_strings&&(K=P(K)),this._input.peek()===N&&(K+=this._input.next()),K=K.replace(l.allLineBreaks,`
`),this._create_token(h.STRING,K)}return null},_.prototype._allow_regexp_or_xml=function(N){return N.type===h.RESERVED&&n(N.text,["return","case","throw","else","do","typeof","yield"])||N.type===h.END_EXPR&&N.text===")"&&N.opened.previous.type===h.RESERVED&&n(N.opened.previous.text,["if","while","for"])||n(N.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},_.prototype._read_regexp=function(N,K){if(N==="/"&&this._allow_regexp_or_xml(K)){for(var $=this._input.next(),B=!1,R=!1;this._input.hasNext()&&(B||R||this._input.peek()!==N)&&!this._input.testChar(l.newline);)$+=this._input.peek(),B?B=!1:(B=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===N&&($+=this._input.next(),$+=this._input.read(l.identifier)),this._create_token(h.STRING,$)}return null},_.prototype._read_xml=function(N,K){if(this._options.e4x&&N==="<"&&this._allow_regexp_or_xml(K)){var $="",B=this.__patterns.xml.read_match();if(B){for(var R=B[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=R.indexOf("{")===0,Q=0;B;){var ne=!!B[1],le=B[2],_e=!!B[B.length-1]||le.slice(0,8)==="![CDATA[";if(!_e&&(le===R||G&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ne?--Q:++Q),$+=B[0],Q<=0)break;B=this.__patterns.xml.read_match()}return B||($+=this._input.match(/[\s\S]*/g)[0]),$=$.replace(l.allLineBreaks,`
`),this._create_token(h.STRING,$)}}return null};function P(N){for(var K="",$=0,B=new f(N),R=null;B.hasNext();)if(R=B.match(/([\s]|[^\\]|\\\\)+/g),R&&(K+=R[0]),B.peek()==="\\"){if(B.next(),B.peek()==="x")R=B.match(/x([0-9A-Fa-f]{2})/g);else if(B.peek()==="u")R=B.match(/u([0-9A-Fa-f]{4})/g);else{K+="\\",B.hasNext()&&(K+=B.next());continue}if(!R)return N;if($=parseInt(R[1],16),$>126&&$<=255&&R[0].indexOf("x")===0)return N;if($>=0&&$<32){K+="\\"+R[0];continue}else $===34||$===39||$===92?K+="\\"+String.fromCharCode($):K+=String.fromCharCode($)}return K}_.prototype._read_string_recursive=function(N,K,$){var B,R;N==="'"?R=this.__patterns.single_quote:N==='"'?R=this.__patterns.double_quote:N==="`"?R=this.__patterns.template_text:N==="}"&&(R=this.__patterns.template_expression);for(var G=R.read(),Q="";this._input.hasNext();){if(Q=this._input.next(),Q===N||!K&&l.newline.test(Q)){this._input.back();break}else Q==="\\"&&this._input.hasNext()?(B=this._input.peek(),B==="x"||B==="u"?this.has_char_escapes=!0:B==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Q+=this._input.next()):$&&($==="${"&&Q==="$"&&this._input.peek()==="{"&&(Q+=this._input.next()),$===Q&&(N==="`"?Q+=this._read_string_recursive("}",K,"`"):Q+=this._read_string_recursive("`",K,"${"),this._input.hasNext()&&(Q+=this._input.next())));Q+=R.read(),G+=Q}return G},D.exports.Tokenizer=_,D.exports.TOKEN=h,D.exports.positionable_operators=C.slice(),D.exports.line_starters=p.slice()},function(D){var I=RegExp.prototype.hasOwnProperty("sticky");function g(f){this.__input=f||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&f=0&&u=f.length&&this.__input.substring(u-f.length,u).toLowerCase()===f},D.exports.InputScanner=g},function(D,I,g){var f=g(8).InputScanner,u=g(3).Token,d=g(10).TokenStream,s=g(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(a,n){this._input=new f(a),this._options=n||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new d,this._reset();for(var a,n=new u(l.START,""),h=null,O=[],S=new d;n.type!==l.EOF;){for(a=this._get_next_token(n,h);this._is_comment(a);)S.add(a),a=this._get_next_token(n,h);S.isEmpty()||(a.comments_before=S,S=new d),a.parent=h,this._is_opening(a)?(O.push(h),h=a):h&&this._is_closing(a,h)&&(a.opened=h,h.closed=a,h=O.pop(),a.parent=h),a.previous=n,n.next=a,this.__tokens.add(a),n=a}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(a,n){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(l.RAW,h):this._create_token(l.EOF,"")},r.prototype._is_comment=function(a){return!1},r.prototype._is_opening=function(a){return!1},r.prototype._is_closing=function(a,n){return!1},r.prototype._create_token=function(a,n){var h=new u(a,n,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},D.exports.Tokenizer=r,D.exports.TOKEN=l},function(D){function I(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}I.prototype.restart=function(){this.__position=0},I.prototype.isEmpty=function(){return this.__tokens_length===0},I.prototype.hasNext=function(){return this.__position=0&&g/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}d.prototype=new f,d.prototype._create=function(){return new d(this._input,this)},d.prototype._update=function(){this.__set_templated_pattern()},d.prototype.disable=function(s){var l=this._create();return l._disabled[s]=!0,l._update(),l},d.prototype.read_options=function(s){var l=this._create();for(var r in u)l._disabled[r]=s.templating.indexOf(r)===-1;return l._update(),l},d.prototype.exclude=function(s){var l=this._create();return l._excluded[s]=!0,l._update(),l},d.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),s+=l,l=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},d.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},d.prototype._read_template=function(){var s="",l=this._input.peek();if(l==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(s=s||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},D.exports.TemplatablePattern=d}],L={};function H(D){var I=L[D];if(I!==void 0)return I.exports;var g=L[D]={exports:{}};return U[D](g,g.exports,H),g.exports}var F=H(0);M=F})();var z=M;!(q=[],V=function(){return{js_beautify:z}}.apply(Se,q),V!==void 0&&(Fe.exports=V))})()},"6eGT":function(Fe,Se,W){"use strict";function q(V){return null}Se.a=q},"7Cbv":function(Fe,Se,W){"use strict";var q=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),V=new Uint8Array(16);function M(){if(!q)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return q(V)}var z=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function U(u){return typeof u=="string"&&z.test(u)}for(var L=U,H=[],F=0;F<256;++F)H.push((F+256).toString(16).substr(1));function D(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=(H[u[d+0]]+H[u[d+1]]+H[u[d+2]]+H[u[d+3]]+"-"+H[u[d+4]]+H[u[d+5]]+"-"+H[u[d+6]]+H[u[d+7]]+"-"+H[u[d+8]]+H[u[d+9]]+"-"+H[u[d+10]]+H[u[d+11]]+H[u[d+12]]+H[u[d+13]]+H[u[d+14]]+H[u[d+15]]).toLowerCase();if(!L(s))throw TypeError("Stringified UUID is invalid");return s}var I=D;function g(u,d,s){u=u||{};var l=u.random||(u.rng||M)();if(l[6]=l[6]&15|64,l[8]=l[8]&63|128,d){s=s||0;for(var r=0;r<16;++r)d[s+r]=l[r];return d}return I(l)}var f=Se.a=g},"7ahc":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return O});var q=W("k1fw"),V=W("0Owb"),M=W("+L6B"),z=W("2/Rp"),U=W("y8nQ"),L=W("Vl3Y"),H=W("tJVT"),F=W("OaEy"),D=W("2fM7"),I=W("q1tI"),g=W.n(I),f=W("VrN/"),u=W.n(f),d=W("p77/"),s=W.n(d),l=W("c5Ni"),r=W.n(l),a=D.a.Option,n={labelCol:{span:4},wrapperCol:{span:20}},h={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"]};Se.b=function(S){var x=S.callback,A=S.onCancel,C=Object(I.useState)("python"),b=Object(H.a)(C,2),v=b[0],p=b[1];function c(y){p(h[y][1])}function E(y){x(y)}return g.a.createElement(L.a,Object(V.a)({},n,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),g.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},g.a.createElement(D.a,{onChange:c},Object.keys(h).map(function(y){return g.a.createElement(a,{key:y,value:y},h[y][0])}))),g.a.createElement(L.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},g.a.createElement(O,{mode:v})),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(z.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(z.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function O(S){var x=S.value,A=S.onChange,C=S.mode,b=S.options,v=b===void 0?{}:b,p=Object(I.useRef)(),c=Object(I.useState)(),E=Object(H.a)(c,2),y=E[0],_=E[1];return Object(I.useEffect)(function(){if(y){function P(N){var K=N.getValue();A&&A(K)}return y.on("change",P),function(){y.off("change",P)}}},[y,A]),Object(I.useEffect)(function(){y&&y.setOption("mode",C)},[y,C]),Object(I.useEffect)(function(){y&&((x!==y.getValue()||x==="")&&setTimeout(function(){y.setValue(x||" ")},300))},[y,x]),Object(I.useEffect)(function(){if(p.current&&!y){var P=u.a.fromTextArea(p.current,Object(q.a)({mode:C,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},v));_(P)}},[p.current,y]),g.a.createElement("div",{className:"my-codemirror-container"},g.a.createElement("textarea",{ref:p}))}},"7ixt":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return M});var q={adjustX:1,adjustY:1},V=[0,0],M={left:{points:["cr","cl"],overflow:q,offset:[-4,0],targetOffset:V},right:{points:["cl","cr"],overflow:q,offset:[4,0],targetOffset:V},top:{points:["bc","tc"],overflow:q,offset:[0,-4],targetOffset:V},bottom:{points:["tc","bc"],overflow:q,offset:[0,4],targetOffset:V},topLeft:{points:["bl","tl"],overflow:q,offset:[0,-4],targetOffset:V},leftTop:{points:["tr","tl"],overflow:q,offset:[-4,0],targetOffset:V},topRight:{points:["br","tr"],overflow:q,offset:[0,-4],targetOffset:V},rightTop:{points:["tl","tr"],overflow:q,offset:[4,0],targetOffset:V},bottomRight:{points:["tr","br"],overflow:q,offset:[0,4],targetOffset:V},rightBottom:{points:["bl","br"],overflow:q,offset:[4,0],targetOffset:V},bottomLeft:{points:["tl","bl"],overflow:q,offset:[0,4],targetOffset:V},leftBottom:{points:["br","bl"],overflow:q,offset:[-4,0],targetOffset:V}},z=M},"815F":function(Fe,Se,W){"use strict";W.d(Se,"e",function(){return H}),W.d(Se,"c",function(){return D}),W.d(Se,"d",function(){return I}),W.d(Se,"a",function(){return f}),W.d(Se,"f",function(){return u}),W.d(Se,"b",function(){return d});var q=W("KQm4"),V=W("VTBJ"),M=W("Ff2n"),z=W("Zm9Q"),U=W("Kwbf"),L=W("OZM5");function H(s,l){return s!=null?s:l}function F(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function r(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(a||[]).forEach(function(h){var O=h.key,S=h.children;Object(U.a)(O!=null,"Tree node must have a certain key: [".concat(n).concat(O,"]"));var x=String(O);Object(U.a)(!l.has(x)||O===null||O===void 0,"Same 'key' exist in the Tree: ".concat(x)),l.set(x,!0),r(S,"".concat(n).concat(x," > "))})}r(s)}function D(s){function l(r){var a=Object(z.a)(r);return a.map(function(n){if(!Object(L.i)(n))return Object(U.a)(!n,"Tree/TreeNode can only accept TreeNode as children."),null;var h=n.key,O=n.props,S=O.children,x=Object(M.a)(O,["children"]),A=Object(V.a)({key:h},x),C=l(S);return C.length&&(A.children=C),A}).filter(function(n){return n})}return l(s)}function I(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=new Set(l===!0?[]:l),a=[];function n(h){var O=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return h.map(function(S,x){var A=Object(L.h)(O?O.pos:"0",x),C=H(S.key,A),b=Object(V.a)(Object(V.a)({},S),{},{parent:O,pos:A,children:null,data:S,isStart:[].concat(Object(q.a)(O?O.isStart:[]),[x===0]),isEnd:[].concat(Object(q.a)(O?O.isEnd:[]),[x===h.length-1])});return a.push(b),l===!0||r.has(C)?b.children=n(S.children||[],b):b.children=[],b})}return n(s),a}function g(s,l,r){var a;r?typeof r=="string"?a=function(O){return O[r]}:typeof r=="function"&&(a=function(O){return r(O)}):a=function(O,S){return H(O.key,S)};function n(h,O,S){var x=h?h.children:s,A=h?Object(L.h)(S.pos,O):"0";if(h){var C=a(h,A),b={node:h,index:O,pos:A,key:C,parentPos:S.node?S.pos:null,level:S.level+1};l(b)}x&&x.forEach(function(v,p){n(v,p,{node:h,pos:A,level:S?S.level+1:-1})})}n(null)}function f(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=l.initWrapper,a=l.processEntity,n=l.onProcessFinished,h=arguments.length>2?arguments[2]:void 0,O={},S={},x={posEntities:O,keyEntities:S};return r&&(x=r(x)||x),g(s,function(A){var C=A.node,b=A.index,v=A.pos,p=A.key,c=A.parentPos,E=A.level,y={node:C,index:b,key:p,pos:v,level:E},_=H(p,v);O[v]=y,S[_]=y,y.parent=O[c],y.parent&&(y.parent.children=y.parent.children||[],y.parent.children.push(y)),a&&a(y,x)},h),n&&n(x),x}function u(s,l){var r=l.expandedKeys,a=l.selectedKeys,n=l.loadedKeys,h=l.loadingKeys,O=l.checkedKeys,S=l.halfCheckedKeys,x=l.dragOverNodeKey,A=l.dropPosition,C=l.keyEntities,b=C[s],v={eventKey:s,expanded:r.indexOf(s)!==-1,selected:a.indexOf(s)!==-1,loaded:n.indexOf(s)!==-1,loading:h.indexOf(s)!==-1,checked:O.indexOf(s)!==-1,halfChecked:S.indexOf(s)!==-1,pos:String(b?b.pos:""),dragOver:x===s&&A===0,dragOverGapTop:x===s&&A===-1,dragOverGapBottom:x===s&&A===1};return v}function d(s){var l=s.data,r=s.expanded,a=s.selected,n=s.checked,h=s.loaded,O=s.loading,S=s.halfChecked,x=s.dragOver,A=s.dragOverGapTop,C=s.dragOverGapBottom,b=s.pos,v=s.active,p=Object(V.a)(Object(V.a)({},l),{},{expanded:r,selected:a,checked:n,loaded:h,loading:O,halfChecked:S,dragOver:x,dragOverGapTop:A,dragOverGapBottom:C,pos:b,active:v});return"props"in p||Object.defineProperty(p,"props",{get:function(){return Object(U.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),s}}),p}},"8EBN":function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){"use strict";q.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var V=0;V-1&&z.substring(H+1,z.length);if(F)return q.findModeByExtension(F)},q.findModeByName=function(z){z=z.toLowerCase();for(var U=0;U=j.length?ee.slice(j.length):ee}).join(`
`)}var r=[],a=[""],n=new d.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function O(){r.length=0,a=[""]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function x(J,w,T,j){if(w>=J.length||J[w].level<=T)return w;var ee=J[w];j.push("- "+ee.text+""),w++;var X=[];return w=x(J,w,ee.level,X),X.length>0&&(j.push("
"),X.forEach(function(ye){j.push(ye)}),j.push("
")),j.push(" "),w=x(J,w,T,j),w}function A(){return x(r,0,0,a),a.push("
"),a.join("")}var C={heading:function(w){var T=h.exec(w);if(T)return{type:"heading",raw:T[0],depth:T[1].length,text:T[2]}},fences:function(w){var T=this.rules.block.fences.exec(w);if(T){var j=T[0],ee=l(j,T[3]||""),X=T[2]?T[2].trim():T[2];if(["latex","katex","math"].indexOf(X)>=0){var ye=p(),Ve=ee;ee=ye,c[ye]={type:"block",expression:Ve}}return{type:"code",raw:j,lang:X,text:ee}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,v=0,p=function(){return"__special_katext_id_".concat(v++,"__")},c={};function E(){return c}function y(){v=0,c={}}function _(J){return J=J.replace(b,function(w,T){var j=p();return c[j]={type:"inline",expression:T},j}),J}var P=n.listitem;n.listitem=function(J){return P(_(J))};var N=n.paragraph;n.paragraph=function(J){return N(_(J))};var K=n.tablecell;n.tablecell=function(J,w){return K(_(J),w)},n.code=function(J,w,T){var j=(w||"").match(/\S*/)[0];return j?["latex","katex","math"].indexOf(j)>=0?"".concat(J,"
"):'
').concat(T?J:Object(s.escape)(J,!0),`
`):''+(T?J:Object(s.escape)(J,!0))+"
"},n.heading=function(J,w,T){var j=this.options.headerPrefix+T.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return r.push({anchor:j,level:w,text:J}),"'+J+""},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:C,renderer:n});var $=d.a,B=W("SJMd"),R=W("ulZh"),G=W.n(R),Q=W("m3rI"),ne=W("Oy/b"),le=W("p5ED"),_e=W("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var pe=function(J,w){return(pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,j){T.__proto__=j}||function(T,j){for(var ee in j)Object.prototype.hasOwnProperty.call(j,ee)&&(T[ee]=j[ee])})(J,w)};function Ee(J,w){function T(){this.constructor=J}pe(J,w),J.prototype=w===null?Object.create(w):(T.prototype=w.prototype,new T)}function Oe(J,w,T,j){return new(T||(T=Promise))(function(ee,X){function ye(ht){try{ot(j.next(ht))}catch(Ue){X(Ue)}}function Ve(ht){try{ot(j.throw(ht))}catch(Ue){X(Ue)}}function ot(ht){var Ue;ht.done?ee(ht.value):(Ue=ht.value,Ue instanceof T?Ue:new T(function(mt){mt(Ue)})).then(ye,Ve)}ot((j=j.apply(J,w||[])).next())})}function we(J,w){var T,j,ee,X,ye={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return X={next:Ve(0),throw:Ve(1),return:Ve(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function Ve(ot){return function(ht){return function(Ue){if(T)throw new TypeError("Generator is already executing.");for(;ye;)try{if(T=1,j&&(ee=2&Ue[0]?j.return:Ue[0]?j.throw||((ee=j.return)&&ee.call(j),0):j.next)&&!(ee=ee.call(j,Ue[1])).done)return ee;switch(j=0,ee&&(Ue=[2&Ue[0],ee.value]),Ue[0]){case 0:case 1:ee=Ue;break;case 4:return ye.label++,{value:Ue[1],done:!1};case 5:ye.label++,j=Ue[1],Ue=[0];continue;case 7:Ue=ye.ops.pop(),ye.trys.pop();continue;default:if(!(ee=ye.trys,(ee=ee.length>0&&ee[ee.length-1])||Ue[0]!==6&&Ue[0]!==2)){ye=0;continue}if(Ue[0]===3&&(!ee||Ue[1]>ee[0]&&Ue[1]',"select"),this.addActionButton(j,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(j,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(j,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(j,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(j,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(j,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(j,'',"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(X){var ye=document.createElement("div");ye.className=""+T.toolbarButtonStyleClass.name,ye.setAttribute("data-type-name",X.typeName),ye.innerHTML=X.icon,ye.addEventListener("click",function(){T.markerToolbarButtonClicked(ye,X)}),T.buttons.push(ye),T.markerButtons.push(ye)}),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 ee=document.createElement("div");ee.className=this.toolbarBlockStyleClass.name,ee.style.whiteSpace="nowrap",ee.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ee),this.addActionButton(ee,'',"render"),this.addActionButton(ee,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},J.prototype.addButtonClickListener=function(w){this.buttonClickListeners.push(w)},J.prototype.removeButtonClickListener=function(w){this.buttonClickListeners.indexOf(w)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(w),1)},J.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},J.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var w=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var T=0;T0&&this.buttonClickListeners.forEach(function(j){return j("marker",T)}),this.markerButtonOverflowBlock.style.display="none"},J.prototype.actionToolbarButtonClicked=function(w,T){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(j){return j("action",T)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},J.prototype.setActiveButton=function(w){this.resetButtonStyles(),w.className=w.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),w.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},J.prototype.setActiveMarkerButton=function(w){var T=this.markerButtons.find(function(j){return j.getAttribute("data-type-name")===w});T&&this.setActiveButton(T)},J.prototype.setCurrentMarker=function(w){var T=this;this.currentMarker=w,this.buttons.filter(function(j){return/delete|notes/.test(j.getAttribute("data-action"))}).forEach(function(j){T.currentMarker===void 0?(j.style.fillOpacity="0.4",j.style.pointerEvents="none"):(j.style.fillOpacity="1",j.style.pointerEvents="all")})},J}(),Qe=function(){function J(w,T,j,ee){this.panels=[],this.panelButtons=[],this.markerjsContainer=w,this.displayMode=T,this.uiStyleSettings=j,this.styles=ee,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return J.prototype.addStyles=function(){var w;this.toolboxStyleClass=this.styles.addClass(new He("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new He("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var T=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new He("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new He("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new He("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new He("toolbox-panel-row_colors",`
background-color: `+((w=this.uiStyleSettings.toolboxBackgroundColor)!==null&&w!==void 0?w:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new He("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*T)+`px;
padding: `+T+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new He("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new He("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new it("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new it("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},J.prototype.show=function(w){var T;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=w,this.uiContainer.className=this.toolboxStyleClass.name+" "+((T=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&T!==void 0?T:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},J.prototype.setPanelButtons=function(w){var T,j,ee=this;this.panels=w,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((T=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&T!==void 0?T:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((j=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&j!==void 0?j:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(X){var ye;X.uiStyleSettings=ee.uiStyleSettings;var Ve=document.createElement("div");Ve.className=ee.toolboxButtonStyleClass.name+" "+((ye=ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:ee.toolboxButtonStyleColorsClass.name),Ve.innerHTML=X.icon,Ve.title=X.title,Ve.addEventListener("click",function(){ee.panelButtonClick(X)}),ee.panelButtons.push(Ve),ee.buttonRow.appendChild(Ve)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},J.prototype.panelButtonClick=function(w){var T=this,j=-1;if(w!==this.activePanel){j=this.panels.indexOf(w),this.panelRow.innerHTML="";var ee=w.getUi();ee.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ee),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=w}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){T.displayMode==="inline"?T.panelRow.style.display="none":T.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(X,ye){var Ve,ot;X.className=T.toolboxButtonStyleClass.name+" "+(ye===j?""+((Ve=T.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ve!==void 0?Ve:T.toolboxActiveButtonStyleColorsClass.name):""+((ot=T.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ot!==void 0?ot:T.toolboxButtonStyleColorsClass.name))})},J}(),gt=function(J,w){this.title=J,this.icon=w},et=function(J){function w(T,j,ee,X){var ye=J.call(this,T,X||'')||this;return ye.colors=[],ye.addTransparent=!1,ye.colorBoxes=[],ye.colors=j,ye.currentColor=ee,ye.setCurrentColor=ye.setCurrentColor.bind(ye),ye.getColorBox=ye.getColorBox.bind(ye),ye}return Ee(w,J),w.prototype.getUi=function(){var T=this,j=document.createElement("div");return j.style.overflow="hidden",j.style.whiteSpace="nowrap",this.colors.forEach(function(ee){var X=T.getColorBox(ee);j.appendChild(X),T.colorBoxes.push(X)}),j},w.prototype.getColorBox=function(T){var j=this,ee=this.uiStyleSettings.toolbarHeight/4,X=this.uiStyleSettings.toolbarHeight-ee,ye=document.createElement("div");ye.style.display="inline-block",ye.style.boxSizing="content-box",ye.style.width=X-2+"px",ye.style.height=X-2+"px",ye.style.padding="1px",ye.style.marginRight="2px",ye.style.marginBottom="2px",ye.style.borderWidth="2px",ye.style.borderStyle="solid",ye.style.borderRadius=(X+2)/2+"px",ye.style.borderColor=T===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ye.addEventListener("click",function(){j.setCurrentColor(T,ye)});var Ve=document.createElement("div");return Ve.style.display="inline-block",Ve.style.width=X-2+"px",Ve.style.height=X-2+"px",Ve.style.backgroundColor=T,Ve.style.borderRadius=X/2+"px",T==="transparent"&&(Ve.style.fill=this.uiStyleSettings.toolboxAccentColor,Ve.innerHTML=``),ye.appendChild(Ve),ye},w.prototype.setCurrentColor=function(T,j){var ee=this;this.currentColor=T,this.colorBoxes.forEach(function(X){X.style.borderColor=X===j?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(T)},w}(gt),tt=function(){function J(w,T,j){this._state="new",this._isSelected=!1,this._container=w,this._overlayContainer=T,this.globalSettings=j,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(J.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),J.prototype.ownsTarget=function(w){return!1},Object.defineProperty(J.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),J.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},J.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},J.prototype.pointerDown=function(w,T){},J.prototype.dblClick=function(w,T){},J.prototype.manipulate=function(w){},J.prototype.pointerUp=function(w){this.stateChanged()},J.prototype.dispose=function(){},J.prototype.addMarkerVisualToContainer=function(w){this.container.childNodes.length>0?this.container.insertBefore(w,this.container.childNodes[0]):this.container.appendChild(w)},J.prototype.getState=function(){return{typeName:J.typeName,state:this.state,notes:this.notes}},J.prototype.restoreState=function(w){this._state=w.state,this.notes=w.notes},J.prototype.scale=function(w,T){},J.prototype.colorChanged=function(w){this.onColorChanged&&this.onColorChanged(w),this.stateChanged()},J.prototype.fillColorChanged=function(w){this.onFillColorChanged&&this.onFillColorChanged(w),this.stateChanged()},J.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var w=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),w.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(w)&&this.onStateChanged(this)}},J.typeName="MarkerBase",J}(),Je=function(){function J(){this.findGripByVisual=this.findGripByVisual.bind(this)}return J.prototype.findGripByVisual=function(w){return this.topLeft.ownsTarget(w)?this.topLeft:this.topCenter.ownsTarget(w)?this.topCenter:this.topRight.ownsTarget(w)?this.topRight:this.centerLeft.ownsTarget(w)?this.centerLeft:this.centerRight.ownsTarget(w)?this.centerRight:this.bottomLeft.ownsTarget(w)?this.bottomLeft:this.bottomCenter.ownsTarget(w)?this.bottomCenter:this.bottomRight.ownsTarget(w)?this.bottomRight:void 0},J}(),vt=function(){function J(){this.GRIP_SIZE=10,this.visual=oe.createGroup(),this.visual.appendChild(oe.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(oe.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(w){return w===this.visual||w===this.visual.childNodes[0]||w===this.visual.childNodes[1]},J}(),wt=function(){function J(){}return J.toITransformMatrix=function(w){return{a:w.a,b:w.b,c:w.c,d:w.d,e:w.e,f:w.f}},J.toSVGMatrix=function(w,T){return w.a=T.a,w.b=T.b,w.c=T.c,w.d=T.d,w.e=T.e,w.f=T.f,w},J}(),Et=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.left=0,X.top=0,X.width=0,X.height=0,X.defaultSize={x:50,y:20},X.offsetX=0,X.offsetY=0,X.rotationAngle=0,X.CB_DISTANCE=10,X._suppressMarkerCreateEvent=!1,X.container.transform.baseVal.appendItem(oe.createTransform()),X.setupControlBox(),X}return Ee(w,J),Object.defineProperty(w.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"visual",{get:function(){return this._visual},set:function(T){this._visual=T;var j=oe.createTransform();this._visual.transform.baseVal.appendItem(j)},enumerable:!1,configurable:!0}),w.prototype.ownsTarget=function(T){return!!J.prototype.ownsTarget.call(this,T)||!!(this.controlGrips.findGripByVisual(T)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(T))},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.state==="new"&&(this.left=T.x,this.top=T.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ee=this.unrotatePoint(T);if(this.manipulationStartX=ee.x,this.manipulationStartY=ee.y,this.offsetX=ee.x-this.left,this.offsetY=ee.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(j),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(j)){this.activeGrip=this.rotatorGrip;var X=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=X.x-this.width/2,this.top=X.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ye=this.container.transform.baseVal.getItem(0);ye.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ye,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},w.prototype.pointerUp=function(T){var j=this.state;J.prototype.pointerUp.call(this,T),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(T),this._state="select",j==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},w.prototype.moveVisual=function(T){this.visual.style.transform="translate("+T.x+"px, "+T.y+"px)"},w.prototype.manipulate=function(T){var j=this.unrotatePoint(T);this.state==="creating"?this.resize(T):this.state==="move"?(this.left=this.manipulationStartLeft+(j.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(j.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(j):this.state==="rotate"&&this.rotate(T)},w.prototype.resize=function(T){var j=this.manipulationStartLeft,ee=this.manipulationStartWidth,X=this.manipulationStartTop,ye=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:j=this.manipulationStartLeft+T.x-this.manipulationStartX,ee=this.manipulationStartWidth+this.manipulationStartLeft-j;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ee=this.manipulationStartWidth+T.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:X=this.manipulationStartTop+T.y-this.manipulationStartY,ye=this.manipulationStartHeight+this.manipulationStartTop-X;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ye=this.manipulationStartHeight+T.y-this.manipulationStartY}ee>=0?(this.left=j,this.width=ee):(this.left=j+ee,this.width=-ee),ye>=0?(this.top=X,this.height=ye):(this.top=X+ye,this.height=-ye),this.setSize()},w.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},w.prototype.rotate=function(T){if(Math.abs(T.x-this.centerX)>.1){var j=Math.sign(T.x-this.centerX);this.rotationAngle=180*Math.atan((T.y-this.centerY)/(T.x-this.centerX))/Math.PI+90*j,this.applyRotation()}},w.prototype.applyRotation=function(){var T=this.container.transform.baseVal.getItem(0);T.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(T,0)},w.prototype.rotatePoint=function(T){if(this.rotationAngle===0)return T;var j=this.container.getCTM(),ee=oe.createPoint(T.x,T.y);return{x:(ee=ee.matrixTransform(j)).x,y:ee.y}},w.prototype.unrotatePoint=function(T){if(this.rotationAngle===0)return T;var j=this.container.getCTM();j=j.inverse();var ee=oe.createPoint(T.x,T.y);return{x:(ee=ee.matrixTransform(j)).x,y:ee.y}},w.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},w.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},w.prototype.setupControlBox=function(){this.controlBox=oe.createGroup();var T=oe.createTransform();T.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(T),this.container.appendChild(this.controlBox),this.controlRect=oe.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=oe.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 Je,this.addControlGrips(),this.controlBox.style.display="none"},w.prototype.adjustControlBox=function(){var T=this.controlBox.transform.baseVal.getItem(0);T.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(T,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()},w.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()},w.prototype.createGrip=function(){var T=new vt;return T.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(T.visual),T},w.prototype.positionGrips=function(){var T=this.controlGrips.topLeft.GRIP_SIZE,j=-T/2,ee=j,X=(this.width+this.CB_DISTANCE)/2-T/2,ye=(this.height+this.CB_DISTANCE)/2-T/2,Ve=this.height+this.CB_DISTANCE-T/2,ot=this.width+this.CB_DISTANCE-T/2;this.positionGrip(this.controlGrips.topLeft.visual,j,ee),this.positionGrip(this.controlGrips.topCenter.visual,X,ee),this.positionGrip(this.controlGrips.topRight.visual,ot,ee),this.positionGrip(this.controlGrips.centerLeft.visual,j,ye),this.positionGrip(this.controlGrips.centerRight.visual,ot,ye),this.positionGrip(this.controlGrips.bottomLeft.visual,j,Ve),this.positionGrip(this.controlGrips.bottomCenter.visual,X,Ve),this.positionGrip(this.controlGrips.bottomRight.visual,ot,Ve),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,X,ee-3*this.CB_DISTANCE)},w.prototype.positionGrip=function(T,j,ee){var X=T.transform.baseVal.getItem(0);X.setTranslate(j,ee),T.transform.baseVal.replaceItem(X,0)},w.prototype.hideControlBox=function(){this.controlBox.style.display="none"},w.prototype.showControlBox=function(){this.controlBox.style.display=""},w.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:wt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:wt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},J.prototype.getState.call(this))},w.prototype.restoreState=function(T){J.prototype.restoreState.call(this,T);var j=T;this.left=j.left,this.top=j.top,this.width=j.width,this.height=j.height,this.rotationAngle=j.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(wt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,j.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(wt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,j.containerTransformMatrix))},w.prototype.scale=function(T,j){J.prototype.scale.call(this,T,j);var ee=this.rotatePoint({x:this.left,y:this.top}),X=this.unrotatePoint({x:ee.x*T,y:ee.y*j});this.left=X.x,this.top=X.y,this.width=this.width*T,this.height=this.height*j,this.adjustControlBox()},w}(tt),xt=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.createVisual=X.createVisual.bind(X),X}return Ee(w,J),w.prototype.ownsTarget=function(T){return!(!J.prototype.ownsTarget.call(this,T)&&T!==this.visual)},w.prototype.createVisual=function(){this.visual=oe.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)},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},w.prototype.manipulate=function(T){J.prototype.manipulate.call(this,T)},w.prototype.resize=function(T){J.prototype.resize.call(this,T),this.setSize()},w.prototype.setSize=function(){J.prototype.setSize.call(this),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},w.prototype.pointerUp=function(T){J.prototype.pointerUp.call(this,T),this.setSize()},w.prototype.setStrokeColor=function(T){this.strokeColor=T,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(T),this.stateChanged()},w.prototype.setFillColor=function(T){this.fillColor=T,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},w.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},w.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},w.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this))},w.prototype.restoreState=function(T){var j=T;this.fillColor=j.fillColor,this.strokeColor=j.strokeColor,this.strokeWidth=j.strokeWidth,this.strokeDasharray=j.strokeDasharray,this.opacity=j.opacity,this.createVisual(),J.prototype.restoreState.call(this,T),this.setSize()},w.prototype.scale=function(T,j){J.prototype.scale.call(this,T,j),this.setSize()},w.title="Rectangle marker",w}(Et),kt=function(J){function w(T,j,ee,X){var ye=J.call(this,T,X||'')||this;return ye.widths=[],ye.widthBoxes=[],ye.widths=j,ye.currentWidth=ee,ye.setCurrentWidth=ye.setCurrentWidth.bind(ye),ye}return Ee(w,J),w.prototype.getUi=function(){var T=this,j=document.createElement("div");return j.style.display="flex",j.style.overflow="hidden",j.style.flexGrow="2",this.widths.forEach(function(ee){var X=document.createElement("div");X.style.display="flex",X.style.flexGrow="2",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=ee===T.currentWidth?T.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){T.setCurrentWidth(ee,X)}),j.appendChild(X);var ye=document.createElement("div");ye.innerText=ee.toString(),ye.style.marginRight="5px",X.appendChild(ye);var Ve=document.createElement("div");Ve.style.minHeight="20px",Ve.style.flexGrow="2",Ve.style.display="flex",Ve.style.alignItems="center";var ot=document.createElement("hr");ot.style.minWidth="20px",ot.style.border="0px",ot.style.borderTop=ee+"px solid "+T.uiStyleSettings.toolboxColor,ot.style.flexGrow="2",Ve.appendChild(ot),X.appendChild(Ve),T.widthBoxes.push(X)}),j},w.prototype.setCurrentWidth=function(T,j){var ee=this;this.currentWidth=T,this.widthBoxes.forEach(function(X){X.style.borderColor=X===j?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},w}(gt),Ot=function(J){function w(T,j,ee,X){var ye=J.call(this,T,X||'')||this;return ye.styles=[],ye.styleBoxes=[],ye.styles=j,ye.currentStyle=ee,ye.setCurrentStyle=ye.setCurrentStyle.bind(ye),ye}return Ee(w,J),w.prototype.getUi=function(){var T=this,j=document.createElement("div");return j.style.display="flex",j.style.overflow="hidden",j.style.flexGrow="2",this.styles.forEach(function(ee){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/T.styles.length-5+"%",X.style.borderColor=ee===T.currentStyle?T.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){T.setCurrentStyle(ee,X)}),j.appendChild(X);var ye=document.createElement("div");ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.overflow="hidden";var Ve=``;ye.innerHTML=Ve,X.appendChild(ye),T.styleBoxes.push(X)}),j},w.prototype.setCurrentStyle=function(T,j){var ee=this;this.currentStyle=T,this.styleBoxes.forEach(function(X){X.style.borderColor=X===j?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},w}(gt),Ae=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.strokeColor=ee.defaultColor,X.strokeWidth=ee.defaultStrokeWidth,X.strokeDasharray=ee.defaultStrokeDasharray,X.strokePanel=new et("Line color",ee.defaultColorSet,ee.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new kt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new Ot("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Ee(w,J),Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=J.prototype.getState.call(this);return T.typeName=w.typeName,T},w.typeName="FrameMarker",w.title="Frame marker",w.icon='',w}(xt),Ce=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},Ge=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.x1=0,X.y1=0,X.x2=0,X.y2=0,X.defaultLength=50,X.manipulationStartX=0,X.manipulationStartY=0,X.manipulationStartX1=0,X.manipulationStartY1=0,X.manipulationStartX2=0,X.manipulationStartY2=0,X.setupControlBox(),X}return Ee(w,J),w.prototype.ownsTarget=function(T){return!!J.prototype.ownsTarget.call(this,T)||!(!this.grip1.ownsTarget(T)&&!this.grip2.ownsTarget(T))},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.manipulationStartX=T.x,this.manipulationStartY=T.y,this.state==="new"&&(this.x1=T.x,this.y1=T.y,this.x2=T.x,this.y2=T.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(j)?this.activeGrip=this.grip1:this.grip2.ownsTarget(j)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},w.prototype.pointerUp=function(T){var j=this.state;J.prototype.pointerUp.call(this,T),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(T),this._state="select",j==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},w.prototype.adjustVisual=function(){},w.prototype.manipulate=function(T){this.state==="creating"?this.resize(T):this.state==="move"?(this.x1=this.manipulationStartX1+T.x-this.manipulationStartX,this.y1=this.manipulationStartY1+T.y-this.manipulationStartY,this.x2=this.manipulationStartX2+T.x-this.manipulationStartX,this.y2=this.manipulationStartY2+T.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(T)},w.prototype.resize=function(T){switch(this.activeGrip){case this.grip1:this.x1=T.x,this.y1=T.y;break;case this.grip2:case void 0:this.x2=T.x,this.y2=T.y}this.adjustVisual(),this.adjustControlBox()},w.prototype.select=function(){J.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},w.prototype.deselect=function(){J.prototype.deselect.call(this),this.controlBox.style.display="none"},w.prototype.setupControlBox=function(){this.controlBox=oe.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},w.prototype.adjustControlBox=function(){this.positionGrips()},w.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},w.prototype.createGrip=function(){var T=new vt;return T.visual.transform.baseVal.appendItem(oe.createTransform()),this.controlBox.appendChild(T.visual),T},w.prototype.positionGrips=function(){var T=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-T/2,this.y1-T/2),this.positionGrip(this.grip2.visual,this.x2-T/2,this.y2-T/2)},w.prototype.positionGrip=function(T,j,ee){var X=T.transform.baseVal.getItem(0);X.setTranslate(j,ee),T.transform.baseVal.replaceItem(X,0)},w.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},J.prototype.getState.call(this))},w.prototype.restoreState=function(T){J.prototype.restoreState.call(this,T);var j=T;this.x1=j.x1,this.y1=j.y1,this.x2=j.x2,this.y2=j.y2},w.prototype.scale=function(T,j){J.prototype.scale.call(this,T,j),this.x1=this.x1*T,this.y1=this.y1*j,this.x2=this.x2*T,this.y2=this.y2*j,this.adjustVisual(),this.adjustControlBox()},w}(tt),ze=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.strokeColor=ee.defaultColor,X.strokeWidth=ee.defaultStrokeWidth,X.strokeDasharray=ee.defaultStrokeDasharray,X.strokePanel=new et("Line color",ee.defaultColorSet,ee.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new kt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new Ot("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Ee(w,J),w.prototype.ownsTarget=function(T){return!(!J.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.selectorLine&&T!==this.visibleLine)},w.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorLine=oe.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=oe.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)},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},w.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()),oe.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},w.prototype.setStrokeColor=function(T){this.strokeColor=T,this.adjustVisual(),this.colorChanged(T)},w.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.adjustVisual()},w.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.adjustVisual(),this.stateChanged()},Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},J.prototype.getState.call(this));return T.typeName=w.typeName,T},w.prototype.restoreState=function(T){J.prototype.restoreState.call(this,T);var j=T;this.strokeColor=j.strokeColor,this.strokeWidth=j.strokeWidth,this.strokeDasharray=j.strokeDasharray,this.createVisual(),this.adjustVisual()},w.typeName="LineMarker",w.title="Line marker",w.icon='',w}(Ge),Re=function(J){function w(T,j,ee,X){var ye=J.call(this,T,X||'')||this;return ye.fonts=[],ye.fontBoxes=[],ye.fonts=j,ye.currentFont=ee,ye.setCurrentFont=ye.setCurrentFont.bind(ye),ye}return Ee(w,J),w.prototype.getUi=function(){var T=this,j=document.createElement("div");return j.style.overflow="hidden",j.style.flexGrow="2",this.fonts.forEach(function(ee){var X=document.createElement("div");X.style.display="inline-block",X.style.alignItems="center",X.style.justifyContent="space-between",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.overflow="hidden",X.style.maxWidth=100/T.fonts.length-5+"%",X.style.borderColor=ee===T.currentFont?T.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){T.setCurrentFont(ee,X)}),j.appendChild(X);var ye=document.createElement("div");ye.style.display="flex",ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.fontFamily=ee,ye.style.overflow="hidden";var Ve=document.createElement("div");Ve.style.whiteSpace="nowrap",Ve.style.overflow="hidden",Ve.style.textOverflow="ellipsis",Ve.innerHTML="The quick brown fox jumps over the lazy dog",ye.appendChild(Ve),X.appendChild(ye),T.fontBoxes.push(X)}),j},w.prototype.setCurrentFont=function(T,j){var ee=this;this.currentFont=T,this.fontBoxes.forEach(function(X){X.style.borderColor=X===j?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},w}(gt),je=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.color="transparent",X.padding=5,X.DEFAULT_TEXT="your text here",X.text=X.DEFAULT_TEXT,X.isMoved=!1,X.color=ee.defaultColor,X.fontFamily=ee.defaultFontFamily,X.defaultSize={x:100,y:30},X.setColor=X.setColor.bind(X),X.setFont=X.setFont.bind(X),X.renderText=X.renderText.bind(X),X.sizeText=X.sizeText.bind(X),X.textEditDivClicked=X.textEditDivClicked.bind(X),X.showTextEditor=X.showTextEditor.bind(X),X.setSize=X.setSize.bind(X),X.positionTextEditor=X.positionTextEditor.bind(X),X.colorPanel=new et("Color",ee.defaultColorSet,ee.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.fontFamilyPanel=new Re("Font",ee.defaultFontFamilies,ee.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X}return Ee(w,J),w.prototype.ownsTarget=function(T){if(J.prototype.ownsTarget.call(this,T)||T===this.visual||T===this.textElement||T===this.bgRectangle)return!0;var j=!1;return this.textElement.childNodes.forEach(function(ee){ee===T&&(j=!0)}),j},w.prototype.createVisual=function(){this.visual=oe.createGroup(),this.bgRectangle=oe.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=oe.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.textElement.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.isMoved=!1,this.pointerDownPoint=T,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},w.prototype.renderText=function(){var T=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(j){T.textElement.appendChild(oe.createTSpan(j.trim()===""?" ":j.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},w.prototype.getTextScale=function(){var T=this.textElement.getBBox(),j=1;if(T.width>0&&T.height>0){var ee=(1*this.width-this.width*this.padding*2/100)/T.width,X=(1*this.height-this.height*this.padding*2/100)/T.height;j=Math.min(ee,X)}return j},w.prototype.getTextPosition=function(T){var j=this.textElement.getBBox(),ee=0,X=0;return j.width>0&&j.height>0&&(ee=(this.width-j.width*T)/2,X=this.height/2-j.height*T/2),{x:ee,y:X}},w.prototype.sizeText=function(){var T=this.textElement.getBBox(),j=this.getTextScale(),ee=this.getTextPosition(j);ee.y-=T.y*j,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ee.x+"px, "+ee.y+"px) scale("+j+", "+j+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ee.x,ee.y),this.textElement.transform.baseVal.getItem(1).setScale(j,j))},w.prototype.manipulate=function(T){J.prototype.manipulate.call(this,T),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(T.x-this.pointerDownPoint.x)>5||Math.abs(T.y-this.pointerDownPoint.y)>5)},w.prototype.resize=function(T){J.prototype.resize.call(this,T),this.isMoved=!0,this.setSize(),this.sizeText()},w.prototype.setSize=function(){J.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},w.prototype.pointerUp=function(T){var j=this.state;j==="creating"&&(this._suppressMarkerCreateEvent=!0),J.prototype.pointerUp.call(this,T),this.setSize(),(j==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},w.prototype.showTextEditor=function(){var T=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(j){j.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var j=Number.parseFloat(T.textEditor.style.fontSize);T.textEditor.clientWidth>=Number.parseInt(T.textEditor.style.maxWidth)&&j>.9;)j-=.1,T.textEditor.style.fontSize=Math.max(j,.9)+"em"}),this.textEditor.addEventListener("keyup",function(j){j.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(j){if(j.clipboardData){var ee=j.clipboardData.getData("text"),X=window.getSelection();if(!X.rangeCount)return!1;X.deleteFromDocument(),X.getRangeAt(0).insertNode(document.createTextNode(ee)),j.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){T.textEditDivClicked(T.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},w.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var T=this.getTextScale(),j=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ee=this.textElement.getBBox(),X={x:ee.width*T,y:ee.height*T};j.x-=X.x/2,j.y-=X.y/2,this.textEditor.style.top=j.y+"px",this.textEditor.style.left=j.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-j.x+"px",this.textEditor.style.fontSize=Math.max(16*T,12)+"px",this.textElement.style.display="none"}},w.prototype.textEditDivClicked=function(T){this.text=T.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},w.prototype.select=function(){J.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},w.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),J.prototype.deselect.call(this)},w.prototype.dblClick=function(T,j){J.prototype.dblClick.call(this,T,j),this.showTextEditor()},w.prototype.setColor=function(T){this.textElement&&oe.setAttributes(this.textElement,[["fill",T]]),this.color=T,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(T)},w.prototype.setFont=function(T){this.textElement&&oe.setAttributes(this.textElement,[["font-family",T]]),this.fontFamily=T,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},w.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},w.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},J.prototype.getState.call(this));return T.typeName=w.typeName,T},w.prototype.restoreState=function(T){var j=T;this.color=j.color,this.fontFamily=j.fontFamily,this.padding=j.padding,this.text=j.text,this.createVisual(),J.prototype.restoreState.call(this,T),this.setSize()},w.prototype.scale=function(T,j){J.prototype.scale.call(this,T,j),this.setSize(),this.sizeText(),this.positionTextEditor()},w.typeName="TextMarker",w.title="Text marker",w.icon='',w}(Et),ge=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.color="transparent",X.lineWidth=3,X.drawing=!1,X.pixelRatio=1,X.color=ee.defaultColor,X.lineWidth=ee.defaultStrokeWidth,X.pixelRatio=ee.freehandPixelRatio,X.setColor=X.setColor.bind(X),X.addCanvas=X.addCanvas.bind(X),X.finishCreation=X.finishCreation.bind(X),X.setLineWidth=X.setLineWidth.bind(X),X.colorPanel=new et("Color",ee.defaultColorSet,ee.defaultColor),X.colorPanel.onColorChanged=X.setColor,X.lineWidthPanel=new kt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),X.lineWidthPanel.onWidthChanged=X.setLineWidth,X}return Ee(w,J),w.prototype.ownsTarget=function(T){return!(!J.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.drawingImage)},w.prototype.createVisual=function(){this.visual=oe.createGroup(),this.drawingImage=oe.createImage(),this.visual.appendChild(this.drawingImage);var T=oe.createTransform();this.visual.transform.baseVal.appendItem(T),this.addMarkerVisualToContainer(this.visual)},w.prototype.pointerDown=function(T,j){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(T.x,T.y),this.drawing=!0):J.prototype.pointerDown.call(this,T,j)},w.prototype.manipulate=function(T){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(T.x,T.y),this.canvasContext.stroke()):J.prototype.manipulate.call(this,T)},w.prototype.resize=function(T){J.prototype.resize.call(this,T),oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},w.prototype.pointerUp=function(T){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):J.prototype.pointerUp.call(this,T)},w.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)},w.prototype.select=function(){this.state==="creating"&&this.finishCreation(),J.prototype.select.call(this)},w.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),J.prototype.deselect.call(this)},w.prototype.finishCreation=function(){for(var T=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),j=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ee=j[0],X=j[1],ye=j[2],Ve=j[3],ot=!1,ht=0;ht0&&(ot=!0,htVe&&(Ve=ht),Ue>ye&&(ye=Ue));if(ot){this.left=ee/this.pixelRatio,this.top=X/this.pixelRatio,this.width=(ye-ee)/this.pixelRatio,this.height=(Ve-X)/this.pixelRatio;var mt=document.createElement("canvas");mt.width=ye-ee,mt.height=Ve-X,mt.getContext("2d").putImageData(this.canvasContext.getImageData(ee,X,ye-ee,Ve-X),0,0),this.drawingImgUrl=mt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},w.prototype.setDrawingImage=function(){oe.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),oe.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},w.prototype.setColor=function(T){this.color=T,this.colorChanged(T)},w.prototype.setLineWidth=function(T){this.lineWidth=T},Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=Object.assign({drawingImgUrl:this.drawingImgUrl},J.prototype.getState.call(this));return T.typeName=w.typeName,T},w.prototype.restoreState=function(T){this.createVisual(),J.prototype.restoreState.call(this,T),this.drawingImgUrl=T.drawingImgUrl,this.setDrawingImage()},w.prototype.scale=function(T,j){J.prototype.scale.call(this,T,j),this.setDrawingImage()},w.typeName="FreehandMarker",w.title="Freehand marker",w.icon='',w}(Et),de=function(J){function w(T,j,ee){var X=J.call(this,T,ee||'')||this;return X.typeBoxes=[],X.currentType=j,X.setCurrentType=X.setCurrentType.bind(X),X}return Ee(w,J),w.prototype.getUi=function(){var T=this,j=document.createElement("div");j.style.display="flex",j.style.overflow="hidden",j.style.flexGrow="2";for(var ee=function(Ve){var ot="both";switch(Ve){case 0:ot="both";break;case 1:ot="start";break;case 2:ot="end";break;case 3:ot="none"}var ht=document.createElement("div");if(ht.style.display="flex",ht.style.flexGrow="2",ht.style.alignItems="center",ht.style.justifyContent="space-between",ht.style.padding="5px",ht.style.borderWidth="2px",ht.style.borderStyle="solid",ht.style.borderColor=ot===X.currentType?X.uiStyleSettings.toolboxAccentColor:"transparent",ht.addEventListener("click",function(){T.setCurrentType(ot,ht)}),j.appendChild(ht),ot==="both"||ot==="start"){var Ue=document.createElement("div");Ue.style.display="flex",Ue.style.alignItems="center",Ue.style.minHeight="20px",Ue.innerHTML=``,Ue.style.marginLeft="5px",ht.appendChild(Ue)}var mt=document.createElement("div");mt.style.display="flex",mt.style.alignItems="center",mt.style.minHeight="20px",mt.style.flexGrow="2";var Rt=document.createElement("hr");if(Rt.style.minWidth="20px",Rt.style.border="0px",Rt.style.borderTop="3px solid "+(X.uiStyleSettings!==void 0?X.uiStyleSettings.toolboxColor:"#eeeeee"),Rt.style.flexGrow="2",mt.appendChild(Rt),ht.appendChild(mt),ot==="both"||ot==="end"){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.alignItems="center",Mt.style.minHeight="20px",Mt.innerHTML=``,Mt.style.marginRight="5px",ht.appendChild(Mt)}X.typeBoxes.push(ht)},X=this,ye=0;ye<4;ye++)ee(ye);return j},w.prototype.setCurrentType=function(T,j){var ee=this;this.currentType=T,this.typeBoxes.forEach(function(X){X.style.borderColor=X===j?ee.uiStyleSettings!==void 0?ee.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},w}(gt),ce=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.arrowType="end",X.arrowBaseHeight=10,X.arrowBaseWidth=10,X.getArrowPoints=X.getArrowPoints.bind(X),X.setArrowType=X.setArrowType.bind(X),X.arrowTypePanel=new de("Arrow type","end"),X.arrowTypePanel.onArrowTypeChanged=X.setArrowType,X}return Ee(w,J),w.prototype.ownsTarget=function(T){return!(!J.prototype.ownsTarget.call(this,T)&&T!==this.arrow1&&T!==this.arrow2)},w.prototype.getArrowPoints=function(T,j){var ee=this.arrowBaseWidth+2*this.strokeWidth,X=this.arrowBaseHeight+2*this.strokeWidth;return T-ee/2+","+(j+X/2)+" "+T+","+(j-X/2)+" "+(T+ee/2)+","+(j+X/2)},w.prototype.createTips=function(){this.arrow1=oe.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=oe.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(oe.createTransform()),this.visual.appendChild(this.arrow2)},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.state==="creating"&&this.createTips()},w.prototype.adjustVisual=function(){if(J.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",oe.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),oe.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var T=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),j=this.arrow1.transform.baseVal.getItem(0);j.setRotate(T,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(j,0);var ee=this.arrow2.transform.baseVal.getItem(0);ee.setRotate(T+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ee,0)}},w.prototype.setArrowType=function(T){this.arrowType=T,this.adjustVisual(),this.stateChanged()},Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=Object.assign({arrowType:this.arrowType},J.prototype.getState.call(this));return T.typeName=w.typeName,T},w.prototype.restoreState=function(T){J.prototype.restoreState.call(this,T);var j=T;this.arrowType=j.arrowType,this.createTips(),this.adjustVisual()},w.typeName="ArrowMarker",w.title="Arrow marker",w.icon='',w}(ze),re=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.fillColor=ee.defaultFillColor,X.strokeWidth=0,X.fillPanel=new et("Color",ee.defaultColorSet,ee.defaultFillColor),X.fillPanel.onColorChanged=X.setFillColor,X}return Ee(w,J),Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=J.prototype.getState.call(this);return T.typeName=w.typeName,T},w.typeName="CoverMarker",w.title="Cover marker",w.icon='',w}(xt),ae=function(J){function w(T,j,ee,X){var ye=J.call(this,T,X||'')||this;return ye.opacities=[],ye.opacityBoxes=[],ye.opacities=j,ye.currentOpacity=ee,ye.setCurrentOpacity=ye.setCurrentOpacity.bind(ye),ye}return Ee(w,J),w.prototype.getUi=function(){var T=this,j=document.createElement("div");return j.style.display="flex",j.style.overflow="hidden",j.style.flexGrow="2",j.style.justifyContent="space-between",this.opacities.forEach(function(ee){var X=document.createElement("div");X.style.display="flex",X.style.alignItems="center",X.style.justifyContent="center",X.style.padding="5px",X.style.borderWidth="2px",X.style.borderStyle="solid",X.style.borderColor=ee===T.currentOpacity?T.uiStyleSettings.toolboxAccentColor:"transparent",X.addEventListener("click",function(){T.setCurrentOpacity(ee,X)}),j.appendChild(X);var ye=document.createElement("div");ye.innerText=100*ee+"%",X.appendChild(ye),T.opacityBoxes.push(X)}),j},w.prototype.setCurrentOpacity=function(T,j){var ee=this;this.currentOpacity=T,this.opacityBoxes.forEach(function(X){X.style.borderColor=X===j?ee.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},w}(gt),ue=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.setOpacity=X.setOpacity.bind(X),X.fillColor=ee.defaultHighlightColor,X.strokeWidth=0,X.opacity=ee.defaultHighlightOpacity,X.fillPanel=new et("Color",ee.defaultColorSet,X.fillColor),X.fillPanel.onColorChanged=X.setFillColor,X.opacityPanel=new ae("Opacity",ee.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return Ee(w,J),w.prototype.setOpacity=function(T){this.opacity=T,this.visual&&oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=J.prototype.getState.call(this);return T.typeName=w.typeName,T},w.typeName="HighlightMarker",w.title="Highlight marker",w.icon='',w}(re),fe='',be=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.bgColor="transparent",X.tipPosition={x:0,y:0},X.tipBase1Position={x:0,y:0},X.tipBase2Position={x:0,y:0},X.tipMoving=!1,X.color=ee.defaultStrokeColor,X.bgColor=ee.defaultFillColor,X.fontFamily=ee.defaultFontFamily,X.defaultSize={x:100,y:30},X.setBgColor=X.setBgColor.bind(X),X.getTipPoints=X.getTipPoints.bind(X),X.positionTip=X.positionTip.bind(X),X.setTipPoints=X.setTipPoints.bind(X),X.colorPanel=new et("Text color",ee.defaultColorSet,X.color,''),X.colorPanel.onColorChanged=X.setColor,X.bgColorPanel=new et("Fill color",ee.defaultColorSet,X.bgColor,fe),X.bgColorPanel.onColorChanged=X.setBgColor,X.fontFamilyPanel=new Re("Font",ee.defaultFontFamilies,ee.defaultFontFamily),X.fontFamilyPanel.onFontChanged=X.setFont,X.tipGrip=new vt,X.tipGrip.visual.transform.baseVal.appendItem(oe.createTransform()),X.controlBox.appendChild(X.tipGrip.visual),X}return Ee(w,J),w.prototype.ownsTarget=function(T){return J.prototype.ownsTarget.call(this,T)||this.tipGrip.ownsTarget(T)||this.tip===T},w.prototype.createTip=function(){oe.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=oe.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},w.prototype.pointerDown=function(T,j){this.state==="new"&&J.prototype.pointerDown.call(this,T,j),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(j)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):J.prototype.pointerDown.call(this,T,j)},w.prototype.pointerUp=function(T){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,J.prototype.pointerUp.call(this,T);else{var j=this.state==="creating";J.prototype.pointerUp.call(this,T),this.setTipPoints(j),this.positionTip()}},w.prototype.manipulate=function(T){if(this.tipMoving){var j=this.unrotatePoint(T);this.tipPosition={x:j.x-this.manipulationStartLeft,y:j.y-this.manipulationStartTop},this.positionTip()}else J.prototype.manipulate.call(this,T)},w.prototype.setBgColor=function(T){this.bgRectangle&&this.tip&&(oe.setAttributes(this.bgRectangle,[["fill",T]]),oe.setAttributes(this.tip,[["fill",T]])),this.bgColor=T,this.fillColorChanged(T)},w.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},w.prototype.setTipPoints=function(T){T===void 0&&(T=!1);var j=Math.min(this.height/2,15),ee=this.height/5;T&&(this.tipPosition={x:j+ee/2,y:this.height+20});var X=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?X',w}(je),Ie=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.fillColor="transparent",X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.opacity=1,X.strokeColor=ee.defaultColor,X.strokeWidth=ee.defaultStrokeWidth,X.strokeDasharray=ee.defaultStrokeDasharray,X.fillColor=ee.defaultFillColor,X.setStrokeColor=X.setStrokeColor.bind(X),X.setFillColor=X.setFillColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.setOpacity=X.setOpacity.bind(X),X.createVisual=X.createVisual.bind(X),X.strokePanel=new et("Line color",he(ee.defaultColorSet,["transparent"]),ee.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.fillPanel=new et("Fill color",he(ee.defaultColorSet,["transparent"]),X.fillColor,fe),X.fillPanel.onColorChanged=X.setFillColor,X.strokeWidthPanel=new kt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new Ot("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X.opacityPanel=new ae("Opacity",ee.defaultOpacitySteps,X.opacity),X.opacityPanel.onOpacityChanged=X.setOpacity,X}return Ee(w,J),w.prototype.ownsTarget=function(T){return!(!J.prototype.ownsTarget.call(this,T)&&T!==this.visual)},w.prototype.createVisual=function(){this.visual=oe.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)},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.state==="new"&&(this.createVisual(),this.moveVisual(T),this._state="creating")},w.prototype.manipulate=function(T){J.prototype.manipulate.call(this,T)},w.prototype.resize=function(T){J.prototype.resize.call(this,T),this.setSize()},w.prototype.setSize=function(){J.prototype.setSize.call(this),oe.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},w.prototype.pointerUp=function(T){J.prototype.pointerUp.call(this,T),this.setSize()},w.prototype.setStrokeColor=function(T){this.strokeColor=T,this.visual&&oe.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(T),this.stateChanged()},w.prototype.setFillColor=function(T){this.fillColor=T,this.visual&&oe.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(T),this.stateChanged()},w.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.visual&&oe.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},w.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.visual&&oe.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},w.prototype.setOpacity=function(T){this.opacity=T,this.visual&&oe.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},J.prototype.getState.call(this));return T.typeName=w.typeName,T},w.prototype.restoreState=function(T){var j=T;this.fillColor=j.fillColor,this.strokeColor=j.strokeColor,this.strokeWidth=j.strokeWidth,this.strokeDasharray=j.strokeDasharray,this.opacity=j.opacity,this.createVisual(),J.prototype.restoreState.call(this,T),this.setSize()},w.prototype.scale=function(T,j){J.prototype.scale.call(this,T,j),this.setSize()},w.typeName="EllipseMarker",w.title="Ellipse marker",w.icon='',w}(Et),Xe=function(J){function w(T,j,ee){return J.call(this,T,j,ee)||this}return Ee(w,J),Object.defineProperty(w.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),w.prototype.ownsTarget=function(T){return!(!J.prototype.ownsTarget.call(this,T)&&T!==this.tip1&&T!==this.tip2)},w.prototype.createTips=function(){this.tip1=oe.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(oe.createTransform()),this.visual.appendChild(this.tip1),this.tip2=oe.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(oe.createTransform()),this.visual.appendChild(this.tip2)},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.state==="creating"&&this.createTips()},w.prototype.adjustVisual=function(){if(J.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(oe.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()]]),oe.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 T=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),j=this.tip1.transform.baseVal.getItem(0);j.setRotate(T,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(j,0);var ee=this.tip2.transform.baseVal.getItem(0);ee.setRotate(T+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ee,0)}},Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=J.prototype.getState.call(this);return T.typeName=w.typeName,T},w.prototype.restoreState=function(T){J.prototype.restoreState.call(this,T),this.createTips(),this.adjustVisual()},w.typeName="MeasurementMarker",w.title="Measurement marker",w.icon='',w}(ze),ut=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.strokePanel.colors=ee.defaultColorSet,X.fillColor="transparent",X}return Ee(w,J),Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=J.prototype.getState.call(this);return T.typeName=w.typeName,T},w.typeName="EllipseFrameMarker",w.title="Ellipse frame marker",w.icon='',w}(Ie),bt=function(){function J(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),J.prototype.addUndoStep=function(w){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(w)||(this.undoStack.push(w),JSON.stringify(this.lastRedoStep)!==JSON.stringify(w)&&this.redoStack.splice(0,this.redoStack.length))},J.prototype.replaceLastUndoStep=function(w){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=w)},J.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},J.prototype.undo=function(){if(this.undoStack.length>1){var w=this.undoStack.pop();return w!==void 0&&this.redoStack.push(w),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},J.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},J}(),ft=function(J){function w(T,j,ee){var X=J.call(this,T,j,ee)||this;return X.strokeColor="transparent",X.strokeWidth=0,X.strokeDasharray="",X.curveX=0,X.curveY=0,X.manipulationStartCurveX=0,X.manipulationStartCurveY=0,X.setStrokeColor=X.setStrokeColor.bind(X),X.setStrokeWidth=X.setStrokeWidth.bind(X),X.setStrokeDasharray=X.setStrokeDasharray.bind(X),X.positionGrips=X.positionGrips.bind(X),X.addControlGrips=X.addControlGrips.bind(X),X.adjustVisual=X.adjustVisual.bind(X),X.setupControlBox=X.setupControlBox.bind(X),X.resize=X.resize.bind(X),X.strokeColor=ee.defaultColor,X.strokeWidth=ee.defaultStrokeWidth,X.strokeDasharray=ee.defaultStrokeDasharray,X.strokePanel=new et("Line color",ee.defaultColorSet,ee.defaultColor),X.strokePanel.onColorChanged=X.setStrokeColor,X.strokeWidthPanel=new kt("Line width",ee.defaultStrokeWidths,ee.defaultStrokeWidth),X.strokeWidthPanel.onWidthChanged=X.setStrokeWidth,X.strokeStylePanel=new Ot("Line style",ee.defaultStrokeDasharrays,ee.defaultStrokeDasharray),X.strokeStylePanel.onStyleChanged=X.setStrokeDasharray,X}return Ee(w,J),w.prototype.ownsTarget=function(T){return!(!J.prototype.ownsTarget.call(this,T)&&T!==this.visual&&T!==this.selectorCurve&&T!==this.visibleCurve&&!this.curveGrip.ownsTarget(T))},w.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},w.prototype.createVisual=function(){this.visual=oe.createGroup(),this.selectorCurve=oe.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=oe.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)},w.prototype.pointerDown=function(T,j){J.prototype.pointerDown.call(this,T,j),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=T.x,this.curveY=T.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(j)&&(this.activeGrip=this.curveGrip,this._state="resize")},w.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),oe.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),oe.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),oe.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},w.prototype.setupControlBox=function(){J.prototype.setupControlBox.call(this),this.curveControlLine1=oe.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=oe.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)},w.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,J.prototype.addControlGrips.call(this)},w.prototype.positionGrips=function(){J.prototype.positionGrips.call(this);var T=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-T/2,this.curveY-T/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()))},w.prototype.manipulate=function(T){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+T.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+T.y-this.manipulationStartY),J.prototype.manipulate.call(this,T)},w.prototype.resize=function(T){this.activeGrip===this.curveGrip&&(this.curveX=T.x,this.curveY=T.y),J.prototype.resize.call(this,T),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},w.prototype.setStrokeColor=function(T){this.strokeColor=T,this.adjustVisual(),this.colorChanged(T)},w.prototype.setStrokeWidth=function(T){this.strokeWidth=T,this.adjustVisual()},w.prototype.setStrokeDasharray=function(T){this.strokeDasharray=T,this.adjustVisual()},w.prototype.scale=function(T,j){this.curveX=this.curveX*T,this.curveY=this.curveY*j,J.prototype.scale.call(this,T,j)},Object.defineProperty(w.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),w.prototype.getState=function(){var T=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},J.prototype.getState.call(this));return T.typeName=w.typeName,T},w.prototype.restoreState=function(T){J.prototype.restoreState.call(this,T);var j=T;this.strokeColor=j.strokeColor,this.strokeWidth=j.strokeWidth,this.strokeDasharray=j.strokeDasharray,this.curveX=j.curveX,this.curveY=j.curveY,this.createVisual(),this.adjustVisual()},w.typeName="CurveMarker",w.title="Curve marker",w.icon='',w}(Ge),at=function(){function J(w,T){T===void 0&&(T=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=w,this.cancelable=T}return Object.defineProperty(J.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),J.prototype.preventDefault=function(){this._defaultPrevented=!0},J}(),Be=function(J){function w(T,j,ee){var X=J.call(this,T,!1)||this;return X.dataUrl=j,X.state=ee,X}return Ee(w,J),w}(at),We=function(J){function w(T,j,ee){ee===void 0&&(ee=!1);var X=J.call(this,T,ee)||this;return X.marker=j,X}return Ee(w,J),w}(at),Me=function(){function J(){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 J.prototype.addEventListener=function(w,T){this[w].push(T)},J.prototype.removeEventListener=function(w,T){var j=this[w].indexOf(T);j>-1&&this[w].splice(j,1)},J}(),se=function(){function J(w){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ce,this._isOpen=!1,this.undoRedoManager=new bt,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 Me,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=J.instanceCounter++,this.styles=new qe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=w,this.targetRoot=document.body,this.width=w.clientWidth,this.height=w.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(J.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ae,ge,ce,je,ut,Ie,ue,be,Xe,re,ze,ft]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ae,ge,ce,je,Ie,ue,be]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ae,ge,ce,je,ue]},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(w){var T=this;this._availableMarkerTypes.splice(0),w.forEach(function(j){if(typeof j=="string"){var ee=T.ALL_MARKER_TYPES.find(function(X){return X.typeName===j});ee!==void 0&&T._availableMarkerTypes.push(ee)}else T._availableMarkerTypes.push(j)})},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(w){this._zoomLevel=w,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(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),J.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),Le.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},J.prototype.show=function(){var w=this;this.styles.styleSheetRoot===void 0&&nt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=nt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(T){return T(new at(w))})},J.prototype.render=function(){return Oe(this,void 0,void 0,function(){var w;return we(this,function(T){switch(T.label){case 0:return this.setCurrentMarker(),(w=new Ye).naturalSize=this.renderAtNaturalSize,w.imageType=this.renderImageType,w.imageQuality=this.renderImageQuality,w.markersOnly=this.renderMarkersOnly,w.width=this.renderWidth,w.height=this.renderHeight,[4,w.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return T.sent(),[4,w.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,T.sent()]}})})},J.prototype.close=function(w){var T=this;if(w===void 0&&(w=!1),this.isOpen){var j=!1;w||this.eventListeners.beforeclose.forEach(function(ee){var X=new at(T,!0);ee(X),X.defaultPrevented&&(j=!0)}),j||(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(ee){return ee(new at(T))}),this.detachEvents(),this._isOpen=!1)}},J.prototype.addMarkersToToolbar=function(){for(var w,T=[],j=0;jthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*w:this.editorCanvas.clientWidth,j=T',w.title="Powered by marker.js",w.style.display="grid",w.style.alignItems="center",w.style.justifyItems="center",w.style.padding="3px",w.style.width="20px",w.style.height="20px",this.logoUI.appendChild(w),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},J.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")},J.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"},J.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},J.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 w=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=w+"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 $e(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(w),1),w.dispose()},J.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())},J.prototype.toolbarButtonClicked=function(w,T){if(w==="marker"&&T!==void 0)this.createNewMarker(T);else if(w==="action")switch(T){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()}},J.prototype.deleteSelectedMarker=function(){var w=this;if(this._currentMarker!==void 0){var T=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ee){var X=new We(w,w._currentMarker,!0);ee(X),X.defaultPrevented&&(T=!0)}),!T){var j=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(ee){return ee(new We(w,j))})}}},J.prototype.clear=function(){var w=this,T=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ye){var Ve=new We(w,void 0,!0);ye(Ve),Ve.defaultPrevented&&(T=!0)}),!T)){this.setCurrentMarker();for(var j=function(ye){var Ve=ee.markers[ye];ee.setCurrentMarker(ee.markers[ye]),ee._currentMarker.dispose(),ee.markerImage.removeChild(ee._currentMarker.container),ee.markers.splice(ee.markers.indexOf(ee._currentMarker),1),ee.eventListeners.markerdelete.forEach(function(ot){return ot(new We(w,Ve))})},ee=this,X=this.markers.length-1;X>=0;X--)j(X);this.addUndoStep()}},Object.defineProperty(J.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),J.prototype.showNotesEditor=function(){var w;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=(w=this._currentMarker.notes)!==null&&w!==void 0?w:"",this.overlayContainer.appendChild(this.notesArea))},J.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)},J.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},J.prototype.addUndoStep=function(){var w=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var T=this.getState(),j=this.undoRedoManager.getLastUndoStep();if(!j||j.width===T.width&&j.height===T.height){var ee=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(T),ee1&&this.panTo({x:w.clientX,y:w.clientY}))},J.prototype.onPointerUp=function(w){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(w.clientX,w.clientY)),this.isDragging=!1,this.addUndoStep()},J.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},J.prototype.onKeyUp=function(w){this._currentMarker===void 0||this.notesArea!==void 0||w.key!=="Delete"&&w.key!=="Backspace"||this.deleteSelectedMarker()},J.prototype.clientToLocalCoordinates=function(w,T){var j=this.markerImage.getBoundingClientRect();return{x:(w-j.left)/this.zoomLevel,y:(T-j.top)/this.zoomLevel}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var w=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=w+"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()},J.prototype.addLicenseKey=function(w){Le.addKey(w)},J.prototype.addEventListener=function(w,T){this.eventListeners.addEventListener(w,T)},J.prototype.removeEventListener=function(w,T){this.eventListeners.removeEventListener(w,T)},J.prototype.renderState=function(w){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(w),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(J.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),J.prototype.focus=function(){var w=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(T){return T(new at(w))}))},J.prototype.blur=function(){var w=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(T){return T(new at(w))}))},J.instanceCounter=0,J}();/* **********************************
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 ve=function(J,w){return(ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,j){T.__proto__=j}||function(T,j){for(var ee in j)Object.prototype.hasOwnProperty.call(j,ee)&&(T[ee]=j[ee])})(J,w)};function Ke(J,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");function T(){this.constructor=J}ve(J,w),J.prototype=w===null?Object.create(w):(T.prototype=w.prototype,new T)}function Pe(J,w,T,j){return new(T||(T=Promise))(function(ee,X){function ye(ht){try{ot(j.next(ht))}catch(Ue){X(Ue)}}function Ve(ht){try{ot(j.throw(ht))}catch(Ue){X(Ue)}}function ot(ht){var Ue;ht.done?ee(ht.value):(Ue=ht.value,Ue instanceof T?Ue:new T(function(mt){mt(Ue)})).then(ye,Ve)}ot((j=j.apply(J,w||[])).next())})}function st(J,w){var T,j,ee,X,ye={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return X={next:Ve(0),throw:Ve(1),return:Ve(2)},typeof Symbol=="function"&&(X[Symbol.iterator]=function(){return this}),X;function Ve(ot){return function(ht){return function(Ue){if(T)throw new TypeError("Generator is already executing.");for(;ye;)try{if(T=1,j&&(ee=2&Ue[0]?j.return:Ue[0]?j.throw||((ee=j.return)&&ee.call(j),0):j.next)&&!(ee=ee.call(j,Ue[1])).done)return ee;switch(j=0,ee&&(Ue=[2&Ue[0],ee.value]),Ue[0]){case 0:case 1:ee=Ue;break;case 4:return ye.label++,{value:Ue[1],done:!1};case 5:ye.label++,j=Ue[1],Ue=[0];continue;case 7:Ue=ye.ops.pop(),ye.trys.pop();continue;default:if(!(ee=ye.trys,(ee=ee.length>0&&ee[ee.length-1])||Ue[0]!==6&&Ue[0]!==2)){ye=0;continue}if(Ue[0]===3&&(!ee||Ue[1]>ee[0]&&Ue[1]0&&T>0){var j=new Rn(w,T),ee=j.ratio>=1?20:j.getHorizontalLength(20),X=j.ratio<1?20:j.getVerticalLength(20),ye=document.createElementNS("http://www.w3.org/2000/svg","svg");ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),ye.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ye);var Ve=Te.createDefs();ye.appendChild(Ve);var ot=Te.createElement("clipPath",[["id","text-bg-clip"]]);Ve.appendChild(ot);var ht=Te.createPath(Te.getHollowRectanglePath((24-ee)/2,(24-X)/2,ee,X,(24-ee)/2+2,(24-X)/2+2,ee-4,X-4));ye.appendChild(ht);var Ue=Te.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Ue.appendChild(Te.createTSpan(w+":"+T)),ye.appendChild(Ue);var mt=Ue.getBBox();Te.setAttributes(Ue,[["x",((24-mt.width)/2).toString()],["y",((24-mt.height)/2-mt.y).toString()]]);var Rt=Te.createPath(Te.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(mt.width))/2,(24-Math.ceil(mt.height))/2,Math.ceil(mt.width),Math.ceil(mt.height)));return ot.appendChild(Rt),Te.setAttributes(ht,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ye),ye.outerHTML}return''},J}(),Cn=function(J){function w(T,j,ee){var X=J.call(this,T,j)||this;return X.isDropdownOpen=!1,X.onClick=X.dropdownButtonClicked,X.dropdownButtons=ee,X}return Ke(w,J),w.prototype.setupDropdown=function(){var T=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(j){j.className=T.className,j.colorsClassName=T.colorsClassName,T.dropdownBlock.appendChild(j.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},w.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},w.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},w.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},w.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},w.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},w}(en),Qt=function(){function J(w,T){this.GRIP_SIZE=10,this.color=w,this.fillColor=T,this.visual=Te.createGroup(),this.visual.appendChild(Te.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Te.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return J.prototype.ownsTarget=function(w){return w===this.visual||w===this.visual.childNodes[0]||w===this.visual.childNodes[1]},J.prototype.setCenter=function(w,T){this.visual.childNodes.forEach(function(j){return Te.setAttributes(j,[["cx",w.toString()],["cy",T.toString()]])})},J}(),Sn=function(){function J(w,T,j,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=w,this.canvasHeight=T,this.margin=j,this.container=ee,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(J.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(w){this._aspectRatio=w,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(w){this._isGridVisible=w,this.gridContainer&&Te.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(w){this._zoomFactor=w,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),J.prototype.open=function(){var w=this;this.cropShadeElement=Te.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Te.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var T=0;Tthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-T.height/2),Te.setAttributes(this.cropRectElement,[["x",T.x.toString()],["y",T.y.toString()],["width",T.width.toString()],["height",T.height.toString()]]);var j=T.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(X,ye){var Ve=T.y+j*(ye+1);Te.setAttributes(X,[["x1",""+T.x],["y1",""+Ve],["x2",""+(T.x+T.width)],["y2",""+Ve]])});var ee=T.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(X,ye){var Ve=T.x+ee*(ye+1);Te.setAttributes(X,[["x1",""+Ve],["y1",""+T.y],["x2",""+Ve],["y2",""+(T.y+T.height)]])}),Te.setAttributes(this.cropShadeElement,[["d",Te.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,T.x,T.y,T.width,T.height)]]),this.topLeftGrip.setCenter(T.x,T.y),this.topRightGrip.setCenter(T.x+T.width,T.y),this.bottomLeftGrip.setCenter(T.x,T.y+T.height),this.bottomRightGrip.setCenter(T.x+T.width,T.y+T.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},J.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)},J.prototype.clientToLocalCoordinates=function(w,T){var j=this.container.getBoundingClientRect();return{x:w-j.left+this.margin,y:T-j.top+this.margin}},J.prototype.onPointerDown=function(w){this.container.setPointerCapture(w.pointerId),this.previousPoint=this.clientToLocalCoordinates(w.clientX,w.clientY),this.cropRectElement===w.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(w.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(w.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(w.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(w.target)&&(this.activeGrip=this.bottomRightGrip)},J.prototype.onPointerMove=function(w){if(this.isMoving)this.move(this.clientToLocalCoordinates(w.clientX,w.clientY));else if(this.activeGrip){var T=this.clientToLocalCoordinates(w.clientX,w.clientY);this.resize(T)}w.preventDefault()},J.prototype.onPointerUp=function(w){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(w.pointerId)},J.prototype.move=function(w){var T=w.x-this.previousPoint.x,j=w.y-this.previousPoint.y;this.zoomFactor!==1&&(T=-T/this.zoomFactor,j=-j/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+T),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+j),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=w},J.prototype.resize=function(w){var T=Object.assign({},this.cropRect),j=w.x-this.previousPoint.x,ee=w.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:T.x+jthis.canvasWidth*this.zoomFactor&&(j=this.canvasWidth*this.zoomFactor-T.width),T.width+=j}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(T.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(j),T.height=this.aspectRatio.getVerticalLength(T.width)):(T.y+=ee,T.height=this.cropRect.y+this.cropRect.height-T.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?T.height=this.aspectRatio.getVerticalLength(T.width):T.height+=ee}T.width<10&&(T.x=this.cropRect.x,T.width=10),T.height<10&&(T.y=this.cropRect.y,T.height=10),this.previousPoint=w,T.x>=this.margin&&T.y>=this.margin&&T.x-this.margin+T.width<=this.canvasWidth&&T.y-this.margin+T.height<=this.canvasHeight&&(this.cropRect=T,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},J.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var w=this.cropRect.x+this.cropRect.width/2,T=this.cropRect.y+this.cropRect.height/2,j=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);j/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=w-this.cropRect.width/2,this.cropRect.y=T-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)}},J.prototype.getRescaledRect=function(w,T,j,ee,X,ye){var Ve=j/w,ot=ee/T;return{x:(X.x-ye)*Ve+ye,y:(X.y-ye)*ot+ye,width:X.width*Ve,height:X.height*ot}},J.prototype.scaleCanvas=function(w,T){var j=this.getRescaledRect(this.canvasWidth,this.canvasHeight,w,T,this.cropRect,this.margin);this.canvasWidth=w,this.canvasHeight=T,this.onCropChange&&this.onCropChange(j),this.setCropRectangle(j)},J}(),Bn=function(){function J(w){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=w,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(J.prototype,"angle",{get:function(){return this._angle},set:function(w){this._angle=w,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),J.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},J.prototype.onPointerDown=function(w){this.controlContainer.setPointerCapture(w.pointerId),this.isDragging=!0,this.previousPoint={x:w.clientX,y:w.clientY}},J.prototype.onPointerMove=function(w){this.isDragging&&(this.onAngleChange&&this.onAngleChange((w.clientX-this.previousPoint.x)/5),this.previousPoint.x=w.clientX)},J.prototype.onPointerUp=function(w){this.isDragging&&this.onAngleChange&&this.onAngleChange((w.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(w.pointerId)},J.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var w=this.angleLabelText.getBBox();Te.setAttributes(this.angleLabelElement,[["x",((this.width-w.width)/2).toString()],["y",(this.height/2).toString()]])}},J.prototype.positionScaleShape=function(){if(this.scaleShape){var w=this.scaleShape.transform.baseVal.getItem(0);w.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(w,0)}},J.prototype.getVisual=function(){var w=document.createElementNS("http://www.w3.org/2000/svg","svg");w.setAttribute("xmlns","http://www.w3.org/2000/svg"),w.setAttribute("width",this.width+"px"),w.setAttribute("height",this.height+"px"),w.setAttribute("viewBox","0 0 "+this.width+" "+this.height),w.style.flexShrink="0",document.body.appendChild(w);for(var T="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,j=1;j<=this.width/5+10;j++){var ee=j%5==0?this.height/3:this.height/6;T+="h4v"+-ee+"h1v"+ee}T+="v1H0Z",this.scaleShape=Te.createPath(T);var X=Te.createTransform();this.scaleShape.transform.baseVal.appendItem(X),w.appendChild(this.scaleShape),this.angleLabelElement=Te.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Te.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ye=Te.createTSpan("");return ye.innerHTML="°",this.angleLabelElement.appendChild(ye),w.appendChild(this.angleLabelElement),document.body.removeChild(w),w},J}(),li=function(){function J(){this.naturalSize=!1,this.imageType="image/png"}return J.prototype.rasterize=function(w,T,j,ee,X,ye,Ve){var ot=this;return new Promise(function(ht){var Ue=document.createElement("canvas");Ue.width=w.width.baseVal.value-2*ee,Ue.height=w.height.baseVal.value-2*ee;var mt=1,Rt=1;ot.naturalSize===!0?(mt=T.naturalWidth/(w.width.baseVal.value-2*ee)/ye,Rt=T.naturalHeight/(w.height.baseVal.value-2*ee)/Ve,Ue.width=T.naturalWidth/ye,Ue.height=T.naturalHeight/Ve):ot.width!==void 0&&ot.height!==void 0&&(mt=ot.width/j.width,Rt=ot.height/j.height,Ue.width*=mt,Ue.height*=Rt);var Mt=Ue.getContext("2d");Mt.translate(Ue.width/2,Ue.height/2),Mt.rotate(X*Math.PI/180),Mt.scale(ye,Ve),Mt.translate(-Ue.width/2,-Ue.height/2),Mt.drawImage(T,0,0,Ue.width,Ue.height);var Jt=document.createElement("canvas");Jt.width=j.width*mt,Jt.height=j.height*Rt,Jt.getContext("2d").putImageData(Mt.getImageData((j.x-ee)*mt,(j.y-ee)*Rt,j.width*mt,j.height*Rt),0,0),ht(Jt.toDataURL(ot.imageType,ot.imageQuality))})},J}(),ct=function(){function J(w){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=J.instanceCounter++,this.styles=new ke(this.instanceNo),this.target=w,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(J.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(w){this._zoomToCropEnabled=w,w?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(w){this._isGridVisible=w,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"gridLines",{get:function(){return this._gridLines},set:function(w){this._gridLines=w,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(w){this._rotationAngle=w,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(J.prototype,"aspectRatio",{get:function(){var w;return(w=this._aspectRatio)!==null&&w!==void 0?w:this.aspectRatios[0]},set:function(w){this._aspectRatio=w},enumerable:!1,configurable:!0}),J.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},J.prototype.show=function(){this.showUI(),this.open()},J.prototype.close=function(w){w===void 0&&(w=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),w||this.closeEventListeners.forEach(function(T){return T()}),this._isOpen=!1)},J.prototype.addRenderEventListener=function(w){this.renderEventListeners.push(w)},J.prototype.removeRenderEventListener=function(w){this.renderEventListeners.indexOf(w)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(w),1)},J.prototype.addCloseEventListener=function(w){this.closeEventListeners.push(w)},J.prototype.removeCloseEventListener=function(w){this.closeEventListeners.indexOf(w)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(w),1)},J.prototype.setupResizeObserver=function(){var w=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){w.resize(w.target.clientWidth,w.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))},J.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var w=1*this.target.clientWidth/this.target.clientHeight,T=this.contentDiv.clientWidth/w>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*w:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,j=T+2*this.CANVAS_MARGINw+this.CANVAS_MARGIN?this.target.offsetTop-(w+this.CANVAS_MARGIN):0;this.coverDiv.style.top=T+"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},J.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},J.prototype.addTopToolbar=function(){var w=this;this.topToolbar=new At,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 T=new yn;T.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(T);var j=[];this.aspectRatios.forEach(function(Rt){var Mt=new en(Fn.getIcon(Rt.horizontal,Rt.vertical),Rt.horizontal===0&&Rt.vertical===0?"FREE":Rt.horizontal+":"+Rt.vertical);Mt.onClick=function(){return w.ratioButtonClicked(Rt)},j.push(Mt)}),this.aspectRatioButton=new Cn(Fn.getIcon(0,0),"Aspect ratio",j),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,T.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new en('',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){w.isGridVisible=!w.isGridVisible,ee.isActive=w.isGridVisible},T.addButton(ee);var X=new en('',"Zoom to selection");if(X.isActive=this.zoomToCropEnabled,X.onClick=function(){w.zoomToCropEnabled=!w.zoomToCropEnabled,X.isActive=w.zoomToCropEnabled},T.addButton(X),!dt.isLicensed){var ye=new Dt;this.topToolbar.addElementBlock(ye);var Ve=document.createElement("div");Ve.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ot=document.createElement("a");ot.style.color="currentColor",ot.href="https://markerjs.com/products/cropro",ot.target="_blank",ot.innerHTML='',Ve.appendChild(ot),ye.addElement(Ve)}var ht=new yn;ht.minWidth=3*this.toolbarHeight+"px",ht.contentAlign="end",this.topToolbar.addButtonBlock(ht);var Ue=new en('',"OK");Ue.onClick=this.startRenderAndClose,ht.addButton(Ue),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Ue.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var mt=new en('',"Close");mt.onClick=this.close,ht.addButton(mt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(mt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},J.prototype.addBottomToolbar=function(){var w=this;this.bottomToolbar=new At,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 T=new yn;T.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(T);var j=new en('',"Rotate left");j.onClick=this.rotateLeftButtonClicked,T.addButton(j);var ee=new en('',"Rotate right");ee.onClick=this.rotateRightButtonClicked,T.addButton(ee);var X=new Dt;X.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(X),this.straightener=new Bn("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(ht){w.rotateBy(ht),w.straightener.angle=w.rotationAngle},X.addElement(this.straightener.getUI());var ye=new yn;ye.minWidth=2*this.toolbarHeight+"px",ye.contentAlign="end",this.bottomToolbar.addButtonBlock(ye);var Ve=new en('',"Flip horizontal");Ve.onClick=this.flipHorizontallyButtonClicked,ye.addButton(Ve);var ot=new en('',"Flip vertical");ot.onClick=this.flipVerticallyButtonClicked,ye.addButton(ot)},J.prototype.ratioButtonClicked=function(w){this.aspectRatio=w,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},J.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Fn.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},J.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Rn(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},J.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},J.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},J.prototype.restoreState=function(w){if(w){var T=this.cropLayer.getRescaledRect(w.width,w.height,this.imageWidth,this.imageHeight,w.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(T),this.cropRectChanged(T),this.flippedHorizontally=w.flippedHorizontally,this.flippedVertically=w.flippedVertically,this.applyFlip(),this.rotationAngle=w.rotationAngle,this.applyRotation()}},J.prototype.clientToLocalCoordinates=function(w,T){var j=this.cropImage.getBoundingClientRect();return{x:w-j.left,y:T-j.top}},J.prototype.onWindowResize=function(){this.positionUI()},J.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var w=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=w+"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()},J.prototype.rotateLeftButtonClicked=function(){var w=this.rotationAngle-90;this.rotationAngle%90!=0&&(w+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(w)},J.prototype.rotateRightButtonClicked=function(){var w=this.rotationAngle+90;this.rotationAngle%90!=0&&(w-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(w)},J.prototype.rotateTo=function(w){w=(w=w>180?w-360:w)<=-180?w+360:w,this.rotationAngle=w,this.applyRotation()},J.prototype.rotateBy=function(w){this.rotateTo((this.rotationAngle+w)%360)},J.prototype.applyRotation=function(){var w=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var T=this.editingTargetRotationContainer.transform.baseVal.getItem(0);T.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(T,0);var j=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/j.width,this.imageHeight/j.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=w},J.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},J.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},J.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},J.prototype.startRenderAndClose=function(){return Pe(this,void 0,void 0,function(){var w,T;return st(this,function(j){switch(j.label){case 0:return[4,this.render()];case 1:return w=j.sent(),T=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(w,T)}),this.close(!0),[2]}})})},J.prototype.render=function(){return Pe(this,void 0,void 0,function(){var w;return st(this,function(T){switch(T.label){case 0:return(w=new li).naturalSize=this.renderAtNaturalSize,w.imageType=this.renderImageType,w.imageQuality=this.renderImageQuality,w.width=this.renderWidth,w.height=this.renderHeight,this.unzoomFromCrop(),Te.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,w.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 T.sent(),[4,w.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,T.sent()]}})})},J.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ct("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var w=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ct("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*w)+`px;
height: `+(this.toolbarHeight-2*w)+`px;
padding: `+w+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ct("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ct("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new rt("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new rt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ct("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 Ct("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*w)+`px;
padding: `+w+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ct("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},J.instanceCounter=0,J}(),St=W("8hTe"),zn=W.n(St),pi=/]*>/g;function ui(J){var w=document.createElement("div");return w.innerHTML=J,w.childNodes.length===0?"":w.childNodes[0].nodeValue}var ki=Se.a=function(J){var w=J.value,T=w===void 0?"":w,j=J.edit,ee=j===void 0?!1:j,X=J.className,ye=J.showTextOnly,Ve=J.showLines,ot=J.replaces,ht=J.zoomImg,Ue=J.hasMask,mt=J.style,Rt=mt===void 0?{}:mt,Mt=J.stylesPrev,Jt=Mt===void 0?{}:Mt,Tt=String(T),qt=Object(I.useRef)(),Zt=Object(I.useRef)(),Mn=Object(I.useState)(""),Gt=Object(H.a)(Mn,2),wn=Gt[0],On=Gt[1],Ln=Object(I.useState)("office"),xn=Object(H.a)(Ln,2),In=xn[0],Hn=xn[1],ri=function(){var yt=new ct(Zt.current);yt.displayMode="popup",yt.addRenderEventListener(function(){var Wt=Object(L.a)(D.a.mark(function pt($t){var Nt;return D.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:return qt.current.style.display="none",sn.next=3,Object(_e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:$t}});case 3:Nt=sn.sent,Nt!=null&&Nt.id&&ot(Zt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Nt==null?void 0:Nt.id,"?type=").concat(Nt.content_type));case 5:case"end":return sn.stop()}},pt)}));return function(pt){return Wt.apply(this,arguments)}}()),yt.show()},Vn=function(){var yt=new se(Zt.current);yt.settings.displayMode="popup",yt.addEventListener("render",function(){var Wt=Object(L.a)(D.a.mark(function pt($t){var Nt;return D.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:if(qt.current.style.display="none",!Zt.current){sn.next=6;break}return sn.next=4,Object(_e.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:$t.dataUrl}});case 4:Nt=sn.sent,Nt!=null&&Nt.id&&ot(Zt.current.getAttribute("src").replace(Q.a.API_SERVER,""),"/api/attachments/".concat(Nt==null?void 0:Nt.id,"?type=").concat(Nt.content_type));case 6:case"end":return sn.stop()}},pt)}));return function(pt){return Wt.apply(this,arguments)}}()),yt.show(),window.markerArea=yt},_n=Object(I.useMemo)(function(){qt.current&&(qt.current.style.zIndex=-1);try{var zt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,yt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Wt=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Tt=Tt.replace(zt,"("+Q.a.API_SERVER+"/api/attachments/").replace(yt,'"'+Q.a.API_SERVER+"/api/attachments/").replace(Wt,'"'+Q.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(Xn){}var pt=$(Tt),$t=E();if(Tt.match(/\[TOC\]/)&&(pt=pt.replace("[TOC]
",A()),O()),pt=pt.replace(/(__special_katext_id_\d+__)/g,function(Xn,sn){var Zn=$t[sn],Ki=Zn.type,Ci=Zn.expression;return Object(ne.renderToString)(ui(Ci)||"",{displayMode:Ki==="block",throwOnError:!1,output:"html"})}),pt=pt.replace(/▁/g,"\u2581\u2581\u2581"),y(),ye){var Nt=document.createElement("div");return Nt.innerHTML=pt,Nt.innerText}return setTimeout(function(){return pn()},500),pt},[Tt]),jn=Object(I.useRef)();S.WebkitLineClamp=Ve,Ve&&(Rt=Object(U.a)(Object(U.a)({},Rt),S));function dn(zt){var yt=zt.target;if(yt.tagName.toUpperCase()==="IMG"){if(ht){var Wt=yt.getAttribute("src");On(Wt),Hn("image")}}else if(yt.tagName.toUpperCase()==="A"){var pt=yt.getAttribute("href");if(pt.indexOf("office")>-1)zt.preventDefault(),On(pt),Hn("office");else if(pt.indexOf("application/pdf")>-1)zt.preventDefault(),On(pt),Hn("pdf");else if(pt.indexOf("text/html")>-1)zt.preventDefault(),On(pt),Hn("html");else if(pt.startsWith("#")){zt.preventDefault();var $t=document.getElementById(pt.replace("#",""));$t&&$t.scrollIntoView(!0)}}}var pn=function(){var yt,Wt=(yt=jn.current)===null||yt===void 0?void 0:yt.querySelectorAll("video");Wt==null||Wt.forEach(function(pt){if(pt.oncontextmenu=function(){return!1},pt.src.indexOf(".m3u8")>-1&&!pt.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var $t=new G.a;$t.loadSource(pt.src),$t.attachMedia(pt)}}})};Object(I.useEffect)(function(){if(jn.current&&_n&&(_n.match(pi)&&window.PR.prettyPrint()),jn.current)return jn.current.addEventListener("click",dn),function(){jn.current.removeEventListener("click",dn),y(),O()}},[_n,jn.current,dn]);var mn=function(yt){if(!ee)return;yt.target.nodeName==="IMG"?(qt.current.style.zIndex=1,qt.current.style.display="flex",qt.current.style.width=yt.target.clientWidth+"px",qt.current.style.height=yt.target.clientHeight+"px",qt.current.style.top=yt.target.offsetTop+"px",qt.current.style.left=yt.target.offsetLeft+"px",Zt.current.src=yt.target.getAttribute("src")):qt.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:jn,style:Object(U.a)({},Rt),className:"".concat(X||""," markdown-body ").concat(zn.a.mdBody),onMouseOver:mn,dangerouslySetInnerHTML:{__html:_n}}),g.a.createElement("div",{ref:qt,className:zn.a.button},g.a.createElement(V.a,null,g.a.createElement(z.a,{onClick:function(){return ri()}},"\u88C1\u526A"),g.a.createElement(z.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Zt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(le.a,{close:!0,data:wn,type:wn!=null&&wn.length?In:"",style:Object(U.a)({},Jt),onClose:function(){return On("")}}))}},"9VGf":function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return M});var q=W("q1tI"),V=W.n(q);function M(z,U){var L=Object(q.useRef)();Object(q.useEffect)(function(){L.current=z}),Object(q.useEffect)(function(){function H(){L.current()}if(U!==null){var F=setInterval(H,U);return function(){return clearInterval(F)}}},[U])}},AMnG:function(Fe,Se,W){"use strict";var q=W("miYZ"),V=W("tsqr"),M=W("tJVT"),z=W("q1tI"),U=W.n(z),L=W("nWbc"),H=W.n(L),F=W("Ot1p");Se.a=function(D){var I=D.id,g=D.activeDiscussIndex,f=D.onReplyDiscuss,u=Object(z.useState)(""),d=Object(M.a)(u,2),s=d[0],l=d[1];function r(n){l(n)}function a(){if(!s){V.b.info("\u56DE\u590D\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A!");return}f(I,s),l("")}return U.a.createElement("div",{key:I,className:"discuss-item-editor",style:{display:g===I?"block":"none",width:"100%"}},U.a.createElement(F.a,{miniToolbar:!0,startInit:g===I,defaultValue:s,id:I,noStorage:!0,watch:!1,height:155,placeholder:"\u6211\u8981\u56DE\u590D",showResizeBar:!0,onChange:r}),U.a.createElement("a",{onClick:a,className:"btn-send"},"\u53D1\u9001"))}},BU3w:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return L});var q=W("MNnm"),V="rc-util-key";function M(H){if(H.attachTo)return H.attachTo;var F=document.querySelector("head");return F||document.body}function z(H){var F,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(q.a)())return null;var I=document.createElement("style");if((F=D.csp)===null||F===void 0?void 0:F.nonce){var g;I.nonce=(g=D.csp)===null||g===void 0?void 0:g.nonce}I.innerHTML=H;var f=M(D),u=f.firstChild;return D.prepend&&f.prepend?f.prepend(I):D.prepend&&u?f.insertBefore(I,u):f.appendChild(I),I}var U=new Map;function L(H,F){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},I=M(D);if(!U.has(I)){var g=z("",D),f=g.parentNode;U.set(I,f),f.removeChild(g)}var u=Array.from(U.get(I).children).find(function(a){return a.tagName==="STYLE"&&a[V]===F});if(u){var d,s;if(((d=D.csp)===null||d===void 0?void 0:d.nonce)&&u.nonce!==((s=D.csp)===null||s===void 0?void 0:s.nonce)){var l;u.nonce=(l=D.csp)===null||l===void 0?void 0:l.nonce}return u.innerHTML!==H&&(u.innerHTML=H),u}var r=z(H,D);return r[V]=F,r}},Bd2K:function(Fe,Se,W){(function(q){q(W("VrN/"),W("osHv"))})(function(q){q.defineOption("autoCloseTags",!1,function(D,I,g){if(g!=q.Init&&g&&D.removeKeyMap("autoCloseTags"),!I)return;var f={name:"autoCloseTags"};(typeof I!="object"||I.whenClosing!==!1)&&(f["'/'"]=function(u){return L(u)}),(typeof I!="object"||I.whenOpening!==!1)&&(f["'>'"]=function(u){return z(u)}),D.addKeyMap(f)});var V=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],M=["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 z(D){if(D.getOption("disableInput"))return q.Pass;for(var I=D.listSelections(),g=[],f=D.getOption("autoCloseTags"),u=0;ud.ch&&(n=n.slice(0,n.length-s.end+d.ch));var x=n.toLowerCase();if(!n||s.type=="string"&&(s.end!=d.ch||!/[\"\']/.test(s.string.charAt(s.string.length-1))||s.string.length==1)||s.type=="tag"&&a.close||s.string.indexOf("/")==d.ch-s.start-1||O&&H(O,x)>-1||F(D,l.mode.xmlCurrentContext&&l.mode.xmlCurrentContext(r)||[],n,d,!0))return q.Pass;var A=typeof f=="object"&&f.emptyTags;if(A&&H(A,n)>-1){g[u]={text:"/>",newPos:q.Pos(d.line,d.ch+2)};continue}var C=S&&H(S,x)>-1;g[u]={indent:C,text:">"+(C?`
`:"")+""+n+">",newPos:C?q.Pos(d.line+1,0):q.Pos(d.line,d.ch+1)}}for(var b=typeof f=="object"&&f.dontIndentOnAutoClose,u=I.length-1;u>=0;u--){var v=g[u];D.replaceRange(v.text,I[u].head,I[u].anchor,"+insert");var p=D.listSelections().slice(0);p[u]={head:v.newPos,anchor:v.newPos},D.setSelections(p),!b&&v.indent&&(D.indentLine(v.newPos.line,null,!0),D.indentLine(v.newPos.line+1,null,!0))}}function U(D,I){for(var g=D.listSelections(),f=[],u=I?"/":"",d=D.getOption("autoCloseTags"),s=typeof d=="object"&&d.dontIndentOnSlash,l=0;l"&&(O+=">"),f[l]=O}if(D.replaceSelections(f),g=D.listSelections(),!s)for(var l=0;l=0&&I[r]==g;r--)++l;f=s.to;for(var r=1;r0){for(var I=0;I1&&arguments[1]!==void 0?arguments[1]:"",I=[],g=0;g=0;I--){var g=M().key(I);D(z(g),g)}}function H(D){return M().removeItem(D)}function F(){return M().clear()}},DlQD:function(Fe,Se,W){(function(q,V){Fe.exports=V()})(this,function(){"use strict";function q(ge,de){for(var ce=0;cege.length)&&(de=ge.length);for(var ce=0,re=new Array(de);ce=ge.length?{done:!0}:{done:!1,value:ge[re++]}}}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 ce=ge[Symbol.iterator](),ce.next.bind(ce)}function L(ge,de){return de={exports:{}},ge(de,de.exports),de.exports}var H=L(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 ce(re){ge.exports.defaults=re}ge.exports={defaults:de(),getDefaults:de,changeDefaults:ce}}),F=H.defaults,D=H.getDefaults,I=H.changeDefaults,g=/[&<>"']/,f=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,d=/[<>"']|&(?!#?\w+;)/g,s={"&":"&","<":"<",">":">",'"':""","'":"'"},l=function(de){return s[de]};function r(ge,de){if(de){if(g.test(ge))return ge.replace(f,l)}else if(u.test(ge))return ge.replace(d,l);return ge}var a=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function n(ge){return ge.replace(a,function(de,ce){return ce=ce.toLowerCase(),ce==="colon"?":":ce.charAt(0)==="#"?ce.charAt(1)==="x"?String.fromCharCode(parseInt(ce.substring(2),16)):String.fromCharCode(+ce.substring(1)):""})}var h=/(^|[^\[])\^/g;function O(ge,de){ge=ge.source||ge,de=de||"";var ce={replace:function(ae,ue){return ue=ue.source||ue,ue=ue.replace(h,"$1"),ge=ge.replace(ae,ue),ce},getRegex:function(){return new RegExp(ge,de)}};return ce}var S=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(ge,de,ce){if(ge){var re;try{re=decodeURIComponent(n(ce)).replace(S,"").toLowerCase()}catch(ae){return null}if(re.indexOf("javascript:")===0||re.indexOf("vbscript:")===0||re.indexOf("data:")===0)return null}de&&!x.test(ce)&&(ce=c(de,ce));try{ce=encodeURI(ce).replace(/%25/g,"%")}catch(ae){return null}return ce}var C={},b=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,p=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(ge,de){C[" "+ge]||(b.test(ge)?C[" "+ge]=ge+"/":C[" "+ge]=P(ge,"/",!0)),ge=C[" "+ge];var ce=ge.indexOf(":")===-1;return de.substring(0,2)==="//"?ce?de:ge.replace(v,"$1")+de:de.charAt(0)==="/"?ce?de:ge.replace(p,"$1")+de:ge+de}var E={exec:function(){}};function y(ge){for(var de=1,ce,re;de=0&&be[Xe]==="\\";)Ie=!Ie;return Ie?"|":" |"}),re=ce.split(/ \|/),ae=0;if(re.length>de)re.splice(de);else for(;re.length=re.length?ae.slice(re.length):ae}).join(`
`)}var pe=function(){function ge(ce){this.options=ce||B}var de=ge.prototype;return de.space=function(re){var ae=this.rules.block.newline.exec(re);if(ae)return ae[0].length>1?{type:"space",raw:ae[0]}:{raw:`
`}},de.code=function(re,ae){var ue=this.rules.block.code.exec(re);if(ue){var fe=ae[ae.length-1];if(fe&&fe.type==="paragraph")return{raw:ue[0],text:ue[0].trimRight()};var be=ue[0].replace(/^ {4}/gm,"");return{type:"code",raw:ue[0],codeBlockStyle:"indented",text:this.options.pedantic?be:R(be,`
`)}}},de.fences=function(re){var ae=this.rules.block.fences.exec(re);if(ae){var ue=ae[0],fe=_e(ue,ae[3]||"");return{type:"code",raw:ue,lang:ae[2]?ae[2].trim():ae[2],text:fe}}},de.heading=function(re){var ae=this.rules.block.heading.exec(re);if(ae)return{type:"heading",raw:ae[0],depth:ae[1].length,text:ae[2]}},de.nptable=function(re){var ae=this.rules.block.nptable.exec(re);if(ae){var ue={type:"table",header:G(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[],raw:ae[0]};if(ue.header.length===ue.align.length){var fe=ue.align.length,be;for(be=0;be ?/gm,"");return{type:"blockquote",raw:ae[0],text:ue}}},de.list=function(re){var ae=this.rules.block.list.exec(re);if(ae){for(var ue=ae[0],fe=ae[2],be=fe.length>1,Ie=fe[fe.length-1]===")",Xe={type:"list",raw:ue,ordered:be,start:be?+fe.slice(0,-1):"",loose:!1,items:[]},ut=ae[0].match(this.rules.block.item),bt=!1,ft,at,Be,We,Me,se,ve,Ke=ut.length,Pe=0;Pe1||this.options.smartLists&&Be!==fe)&&(We=ut.slice(Pe+1).join(`
`),Xe.raw=Xe.raw.substring(0,Xe.raw.length-We.length),Pe=Ke-1)),Me=bt||/\n\n(?!\s*$)/.test(ft),Pe!==Ke-1&&(bt=ft.charAt(ft.length-1)===`
`,Me||(Me=bt)),Me&&(Xe.loose=!0),se=/^\[[ xX]\] /.test(ft),ve=void 0,se&&(ve=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Xe.items.push({type:"list_item",raw:ue,task:se,checked:ve,loose:Me,text:ft});return Xe}},de.html=function(re){var ae=this.rules.block.html.exec(re);if(ae)return{type:this.options.sanitize?"paragraph":"html",raw:ae[0],pre:!this.options.sanitizer&&(ae[1]==="pre"||ae[1]==="script"||ae[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):Q(ae[0]):ae[0]}},de.def=function(re){var ae=this.rules.block.def.exec(re);if(ae){ae[3]&&(ae[3]=ae[3].substring(1,ae[3].length-1));var ue=ae[1].toLowerCase().replace(/\s+/g," ");return{tag:ue,raw:ae[0],href:ae[2],title:ae[3]}}},de.table=function(re){var ae=this.rules.block.table.exec(re);if(ae){var ue={type:"table",header:G(ae[1].replace(/^ *| *\| *$/g,"")),align:ae[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ae[3]?ae[3].replace(/\n$/,"").split(`
`):[]};if(ue.header.length===ue.align.length){ue.raw=ae[0];var fe=ue.align.length,be;for(be=0;be/i.test(fe[0])&&(ae=!1),!ue&&/^<(pre|code|kbd|script)(\s|>)/i.test(fe[0])?ue=!0:ue&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(fe[0])&&(ue=!1),{type:this.options.sanitize?"text":"html",raw:fe[0],inLink:ae,inRawBlock:ue,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):Q(fe[0]):fe[0]}},de.link=function(re){var ae=this.rules.inline.link.exec(re);if(ae){var ue=ne(ae[2],"()");if(ue>-1){var fe=ae[0].indexOf("!")===0?5:4,be=fe+ae[1].length+ue;ae[2]=ae[2].substring(0,ue),ae[0]=ae[0].substring(0,be).trim(),ae[3]=""}var Ie=ae[2],Xe="";if(this.options.pedantic){var ut=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ie);ut?(Ie=ut[1],Xe=ut[3]):Xe=""}else Xe=ae[3]?ae[3].slice(1,-1):"";Ie=Ie.trim().replace(/^<([\s\S]*)>$/,"$1");var bt=le(ae,{href:Ie&&Ie.replace(this.rules.inline._escapes,"$1"),title:Xe&&Xe.replace(this.rules.inline._escapes,"$1")},ae[0]);return bt}},de.reflink=function(re,ae){var ue;if((ue=this.rules.inline.reflink.exec(re))||(ue=this.rules.inline.nolink.exec(re))){var fe=(ue[2]||ue[1]).replace(/\s+/g," ");if(fe=ae[fe.toLowerCase()],!fe||!fe.href){var be=ue[0].charAt(0);return{type:"text",raw:be,text:be}}var Ie=le(ue,fe,ue[0]);return Ie}},de.strong=function(re,ae,ue){ue===void 0&&(ue="");var fe=this.rules.inline.strong.start.exec(re);if(fe&&(!fe[1]||fe[1]&&(ue===""||this.rules.inline.punctuation.exec(ue)))){ae=ae.slice(-1*re.length);var be=fe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var Ie;(fe=be.exec(ae))!=null;)if(Ie=this.rules.inline.strong.middle.exec(ae.slice(0,fe.index+3)),Ie)return{type:"strong",raw:re.slice(0,Ie[0].length),text:re.slice(2,Ie[0].length-2)}}},de.em=function(re,ae,ue){ue===void 0&&(ue="");var fe=this.rules.inline.em.start.exec(re);if(fe&&(!fe[1]||fe[1]&&(ue===""||this.rules.inline.punctuation.exec(ue)))){ae=ae.slice(-1*re.length);var be=fe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var Ie;(fe=be.exec(ae))!=null;)if(Ie=this.rules.inline.em.middle.exec(ae.slice(0,fe.index+2)),Ie)return{type:"em",raw:re.slice(0,Ie[0].length),text:re.slice(1,Ie[0].length-1)}}},de.codespan=function(re){var ae=this.rules.inline.code.exec(re);if(ae){var ue=ae[2].replace(/\n/g," "),fe=/[^ ]/.test(ue),be=ue.startsWith(" ")&&ue.endsWith(" ");return fe&&be&&(ue=ue.substring(1,ue.length-1)),ue=Q(ue,!0),{type:"codespan",raw:ae[0],text:ue}}},de.br=function(re){var ae=this.rules.inline.br.exec(re);if(ae)return{type:"br",raw:ae[0]}},de.del=function(re){var ae=this.rules.inline.del.exec(re);if(ae)return{type:"del",raw:ae[0],text:ae[1]}},de.autolink=function(re,ae){var ue=this.rules.inline.autolink.exec(re);if(ue){var fe,be;return ue[2]==="@"?(fe=Q(this.options.mangle?ae(ue[1]):ue[1]),be="mailto:"+fe):(fe=Q(ue[1]),be=fe),{type:"link",raw:ue[0],text:fe,href:be,tokens:[{type:"text",raw:fe,text:fe}]}}},de.url=function(re,ae){var ue;if(ue=this.rules.inline.url.exec(re)){var fe,be;if(ue[2]==="@")fe=Q(this.options.mangle?ae(ue[0]):ue[0]),be="mailto:"+fe;else{var Ie;do Ie=ue[0],ue[0]=this.rules.inline._backpedal.exec(ue[0])[0];while(Ie!==ue[0]);fe=Q(ue[0]),ue[1]==="www."?be="http://"+fe:be=fe}return{type:"link",raw:ue[0],text:fe,href:be,tokens:[{type:"text",raw:fe,text:fe}]}}},de.inlineText=function(re,ae,ue){var fe=this.rules.inline.text.exec(re);if(fe){var be;return ae?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):Q(fe[0]):fe[0]:be=Q(this.options.smartypants?ue(fe[0]):fe[0]),{type:"text",raw:fe[0],text:be}}},ge}(),Ee=$.noopTest,Oe=$.edit,we=$.merge,he={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:Ee,table:Ee,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};he._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,he._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,he.def=Oe(he.def).replace("label",he._label).replace("title",he._title).getRegex(),he.bullet=/(?:[*+-]|\d{1,9}[.)])/,he.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,he.item=Oe(he.item,"gm").replace(/bull/g,he.bullet).getRegex(),he.list=Oe(he.list).replace(/bull/g,he.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+he.def.source+")").getRegex(),he._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",he._comment=//,he.html=Oe(he.html,"i").replace("comment",he._comment).replace("tag",he._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he.paragraph=Oe(he._paragraph).replace("hr",he.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",he._tag).getRegex(),he.blockquote=Oe(he.blockquote).replace("paragraph",he.paragraph).getRegex(),he.normal=we({},he),he.gfm=we({},he.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*|$)"}),he.gfm.nptable=Oe(he.gfm.nptable).replace("hr",he.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",he._tag).getRegex(),he.gfm.table=Oe(he.gfm.table).replace("hr",he.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",he._tag).getRegex(),he.pedantic=we({},he.normal,{html:Oe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",he._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:Ee,paragraph:Oe(he.normal._paragraph).replace("hr",he.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var oe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ee,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:Ee,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",oe.punctuation=Oe(oe.punctuation).replace(/punctuation/g,oe._punctuation).getRegex(),oe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",oe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",oe.em.start=Oe(oe.em.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.middle=Oe(oe.em.middle).replace(/punctuation/g,oe._punctuation).replace(/overlapSkip/g,oe._overlapSkip).getRegex(),oe.em.endAst=Oe(oe.em.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.em.endUnd=Oe(oe.em.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.start=Oe(oe.strong.start).replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.middle=Oe(oe.strong.middle).replace(/punctuation/g,oe._punctuation).replace(/blockSkip/g,oe._blockSkip).getRegex(),oe.strong.endAst=Oe(oe.strong.endAst,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.strong.endUnd=Oe(oe.strong.endUnd,"g").replace(/punctuation/g,oe._punctuation).getRegex(),oe.blockSkip=Oe(oe._blockSkip,"g").getRegex(),oe.overlapSkip=Oe(oe._overlapSkip,"g").getRegex(),oe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,oe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,oe._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])?)+(?![-_])/,oe.autolink=Oe(oe.autolink).replace("scheme",oe._scheme).replace("email",oe._email).getRegex(),oe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,oe.tag=Oe(oe.tag).replace("comment",he._comment).replace("attribute",oe._attribute).getRegex(),oe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,oe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,oe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,oe.link=Oe(oe.link).replace("label",oe._label).replace("href",oe._href).replace("title",oe._title).getRegex(),oe.reflink=Oe(oe.reflink).replace("label",oe._label).getRegex(),oe.reflinkSearch=Oe(oe.reflinkSearch,"g").replace("reflink",oe.reflink).replace("nolink",oe.nolink).getRegex(),oe.normal=we({},oe),oe.pedantic=we({},oe.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:Oe(/^!?\[(label)\]\((.*?)\)/).replace("label",oe._label).getRegex(),reflink:Oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",oe._label).getRegex()}),oe.gfm=we({},oe.normal,{escape:Oe(oe.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&&(re="x"+re.toString(16)),de+=""+re+";";return de}var $e=function(){function ge(ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=ce||Ye,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var re={block:nt.normal,inline:qe.normal};this.options.pedantic?(re.block=nt.pedantic,re.inline=qe.pedantic):this.options.gfm&&(re.block=nt.gfm,this.options.breaks?re.inline=qe.breaks:re.inline=qe.gfm),this.tokenizer.rules=re}ge.lex=function(re,ae){var ue=new ge(ae);return ue.lex(re)};var de=ge.prototype;return de.lex=function(re){return re=re.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(re,this.tokens,!0),this.inline(this.tokens),this.tokens},de.blockTokens=function(re,ae,ue){ae===void 0&&(ae=[]),ue===void 0&&(ue=!0),re=re.replace(/^ +$/gm,"");for(var fe,be,Ie,Xe;re;){if(fe=this.tokenizer.space(re)){re=re.substring(fe.raw.length),fe.type&&ae.push(fe);continue}if(fe=this.tokenizer.code(re,ae)){re=re.substring(fe.raw.length),fe.type?ae.push(fe):(Xe=ae[ae.length-1],Xe.raw+=`
`+fe.raw,Xe.text+=`
`+fe.text);continue}if(fe=this.tokenizer.fences(re)){re=re.substring(fe.raw.length),ae.push(fe);continue}if(fe=this.tokenizer.heading(re)){re=re.substring(fe.raw.length),ae.push(fe);continue}if(fe=this.tokenizer.nptable(re)){re=re.substring(fe.raw.length),ae.push(fe);continue}if(fe=this.tokenizer.hr(re)){re=re.substring(fe.raw.length),ae.push(fe);continue}if(fe=this.tokenizer.blockquote(re)){re=re.substring(fe.raw.length),fe.tokens=this.blockTokens(fe.text,[],ue),ae.push(fe);continue}if(fe=this.tokenizer.list(re)){for(re=re.substring(fe.raw.length),Ie=fe.items.length,be=0;be0)for(;(ut=this.tokenizer.rules.inline.reflinkSearch.exec(Xe))!=null;)bt.includes(ut[0].slice(ut[0].lastIndexOf("[")+1,-1))&&(Xe=Xe.slice(0,ut.index)+"["+"a".repeat(ut[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(ut=this.tokenizer.rules.inline.blockSkip.exec(Xe))!=null;)Xe=Xe.slice(0,ut.index)+"["+"a".repeat(ut[0].length-2)+"]"+Xe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;re;){if(Ie=this.tokenizer.escape(re)){re=re.substring(Ie.raw.length),ae.push(Ie);continue}if(Ie=this.tokenizer.tag(re,ue,fe)){re=re.substring(Ie.raw.length),ue=Ie.inLink,fe=Ie.inRawBlock,ae.push(Ie);continue}if(Ie=this.tokenizer.link(re)){re=re.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,fe)),ae.push(Ie);continue}if(Ie=this.tokenizer.reflink(re,this.tokens.links)){re=re.substring(Ie.raw.length),Ie.type==="link"&&(Ie.tokens=this.inlineTokens(Ie.text,[],!0,fe)),ae.push(Ie);continue}if(Ie=this.tokenizer.strong(re,Xe,be)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ue,fe),ae.push(Ie);continue}if(Ie=this.tokenizer.em(re,Xe,be)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ue,fe),ae.push(Ie);continue}if(Ie=this.tokenizer.codespan(re)){re=re.substring(Ie.raw.length),ae.push(Ie);continue}if(Ie=this.tokenizer.br(re)){re=re.substring(Ie.raw.length),ae.push(Ie);continue}if(Ie=this.tokenizer.del(re)){re=re.substring(Ie.raw.length),Ie.tokens=this.inlineTokens(Ie.text,[],ue,fe),ae.push(Ie);continue}if(Ie=this.tokenizer.autolink(re,He)){re=re.substring(Ie.raw.length),ae.push(Ie);continue}if(!ue&&(Ie=this.tokenizer.url(re,He))){re=re.substring(Ie.raw.length),ae.push(Ie);continue}if(Ie=this.tokenizer.inlineText(re,fe,it)){re=re.substring(Ie.raw.length),be=Ie.raw.slice(-1),ae.push(Ie);continue}if(re){var ft="Infinite loop on byte: "+re.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ae},V(ge,null,[{key:"rules",get:function(){return{block:nt,inline:qe}}}]),ge}(),Qe=H.defaults,gt=$.cleanUrl,et=$.escape,tt=function(){function ge(ce){this.options=ce||Qe}var de=ge.prototype;return de.code=function(re,ae,ue){var fe=(ae||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(re,fe);be!=null&&be!==re&&(ue=!0,re=be)}return fe?''+(ue?re:et(re,!0))+`
`:""+(ue?re:et(re,!0))+`
`},de.blockquote=function(re){return`
`+re+`
`},de.html=function(re){return re},de.heading=function(re,ae,ue,fe){return this.options.headerIds?"
`:""+re+"
`},de.hr=function(){return this.options.xhtml?`
`:`
`},de.list=function(re,ae,ue){var fe=ae?"ol":"ul",be=ae&&ue!==1?' start="'+ue+'"':"";return"<"+fe+be+`>
`+re+""+fe+`>
`},de.listitem=function(re){return""+re+`
`},de.checkbox=function(re){return" "},de.paragraph=function(re){return""+re+`
`},de.table=function(re,ae){return ae&&(ae=""+ae+""),`
`},de.tablerow=function(re){return`
`+re+`
`},de.tablecell=function(re,ae){var ue=ae.header?"th":"td",fe=ae.align?"<"+ue+' align="'+ae.align+'">':"<"+ue+">";return fe+re+""+ue+`>
`},de.strong=function(re){return""+re+""},de.em=function(re){return""+re+""},de.codespan=function(re){return""+re+""},de.br=function(){return this.options.xhtml?"
":"
"},de.del=function(re){return""+re+""},de.link=function(re,ae,ue){if(re=gt(this.options.sanitize,this.options.baseUrl,re),re===null)return ue;var fe='"+ue+"",fe},de.image=function(re,ae,ue){if(re=gt(this.options.sanitize,this.options.baseUrl,re),re===null)return ue;var fe='
":">",fe},de.text=function(re){return re},ge}(),Je=function(){function ge(){}var de=ge.prototype;return de.strong=function(re){return re},de.em=function(re){return re},de.codespan=function(re){return re},de.del=function(re){return re},de.html=function(re){return re},de.text=function(re){return re},de.link=function(re,ae,ue){return""+ue},de.image=function(re,ae,ue){return""+ue},de.br=function(){return""},ge}(),vt=function(){function ge(){this.seen={}}var de=ge.prototype;return de.slug=function(re){var ae=re.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ae)){var ue=ae;do this.seen[ue]++,ae=ue+"-"+this.seen[ue];while(this.seen.hasOwnProperty(ae))}return this.seen[ae]=0,ae},ge}(),wt=H.defaults,Et=$.unescape,xt=function(){function ge(ce){this.options=ce||wt,this.options.renderer=this.options.renderer||new tt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Je,this.slugger=new vt}ge.parse=function(re,ae){var ue=new ge(ae);return ue.parse(re)};var de=ge.prototype;return de.parse=function(re,ae){ae===void 0&&(ae=!0);var ue="",fe,be,Ie,Xe,ut,bt,ft,at,Be,We,Me,se,ve,Ke,Pe,st,dt,Te,ke=re.length;for(fe=0;fe0&&Pe.tokens[0].type==="text"?(Pe.tokens[0].text=Te+" "+Pe.tokens[0].text,Pe.tokens[0].tokens&&Pe.tokens[0].tokens.length>0&&Pe.tokens[0].tokens[0].type==="text"&&(Pe.tokens[0].tokens[0].text=Te+" "+Pe.tokens[0].tokens[0].text)):Pe.tokens.unshift({type:"text",text:Te}):Ke+=Te),Ke+=this.parse(Pe.tokens,ve),Be+=this.renderer.listitem(Ke,dt,st);ue+=this.renderer.list(Be,Me,se);continue}case"html":{ue+=this.renderer.html(We.text);continue}case"paragraph":{ue+=this.renderer.paragraph(this.parseInline(We.tokens));continue}case"text":{for(Be=We.tokens?this.parseInline(We.tokens):We.text;fe+1An error occurred:
"+Ae(Ie.message+"",!0)+"
";throw Ie}}Re.options=Re.setOptions=function(ge){return kt(Re.defaults,ge),Ge(Re.defaults),Re},Re.getDefaults=Ce,Re.defaults=ze,Re.use=function(ge){var de=kt({},ge);if(ge.renderer&&function(){var re=Re.defaults.renderer||new tt,ae=function(be){var Ie=re[be];re[be]=function(){for(var Xe=arguments.length,ut=new Array(Xe),bt=0;bt=0;u--){if(!M(f[u]))continue;var d=f[u].split("="),s=unescape(d[0]),l=unescape(d[1]);g(l,s)}}function H(g,f){if(!g)return;z.cookie=escape(g)+"="+escape(f)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function F(g){if(!g||!I(g))return;z.cookie=escape(g)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function D(){L(function(g,f){F(f)})}function I(g){return new RegExp("(?:^|;\\s*)"+escape(g).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(z.cookie)}},EHPI:function(Fe,Se,W){"use strict";var q=W("bbsP"),V=W("/wGt"),M=W("tJVT"),z=W("k1fw"),U=W("q1tI"),L=W.n(U),H=W("ZW9T"),F=W("ZD9Y"),D=W("M8RZ"),I=W("bCnd"),g=W("fcyK"),f=W.n(g),u={theme:Object(I.a)("cmCodeMode","vs-dark"),fontSize:Object(I.a)("cmFontSize",14),showEditorSetting:!1,tabToSpace:Object(I.a)("cmTabToSpace",!0)},d;(function(r){r[r.set_font_size=0]="set_font_size",r[r.set_theme=1]="set_theme",r[r.on_tab_to_space=2]="on_tab_to_space",r[r.set_show_editor_setting=3]="set_show_editor_setting"})(d||(d={}));function s(r,a){switch(a.type){case d.set_show_editor_setting:return Object(z.a)(Object(z.a)({},r),{},{showEditorSetting:a.payload});case d.set_theme:return Object(z.a)(Object(z.a)({},r),{},{theme:a.payload});case d.set_font_size:return Object(z.a)(Object(z.a)({},r),{},{fontSize:a.payload});case d.on_tab_to_space:return Object(z.a)(Object(z.a)({},r),{},{tabToSpace:a.payload});default:throw new Error}}Se.a=function(r){var a=r.isLoading,n=r.value,h=r.onChange,O=r.language,S=r.ActionBarRender,x=S===void 0?function($){return L.a.createElement(l,{onShowCodeSetting:$})}:S,A=Object(U.useReducer)(s,u),C=Object(M.a)(A,2),b=C[0],v=C[1],p=b.theme,c=b.fontSize,E=b.showEditorSetting,y=b.tabToSpace,_={onFontSizeChange:function(B){v({type:d.set_font_size,payload:B}),Object(I.b)("cmFontSize",B)},tabToSpace:y,cmFontSize:c,className:"oj",cmCodeMode:p,onTabToSpace:function(B){v({type:d.on_tab_to_space,payload:B}),Object(I.b)("cmTabToSpace",B)},onCodeModeChange:function(B){v({type:d.set_theme,payload:B}),Object(I.b)("cmCodeMode",B)}};function P(){v({type:d.set_show_editor_setting,payload:!1})}function N(){v({type:d.set_show_editor_setting,payload:!0})}var K={value:n,language:O,onChange:h,theme:p,height:"calc(100% - 56px)",options:{fontSize:c,insertSpaces:y}};return L.a.createElement(U.Fragment,null,L.a.createElement("div",{className:"code-panel-container"},x(N),!a&&L.a.createElement(H.b,K)),L.a.createElement(D.a,null,L.a.createElement(V.a,{className:"oj",title:null,placement:"right",closable:!1,visible:E,onClose:P},L.a.createElement(F.a,_))))};function l(r){var a=r.onShowCodeSetting;return L.a.createElement("div",{className:"action-bar"},L.a.createElement("span",null,"\u5B66\u5458\u521D\u59CB\u4EE3\u7801\u6587\u4EF6"),L.a.createElement("a",{onClick:a},L.a.createElement("i",{className:"iconfont icon-shezhi"})))}},ELLl:function(Fe,Se,W){(function(q){q(W("VrN/"))})(function(q){var V={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},M=q.Pos;q.defineOption("autoCloseBrackets",!1,function(s,l,r){r&&r!=q.Init&&(s.removeKeyMap(U),s.state.closeBrackets=null),l&&(L(z(l,"pairs")),s.state.closeBrackets=l,s.addKeyMap(U))});function z(s,l){return l=="pairs"&&typeof s=="string"?s:typeof s=="object"&&s[l]!=null?s[l]:V[l]}var U={Backspace:D,Enter:I};function L(s){for(var l=0;l=0;n--){var O=a[n].head;s.replaceRange("",M(O.line,O.ch-1),M(O.line,O.ch+1),"+delete")}}function I(s){var l=F(s),r=l&&z(l,"explode");if(!r||s.getOption("disableInput"))return q.Pass;for(var a=s.listSelections(),n=0;n0;return{anchor:new M(s.anchor.line,s.anchor.ch+(l?-1:1)),head:new M(s.head.line,s.head.ch+(l?1:-1))}}function f(s,l){var r=F(s);if(!r||s.getOption("disableInput"))return q.Pass;var a=z(r,"pairs"),n=a.indexOf(l);if(n==-1)return q.Pass;for(var h=z(r,"closeBefore"),O=z(r,"triples"),S=a.charAt(n+1)==l,x=s.listSelections(),A=n%2==0,C,b=0;b=0&&s.getRange(p,M(p.line,p.ch+3))==l+l+l?c="skipThree":c="skip";else if(S&&p.ch>1&&O.indexOf(l)>=0&&s.getRange(M(p.line,p.ch-2),p)==l+l){if(p.ch>2&&/\bstring/.test(s.getTokenTypeAt(M(p.line,p.ch-2))))return q.Pass;c="addFour"}else if(S){var y=p.ch==0?" ":s.getRange(M(p.line,p.ch-1),p);if(!q.isWordChar(E)&&y!=l&&!q.isWordChar(y))c="both";else return q.Pass}else if(A&&(E.length===0||/\s/.test(E)||h.indexOf(E)>-1))c="both";else return q.Pass;if(!C)C=c;else if(C!=c)return q.Pass}var _=n%2?a.charAt(n-1):l,P=n%2?l:a.charAt(n+1);s.operation(function(){if(C=="skip")s.execCommand("goCharRight");else if(C=="skipThree")for(var N=0;N<3;N++)s.execCommand("goCharRight");else if(C=="surround"){for(var K=s.getSelections(),N=0;N>>6)+D(128|P&63):D(224|P>>>12&15)+D(128|P>>>6&63)+D(128|P&63)}else{var P=65536+(_.charCodeAt(0)-55296)*1024+(_.charCodeAt(1)-56320);return D(240|P>>>18&7)+D(128|P>>>12&63)+D(128|P>>>6&63)+D(128|P&63)}},g=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,f=function(_){return _.replace(g,I)},u=function(_){var P=[0,2,1][_.length%3],N=_.charCodeAt(0)<<16|(_.length>1?_.charCodeAt(1):0)<<8|(_.length>2?_.charCodeAt(2):0),K=[H.charAt(N>>>18),H.charAt(N>>>12&63),P>=2?"=":H.charAt(N>>>6&63),P>=1?"=":H.charAt(N&63)];return K.join("")},d=z.btoa&&typeof z.btoa=="function"?function(_){return z.btoa(_)}:function(_){if(_.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return _.replace(/[\s\S]{1,3}/g,u)},s=function(_){return d(f(String(_)))},l=function(_){return _.replace(/[+\/]/g,function(P){return P=="+"?"-":"_"}).replace(/=/g,"")},r=function(_,P){return P?l(s(_)):s(_)},a=function(_){return r(_,!0)},n;z.Uint8Array&&(n=function(_,P){for(var N="",K=0,$=_.length;K<$;K+=3){var B=_[K],R=_[K+1],G=_[K+2],Q=B<<16|R<<8|G;N+=H.charAt(Q>>>18)+H.charAt(Q>>>12&63)+(typeof R!="undefined"?H.charAt(Q>>>6&63):"=")+(typeof G!="undefined"?H.charAt(Q&63):"=")}return P?l(N):N});var h=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,O=function(_){switch(_.length){case 4:var P=(7&_.charCodeAt(0))<<18|(63&_.charCodeAt(1))<<12|(63&_.charCodeAt(2))<<6|63&_.charCodeAt(3),N=P-65536;return D((N>>>10)+55296)+D((N&1023)+56320);case 3:return D((15&_.charCodeAt(0))<<12|(63&_.charCodeAt(1))<<6|63&_.charCodeAt(2));default:return D((31&_.charCodeAt(0))<<6|63&_.charCodeAt(1))}},S=function(_){return _.replace(h,O)},x=function(_){var P=_.length,N=P%4,K=(P>0?F[_.charAt(0)]<<18:0)|(P>1?F[_.charAt(1)]<<12:0)|(P>2?F[_.charAt(2)]<<6:0)|(P>3?F[_.charAt(3)]:0),$=[D(K>>>16),D(K>>>8&255),D(K&255)];return $.length-=[0,0,2,1][N],$.join("")},A=z.atob&&typeof z.atob=="function"?function(_){return z.atob(_)}:function(_){return _.replace(/\S{1,4}/g,x)},C=function(_){return A(String(_).replace(/[^A-Za-z0-9\+\/]/g,""))},b=function(_){return S(A(_))},v=function(_){return String(_).replace(/[-_]/g,function(P){return P=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},p=function(_){return b(v(_))},c;z.Uint8Array&&(c=function(_){return Uint8Array.from(C(v(_)),function(P){return P.charCodeAt(0)})});var E=function(){var _=z.Base64;return z.Base64=U,_};if(z.Base64={VERSION:L,atob:C,btoa:d,fromBase64:p,toBase64:r,utob:f,encode:r,encodeURI:a,btou:S,decode:p,noConflict:E,fromUint8Array:n,toUint8Array:c},typeof Object.defineProperty=="function"){var y=function(_){return{value:_,enumerable:!1,writable:!0,configurable:!0}};z.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",y(function(){return p(this)})),Object.defineProperty(String.prototype,"toBase64",y(function(_){return r(this,_)})),Object.defineProperty(String.prototype,"toBase64URI",y(function(){return r(this,!0)}))}}return z.Meteor&&(Base64=z.Base64),Fe.exports?Fe.exports.Base64=z.Base64:!(V=[],M=function(){return z.Base64}.apply(Se,V),M!==void 0&&(Fe.exports=M)),{Base64:z.Base64}})}).call(this,W("IyRk"))},JB8y:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return q});var q;(function(V){V[V.NOMATCH=-1]="NOMATCH",V[V.OK=0]="OK",V[V.TIMEOUT=2]="TIMEOUT",V[V.PODFAILURE=3]="PODFAILURE",V[V.COMPILEFAILURE=4]="COMPILEFAILURE",V[V.EXECUTEFAILURE=5]="EXECUTEFAILURE"})(q||(q={}))},JPnl:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return v}),W.d(Se,"c",function(){return E});var q=W("+L6B"),V=W("2/Rp"),M=W("tJVT"),z=W("9og8"),U=W("k1fw"),L=W("jrin"),H=W("5NDa"),F=W("5rEg"),D=W("WmNS"),I=W.n(D),g=W("q1tI"),f=W.n(g),u=W("8Skl"),d=W("y3Kf"),s=W("JB8y"),l=W("J66h"),r=W.n(l),a=W("a4uL"),n=W.n(a),h=W("IxHN"),O=W("9Bee"),S=W("1vsH"),x=W("ErOA"),A,C=F.a.TextArea,b={visible:!1,tabIndex:"0"},v=(A={},Object(L.a)(A,s.a.NOMATCH,"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D"),Object(L.a)(A,s.a.OK,"\u8C03\u8BD5\u901A\u8FC7"),Object(L.a)(A,2,"\u8C03\u8BD5\u8D85\u65F6"),Object(L.a)(A,3,"\u8C03\u8BD5pod\u5931\u8D25"),Object(L.a)(A,4,"\u7F16\u8BD1\u5931\u8D25"),Object(L.a)(A,5,"\u6267\u884C\u5931\u8D25"),A),p;(function(_){_[_.SET_VISIBLE=0]="SET_VISIBLE",_[_.SET_TABINDEX=1]="SET_TABINDEX"})(p||(p={}));function c(_,P){switch(P.type){case p.SET_VISIBLE:return Object(U.a)(Object(U.a)({},_),{},{visible:P.payload});case p.SET_TABINDEX:return Object(U.a)(Object(U.a)({},_),{},{tabIndex:P.payload});default:throw new Error}}function E(_){var P=_.status,N=_.error_msg,K=_.output,$=_.input,B=_.expected_output,R=_.is_file,G=_.input_file_url,Q=_.output_file_url,ne=_.expected_output_file_url,le=_.setMonacoValue,_e=_.setData,pe=null,Ee={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(P){case s.a.NOMATCH:pe=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!R&&f.a.createElement(O.a,{value:$,style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(z.a)(I.a.mark(function Oe(){var we;return I.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,fetch(G,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return we=oe.sent,oe.t0=le,oe.next=6,we.text();case 6:oe.t1=oe.sent,(0,oe.t0)(oe.t1),setTimeout(function(){_e(G)},200);case 9:case"end":return oe.stop()}},Oe)}))},$)),f.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!R&&f.a.createElement(O.a,{value:K&&l.Base64.decode(K)||"",style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(z.a)(I.a.mark(function Oe(){var we;return I.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,Object(x.a)(Q,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:we=oe.sent,le(we),setTimeout(function(){_e(Q)},200);case 5:case"end":return oe.stop()}},Oe)}))},K)),f.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!R&&f.a.createElement(O.a,{value:B&&l.Base64.decode(B)||"",style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(z.a)(I.a.mark(function Oe(){var we;return I.a.wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:return oe.next=2,fetch(ne,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return we=oe.sent,oe.t0=le,oe.next=6,we.text();case 6:oe.t1=oe.sent,(0,oe.t0)(oe.t1),setTimeout(function(){_e(ne)},200);case 9:case"end":return oe.stop()}},Oe)}))},B)));break;case s.a.EXECUTEFAILURE:pe=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!R&&f.a.createElement(O.a,{value:$,style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{onClick:function(){return Object(S.y)(G,$)}},$)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},l.Base64.decode(N)));break;case s.a.COMPILEFAILURE:pe=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!R&&f.a.createElement(O.a,{value:$,style:Ee}),R&&f.a.createElement("div",{style:Ee},f.a.createElement("a",{onClick:function(){return Object(S.y)(G,$)}},$)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},l.Base64.decode(N)));break;case s.a.PODFAILURE:pe=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:pe=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",pe," ")}function y(_){var P=_.status,N=_.error_msg,K=_.execute_time,$=_.output,B=_.input,R=_.expected_output,G=_.is_file,Q=_.input_file_url,ne=_.output_file_url,le=_.expected_output_file_url,_e=null;switch(P){case s.a.OK:_e=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",K),f.a.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),f.a.createElement("pre",null,l.Base64.decode($)));break;case s.a.NOMATCH:_e=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u8F93\u5165\uFF1A",f.a.createElement("pre",null,B)),f.a.createElement("p",null,"\u8F93\u51FA\uFF1A",$&&l.Base64.decode($)),f.a.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",R&&l.Base64.decode(R)));break;case s.a.EXECUTEFAILURE:_e=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,B)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},l.Base64.decode(N)));break;case s.a.COMPILEFAILURE:_e=f.a.createElement(f.a.Fragment,null,f.a.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",f.a.createElement("pre",null,B)),f.a.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),f.a.createElement("pre",{className:"error"},l.Base64.decode(N)));break;case s.a.PODFAILURE:_e=f.a.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case s.a.TIMEOUT:_e=f.a.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return f.a.createElement(f.a.Fragment,null," ",_e," ")}Se.b=function(_){var P=_.input,N=_.debuging,K=_.submitting,$=_.executingMessage,B=_.debugResult,R=_.onChangeInput,G=_.onDebugCode,Q=_.onSubmitCode,ne=_.hack,le=_.user,_e=Object(g.useReducer)(c,b),pe=Object(M.a)(_e,2),Ee=pe[0],Oe=pe[1],we=Ee.visible,he=Ee.tabIndex;function oe(it){var He=it.target.id;Oe({type:p.SET_TABINDEX,payload:He})}function Le(){Oe({type:p.SET_VISIBLE,payload:!we})}var Ye=Object(g.useMemo)(function(){if(B){var it=B.status;return f.a.createElement(f.a.Fragment,null,y(B))}return null},[B]);function nt(){Oe({type:p.SET_VISIBLE,payload:!0}),Oe({type:p.SET_TABINDEX,payload:"1"}),G()}var qe=function(){var it=Object(z.a)(I.a.mark(function He($e){var Qe;return I.a.wrap(function(et){for(;;)switch(et.prev=et.next){case 0:return et.next=2,Object(x.a)("/api/problems/".concat($e,"/start.json"),{method:"get",params:{hack_user_id:le==null?void 0:le.user_id}});case 2:Qe=et.sent,Qe&&(window.location.href="/myproblems/".concat(Qe==null?void 0:Qe.identifier,"?type=1"));case 4:case"end":return et.stop()}},He)}));return function($e){return it.apply(this,arguments)}}();return f.a.createElement("div",{className:"test-case-panel"},f.a.createElement("div",{className:"test-case-panel-body ".concat(we?"active":"")},f.a.createElement("ul",{className:"s-navs"},f.a.createElement("li",null,f.a.createElement("a",{className:he==="0"?"active":"",id:"0",onClick:oe},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B")),f.a.createElement("li",null,f.a.createElement("a",{className:he==="1"?"active":"",id:"1",onClick:oe},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"))),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="0"?"":"hide")},f.a.createElement(C,{placeholder:"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D",value:P,onChange:R})),f.a.createElement("div",{className:"tab-panel-body ".concat(he==="1"?"":"hide")},N?f.a.createElement(h.a,{message:$}):B?f.a.createElement("section",{style:{height:200}}," ",Ye," "):f.a.createElement("p",{className:"tip"},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D"))),f.a.createElement("a",{className:"btn-collapse ".concat(we?"up":""),onClick:Le},we?f.a.createElement(u.a,null):f.a.createElement(d.a,null)),f.a.createElement("footer",{className:"footer"},f.a.createElement("span",null,"\u63A7\u5236\u53F0"),f.a.createElement("div",{className:"flex-container"},(ne==null?void 0:ne.is_program)&&(ne==null?void 0:ne.above_question)&&f.a.createElement(V.a,{onClick:function(){return qe(ne==null?void 0:ne.above_question)},id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),(ne==null?void 0:ne.is_program)&&(ne==null?void 0:ne.under_question)&&f.a.createElement(V.a,{onClick:function(){return qe(ne==null?void 0:ne.under_question)},id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),f.a.createElement(V.a,{className:"btn-green",type:"ghost",loading:N,onClick:nt},"\u8C03\u8BD5\u4EE3\u7801"),f.a.createElement(V.a,{type:"primary",loading:K,disabled:K,onClick:function(){Oe({type:p.SET_VISIBLE,payload:!1}),Q()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},LdHM:function(Fe,Se,W){"use strict";W.d(Se,"b",function(){return h}),W.d(Se,"a",function(){return S});var q=W("1OyB"),V=W("vuIU"),M=W("Ji7U"),z=W("LK+K"),U=W("q1tI"),L=W("rePB"),H=W("Ff2n"),F=W("ODXe"),D=W("4IlW"),I=W("bX4T"),g=W("YrtM"),f=W("TSYQ"),u=W.n(f),d=W("+nKL"),s=W("8OUc"),l=function(G,Q){var ne=G.prefixCls,le=G.id,_e=G.flattenOptions,pe=G.childrenAsData,Ee=G.values,Oe=G.searchValue,we=G.multiple,he=G.defaultActiveFirstOption,oe=G.height,Le=G.itemHeight,Ye=G.notFoundContent,nt=G.open,qe=G.menuItemSelectedIcon,it=G.virtual,He=G.onSelect,$e=G.onToggleOpen,Qe=G.onActiveValue,gt=G.onScroll,et=G.onMouseEnter,tt="".concat(ne,"-item"),Je=Object(g.a)(function(){return _e},[nt,_e],function(je,ge){return ge[0]&&je[1]!==ge[1]}),vt=U.useRef(null),wt=function(ge){ge.preventDefault()},Et=function(ge){vt.current&&vt.current.scrollTo({index:ge})},xt=function(ge){for(var de=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ce=Je.length,re=0;re1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(R).map(function(Q,ne){if(!U.isValidElement(Q)||!Q.type)return null;var le=Q.type.isSelectOptGroup,_e=Q.key,pe=Q.props,Ee=pe.children,Oe=Object(H.a)(pe,["children"]);return G||!le?C(Q):Object(x.a)(Object(x.a)({key:"__RC_SELECT_GRP__".concat(_e===null?ne:_e,"__"),label:_e},Oe),{},{options:b(Ee)})}).filter(function(Q){return Q})}var v=W("2Qr1"),p=W("qNPg"),c=W("U8pU"),E=W("Kwbf"),y=W("WKfj");function _(R){var G=R.mode,Q=R.options,ne=R.children,le=R.backfill,_e=R.allowClear,pe=R.placeholder,Ee=R.getInputElement,Oe=R.showSearch,we=R.onSearch,he=R.defaultOpen,oe=R.autoFocus,Le=R.labelInValue,Ye=R.value,nt=R.inputValue,qe=R.optionLabelProp,it=G==="multiple"||G==="tags",He=Oe!==void 0?Oe:it||G==="combobox",$e=Q||b(ne);if(Object(E.a)(G!=="tags"||$e.every(function(tt){return!tt.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var Qe=$e.some(function(tt){return tt.options?tt.options.some(function(Je){return typeof("value"in Je?Je.value:Je.key)=="number"}):typeof("value"in tt?tt.value:tt.key)=="number"});Object(E.a)(!Qe,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(G!=="combobox"||!qe,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(G==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(E.a)(G==="combobox"||!Ee,"`getInputElement` only work with `combobox` mode."),Object(E.b)(G!=="combobox"||!Ee||!_e||!pe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),we&&!He&&G!=="combobox"&&G!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!he||oe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Ye!=null){var gt=Object(y.d)(Ye);Object(E.a)(!Le||gt.every(function(tt){return Object(c.a)(tt)==="object"&&("key"in tt||"value"in tt)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!it||Array.isArray(Ye),"`value` should be array when `mode` is `multiple` or `tags`")}if(ne){var et=null;Object(A.a)(ne).some(function(tt){if(!U.isValidElement(tt)||!tt.type)return!1;var Je=tt.type;if(Je.isSelectOption)return!1;if(Je.isSelectOptGroup){var vt=Object(A.a)(tt.props.children).every(function(wt){return!U.isValidElement(wt)||!tt.type||wt.type.isSelectOption?!0:(et=wt.type,!1)});return!vt}return et=Je,!0}),et&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(et.displayName||et.name||et,"`.")),Object(E.a)(nt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var P=_,N=Object(p.a)({prefixCls:"rc-select",components:{optionList:a},convertChildrenToData:b,flattenOptions:v.d,getLabeledValue:v.e,filterOptions:v.b,isValueDisabled:v.g,findValueOption:v.c,warningProps:P,fillOptionsWithMissingValue:v.a}),K=function(R){Object(M.a)(Q,R);var G=Object(z.a)(Q);function Q(){var ne;return Object(q.a)(this,Q),ne=G.apply(this,arguments),ne.selectRef=U.createRef(),ne.focus=function(){ne.selectRef.current.focus()},ne.blur=function(){ne.selectRef.current.blur()},ne}return Object(V.a)(Q,[{key:"render",value:function(){return U.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),Q}(U.Component);K.Option=h,K.OptGroup=S;var $=K,B=Se.c=$},M8RZ:function(Fe,Se,W){"use strict";W.d(Se,"a",function(){return D});var q=W("fWQN"),V=W("mtLc"),M=W("yKVA"),z=W("879j"),U=W("q1tI"),L=W.n(U),H=W("i8i4"),F=W.n(H),D=function(I){Object(M.a)(f,I);var g=Object(z.a)(f);function f(u){var d;Object(q.a)(this,f),d=g.call(this,u);var s=window.document;return d.node=s.createElement("div"),s.body.appendChild(d.node),d}return Object(V.a)(f,[{key:"render",value:function(){var d=this.props.children;return Object(H.createPortal)(d,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),f}(L.a.Component)},MFOe:function(Fe,Se,W){(function(q){var V=L(),M=H(),z=F(),U=typeof window!="undefined"?window:q;Fe.exports={assign:V,create:M,trim:z,bind:D,slice:I,each:g,map:f,pluck:u,isList:d,isFunction:s,isObject:l,Global:U};function L(){return Object.assign?Object.assign:function(a,n,h,O){for(var S=1;S=0;l-=1){var r=F.get(l)||new Set;r.forEach(function(a){var n=a.parent,h=a.node;if(I(h)||!a.parent||s.has(a.parent.key))return;if(I(a.parent.node)){s.add(n.key);return}var O=!0,S=!1;(n.children||[]).filter(function(x){return!I(x.node)}).forEach(function(x){var A=x.key,C=g.has(A);O&&!C&&(O=!1),!S&&(C||f.has(A))&&(S=!0)}),O&&g.add(n.key),S&&f.add(n.key),s.add(n.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(V(f,g))}}function U(H,F,D,I,g){for(var f=new Set(H),u=new Set(F),d=0;d<=I;d+=1){var s=D.get(d)||new Set;s.forEach(function(n){var h=n.key,O=n.node,S=n.children,x=S===void 0?[]:S;!f.has(h)&&!u.has(h)&&!g(O)&&x.filter(function(A){return!g(A.node)}).forEach(function(A){f.delete(A.key)})})}u=new Set;for(var l=new Set,r=I;r>=0;r-=1){var a=D.get(r)||new Set;a.forEach(function(n){var h=n.parent,O=n.node;if(g(O)||!n.parent||l.has(n.parent.key))return;if(g(n.parent.node)){l.add(h.key);return}var S=!0,x=!1;(h.children||[]).filter(function(A){return!g(A.node)}).forEach(function(A){var C=A.key,b=f.has(C);S&&!b&&(S=!1),!x&&(b||u.has(C))&&(x=!0)}),S||f.delete(h.key),x&&u.add(h.key),l.add(h.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(V(u,f))}}function L(H,F,D,I){var g=[],f;I?f=I:f=M;var u=new Set(H.filter(function(r){var a=!!D[r];return a||g.push(r),a})),d=new Map,s=0;Object.keys(D).forEach(function(r){var a=D[r],n=a.level,h=d.get(n);h||(h=new Set,d.set(n,h)),h.add(a),s=Math.max(s,n)}),Object(q.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(r){return"'".concat(r,"'")}).join(", ")));var l;return F===!0?l=z(u,d,s,f):l=U(u,F.halfCheckedKeys,d,s,f),l}},OJz4:function(Fe,Se,W){"use strict";W.d(Se,"d",function(){return V}),W.d(Se,"h",function(){return M}),W.d(Se,"b",function(){return z}),W.d(Se,"f",function(){return U}),W.d(Se,"e",function(){return L}),W.d(Se,"c",function(){return H}),W.d(Se,"a",function(){return F}),W.d(Se,"g",function(){return D}),W.d(Se,"i",function(){return I}),W.d(Se,"k",function(){return g}),W.d(Se,"j",function(){return f});var q=W("ErOA");function V(u){return Object(q.c)("myproblems/".concat(u,".json"),{hidePopLogin:!0})}function M(u,d){return Object(q.f)("myproblems/".concat(u,"/code_submit.json"),d)}function z(u,d){return Object(q.c)("myproblems/".concat(u,"/code_debug.json"),d)}function U(u,d){return Object(q.c)("myproblems/".concat(u,"/submit_records.json"),d)}function L(u){return Object(q.c)("myproblems/record_detail.json",{id:u})}function H(u,d){return Object(q.c)("myproblems/".concat(u,"/result.json"),{mode:d})}function F(u,d){return Object(q.f)("myproblems/".concat(u,"/add_notes.json"),d)}function D(u){return Object(q.f)("myproblems/".concat(u,"/restore_initial_code.json"))}function I(u){return Object(q.f)("myproblems/".concat(u,"/sync_code.json"))}function g(u,d){return Object(q.f)("myproblems/".concat(u,"/update_code.json"),d)}function f(u,d){return Object(q.f)("discusses/".concat(u,"/plus.json"),d)}},OLES:function(Fe,Se,W){"use strict";var q=W("U8pU"),V=W("VTBJ"),M=W("Ff2n"),z=W("q1tI"),U=W("uciX"),L=W("7ixt"),H=function(u){var d=u.overlay,s=u.prefixCls,l=u.id,r=u.overlayInnerStyle;return z.createElement("div",{className:"".concat(s,"-inner"),id:l,role:"tooltip",style:r},typeof d=="function"?d():d)},F=H,D=function(u,d){var s=u.overlayClassName,l=u.trigger,r=l===void 0?["hover"]:l,a=u.mouseEnterDelay,n=a===void 0?0:a,h=u.mouseLeaveDelay,O=h===void 0?.1:h,S=u.overlayStyle,x=u.prefixCls,A=x===void 0?"rc-tooltip":x,C=u.children,b=u.onVisibleChange,v=u.afterVisibleChange,p=u.transitionName,c=u.animation,E=u.placement,y=E===void 0?"right":E,_=u.align,P=_===void 0?{}:_,N=u.destroyTooltipOnHide,K=N===void 0?!1:N,$=u.defaultVisible,B=u.getTooltipContainer,R=u.overlayInnerStyle,G=Object(M.a)(u,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Q=Object(z.useRef)(null);Object(z.useImperativeHandle)(d,function(){return Q.current});var ne=Object(V.a)({},G);"visible"in u&&(ne.popupVisible=u.visible);var le=function(){var we=u.arrowContent,he=we===void 0?null:we,oe=u.overlay,Le=u.id;return[z.createElement("div",{className:"".concat(A,"-arrow"),key:"arrow"},he),z.createElement(F,{key:"content",prefixCls:A,id:Le,overlay:oe,overlayInnerStyle:R})]},_e=!1,pe=!1;if(typeof K=="boolean")_e=K;else if(K&&Object(q.a)(K)==="object"){var Ee=K.keepParent;_e=Ee===!0,pe=Ee===!1}return z.createElement(U.a,Object.assign({popupClassName:s,prefixCls:A,popup:le,action:r,builtinPlacements:L.a,popupPlacement:y,ref:Q,popupAlign:P,getPopupContainer:B,onPopupVisibleChange:b,afterPopupVisibleChange:v,popupTransitionName:p,popupAnimation:c,defaultPopupVisible:$,destroyPopupOnHide:_e,autoDestroy:pe,mouseLeaveDelay:O,popupStyle:S,mouseEnterDelay:n},ne),C)},I=Object(z.forwardRef)(D),g=Se.a=I},OZM5:function(Fe,Se,W){"use strict";W.d(Se,"b",function(){return I}),W.d(Se,"a",function(){return g}),W.d(Se,"k",function(){return f}),W.d(Se,"h",function(){return u}),W.d(Se,"i",function(){return d}),W.d(Se,"g",function(){return s}),W.d(Se,"c",function(){return l}),W.d(Se,"d",function(){return r}),W.d(Se,"j",function(){return h}),W.d(Se,"e",function(){return O}),W.d(Se,"f",function(){return S});var q=W("KQm4"),V=W("U8pU"),M=W("Ff2n"),z=W("q1tI"),U=W.n(z),L=W("Kwbf"),H=W("WaYH"),F=.25,D=2;function I(x,A){var C=x.slice(),b=C.indexOf(A);return b>=0&&C.splice(b,1),C}function g(x,A){var C=x.slice();return C.indexOf(A)===-1&&C.push(A),C}function f(x){return x.split("-")}function u(x,A){return"".concat(x,"-").concat(A)}function d(x){return x&&x.type&&x.type.isTreeNode}function s(x,A){var C=[x],b=A[x];function v(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];p.forEach(function(c){var E=c.key,y=c.children;C.push(E),v(y)})}return v(b.children),C}function l(x,A){var C=x.clientY,b=A.selectHandle.getBoundingClientRect(),v=b.top,p=b.bottom,c=b.height,E=Math.max(c*F,D);return C<=v+E?-1:C>=p-E?1:0}function r(x,A){if(!x)return;var C=A.multiple;return C?x.slice():x.length?[x[0]]:x}var a=function(A){return A};function n(x,A){if(!x)return[];var C=A||{},b=C.processProps,v=b===void 0?a:b,p=Array.isArray(x)?x:[x];return p.map(function(c){var E=c.children,y=Object(M.a)(c,["children"]),_=n(E,A);return U.a.createElement(H.a,Object.assign({},v(y)),_)})}function h(x){if(!x)return null;var A;if(Array.isArray(x))A={checkedKeys:x,halfCheckedKeys:void 0};else if(Object(V.a)(x)==="object")A={checkedKeys:x.checked||void 0,halfCheckedKeys:x.halfChecked||void 0};else return Object(L.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function O(x,A){var C=new Set;function b(v){if(C.has(v))return;var p=A[v];if(!p)return;C.add(v);var c=p.parent,E=p.node;if(E.disabled)return;c&&b(c.key)}return(x||[]).forEach(function(v){b(v)}),Object(q.a)(C)}function S(x){var A={};return Object.keys(x).forEach(function(C){(C.startsWith("data-")||C.startsWith("aria-"))&&(A[C]=x[C])}),A}},Ot1p:function(Fe,Se,W){"use strict";var q=W("2qtc"),V=W("kLXV"),M=W("rAM+"),z=W("miYZ"),U=W("tsqr"),L=W("9og8"),H=W("tJVT"),F=W("jrin"),D=W("WmNS"),I=W.n(D),g=W("q1tI"),f=W.n(g),u=W("VrN/"),d=W.n(u),s=W("bdgK"),l=W("p77/"),r=W("Bd2K"),a=W("ELLl"),n=W("19Vz"),h=W("lZu9"),O=W("+NIl"),S=W("kSUc"),x=W("9Bee"),A=function(be){var Ie=be.value,Xe=Ie===void 0?"":Ie,ut=be.className,bt=be.showTextOnly,ft=be.showLines,at=be.style,Be=at===void 0?{}:at,We=Object(g.useMemo)(function(){return""},[Xe]);return f.a.createElement(f.a.Fragment,null,f.a.createElement("div",{dangerouslySetInnerHTML:{__html:We}}))},C=W("0Owb"),b=W("dejd"),v=W("C+DQ"),p=W("1vsH"),c=W("m3rI"),E=[{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 y(be){var Ie=be.onActionCallback,Xe=be.title,ut=be.icon,bt=be.actionName,ft=be.className,at=ft===void 0?"":ft,Be=be.children;function We(){Ie(bt)}return f.a.createElement("a",{title:Xe,className:at,onClick:We},f.a.createElement("i",{className:"md-iconfont ".concat(ut)}),Be)}var _=function(be){var Ie=be.watch,Xe=be.showNullButton,ut=be.onActionCallback,bt=be.fullScreen,ft=be.insertTemp,at=be.hidetoolBar,Be=be.uuid,We=be.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(p.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(p.F)("_educoder_session"),"&key=").concat(Be,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Me=[].concat(E,[{title:"".concat(Ie?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Ie?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return f.a.createElement("ul",{className:"markdown-toolbar-container"},!at&&Me.map(function(se,ve){return f.a.createElement("li",{key:ve},se.actionName?f.a.createElement(y,Object(C.a)({},se,{onActionCallback:ut})):f.a.createElement("span",{className:"v-line"}))}),Xe?f.a.createElement("li",null,f.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ut},f.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&f.a.createElement("li",null,f.a.createElement(y,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:ut},f.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),f.a.createElement("li",{className:"btn-full-screen"},f.a.createElement(y,{icon:"".concat(bt?"icon-shrink":"icon-enlarge"),title:bt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ut})))},P=W("M8RZ"),N=W("+L6B"),K=W("2/Rp"),$=W("y8nQ"),B=W("Vl3Y"),R=W("5NDa"),G=W("5rEg"),Q={labelCol:{span:4},wrapperCol:{span:20}},ne=function(be){var Ie=be.callback,Xe=be.onCancel;function ut(bt){Ie(bt)}return f.a.createElement(B.a,Object(C.a)({},Q,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ut}),f.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},f.a.createElement(G.a,null)),f.a.createElement(B.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},f.a.createElement(G.a,null)),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(K.a,{type:"ghost",onClick:Xe},"\u53D6\u6D88")))},le=W("7ahc"),_e=W("HmJG"),pe=W("BjJ7"),Ee=B.a.useForm,Oe={width:280,marginRight:10},we={labelCol:{span:5},wrapperCol:{span:19}},he=function(be){var Ie=be.callback,Xe=be.onCancel,ut=Ee(),bt=Object(H.a)(ut,1),ft=bt[0];function at(Me){Ie(Me)}function Be(Me,se){if(Me.status===-1){U.b.error(Me.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Me.id),type:se.type})}function We(Me){var se=Me.target.files[0];Le(se,Be)}return f.a.createElement(B.a,Object(C.a)({form:ft},we,{className:"upload-image-panel",onFinish:at}),f.a.createElement(B.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},f.a.createElement("div",{className:"flex-container"},f.a.createElement(B.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},f.a.createElement(G.a,{style:Oe})),f.a.createElement(oe,{onFileChange:We}))),f.a.createElement(B.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},f.a.createElement(G.a,{style:{width:264}})),f.a.createElement(B.a.Item,{style:{textAlign:"right"}},f.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(K.a,{type:"ghost",onClick:Xe},"\u53D6\u6D88")))};function oe(be){var Ie=be.onFileChange;return f.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",f.a.createElement("input",{type:"file",onChange:Ie}))}function Le(be,Ie){if(!be)throw new String("\u6CA1\u6709\u6587\u4EF6");var Xe=new FormData;Xe.append("editormd-image-file",be),Xe.append("file_param_name","editormd-image-file"),Xe.append("byxhr","true");var ut=new window.XMLHttpRequest;ut.withCredentials=!0,ut.addEventListener("load",function(bt){Ie(JSON.parse(bt.target.responseText),be)},!1),ut.addEventListener("error",function(bt){console.error(bt)},!1),ut.open("POST","".concat(pe.a,"/api/attachments.json")),ut.send(Xe)}var Ye=W("giR+"),nt=W("fyUT"),qe=W("7Kak"),it=W("9yH6"),He=it.a.Group,$e={margin:"0 8px"},Qe=function(be){var Ie=be.callback,Xe=be.onCancel;function ut(bt){Ie(bt)}return f.a.createElement(B.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ut},f.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},f.a.createElement("span",{style:$e},"\u5355\u5143\u683C\u6570\uFF1A"),f.a.createElement("span",{style:$e},"\u884C\u6570"),f.a.createElement(B.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},f.a.createElement(nt.a,null)),f.a.createElement("span",{style:$e},"\u5217\u6570"),f.a.createElement(B.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},f.a.createElement(nt.a,null))),f.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},f.a.createElement("span",{style:$e},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),f.a.createElement(B.a.Item,{name:"align"},f.a.createElement(He,null,f.a.createElement(it.a,{value:"default"},f.a.createElement("i",{className:"fa fa-align-justify"})),f.a.createElement(it.a,{value:"left"},f.a.createElement("i",{className:"fa fa-align-left"})),f.a.createElement(it.a,{value:"center"},f.a.createElement("i",{className:"fa fa-align-center"})),f.a.createElement(it.a,{value:"right"},f.a.createElement("i",{className:"fa fa-align-right"}))))),f.a.createElement("div",{className:"flex-container flex-end"},f.a.createElement(K.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),f.a.createElement(K.a,{type:"ghost",onClick:Xe},"\u53D6\u6D88")))},gt=W("ErOA"),et=W("7Cbv"),tt="link",Je="upload-image",vt="code-block",wt="add-table",Et="------------",xt={default:Et,left:":".concat(Et),center:":".concat(Et,":"),right:"".concat(Et,":")},kt=W("9VGf"),Ot,Ae;function Ce(){}var Ge=0,ze=1e4,Re="\u2581",je=`
**\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(be){return/^\d+$/.test(be)?"".concat(be,"px"):be}var de=navigator.platform.toUpperCase().indexOf("MAC")>=0,ce=de?"Cmd":"Ctrl",re=["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"],ae=(Ot={},Object(F.a)(Ot,ce+"-B","bold"),Object(F.a)(Ot,ce+"-I","italic"),Ot),ue=(Ae={},Object(F.a)(Ae,tt,"\u6DFB\u52A0\u94FE\u63A5"),Object(F.a)(Ae,vt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(F.a)(Ae,Je,"\u6DFB\u52A0\u6587\u4EF6"),Object(F.a)(Ae,wt,"\u6DFB\u52A0\u8868\u683C"),Ae),fe=Se.a=function(be){var Ie=be.defaultValue,Xe=Ie===void 0?"":Ie,ut=be.onChange,bt=be.width,ft=bt===void 0?"100%":bt,at=be.height,Be=at===void 0?400:at,We=be.miniToolbar,Me=We===void 0?!1:We,se=be.isFocus,ve=se===void 0?!1:se,Ke=be.watch,Pe=be.insertTemp,st=be.mode,dt=st===void 0?"markdown":st,Te=be.id,ke=Te===void 0?"markdown-editor-id":Te,rt=be.showResizeBar,Ct=rt===void 0?!1:rt,At=be.noStorage,cn=At===void 0?!1:At,yn=be.showNullButton,en=yn===void 0?!1:yn,Dt=be.hidetoolBar,Rn=Dt===void 0?!1:Dt,Fn=be.fullScreen,Cn=Fn===void 0?!1:Fn,Qt=be.onBlur,Sn=be.onCMBeforeChange,Bn=be.onFullScreen,li=be.className,ct=li===void 0?"":li,St=be.disablePaste,zn=St===void 0?!1:St,pi=be.placeholder,ui=pi===void 0?"":pi,ki=be.values,J=ki===void 0?"":ki,w=Object(g.useState)(null),T=Object(H.a)(w,2),j=T[0],ee=T[1],X=Object(g.useState)(Xe),ye=Object(H.a)(X,2),Ve=ye[0],ot=ye[1],ht=Object(g.useState)(Ke),Ue=Object(H.a)(ht,2),mt=Ue[0],Rt=Ue[1],Mt=Object(g.useState)(Cn),Jt=Object(H.a)(Mt,2),Tt=Jt[0],qt=Jt[1],Zt=Object(g.useState)(""),Mn=Object(H.a)(Zt,2),Gt=Mn[0],wn=Mn[1],On=Object(g.useState)(0),Ln=Object(H.a)(On,2),xn=Ln[0],In=Ln[1],Hn=Object(g.useState)(Be),ri=Object(H.a)(Hn,2),Vn=ri[0],_n=ri[1],jn=Object(g.useState)(!1),dn=Object(H.a)(jn,2),pn=dn[0],mn=dn[1],zt=Object(g.useRef)(Object(et.a)()),yt=Object(g.useRef)(!1),Wt=Object(g.useRef)(),pt=Object(g.useRef)(),$t=Object(g.useRef)(),Nt=Object(g.useRef)(),Xn=Object(g.useRef)(),sn=function(){var Ft=Object(L.a)(I.a.mark(function Xt(){var Kt,tn;return I.a.wrap(function(Tn){for(;;)switch(Tn.prev=Tn.next){case 0:return Tn.next=2,Object(gt.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:zt.current}});case 2:tn=Tn.sent,tn!=null&&(Kt=tn.attachments)!==null&&Kt!==void 0&&Kt.length&&(console.log("cm:",j,pt),tn.attachments.map(function(ln){ln.content_type.indexOf("image")>-1?j.replaceSelection(".concat(ln.content_type,")")):ln.content_type.indexOf("video")>-1?j.replaceSelection('')):ln.content_type.indexOf("pdf")>-1?j.replaceSelection('').concat(ln.name,"")):j.replaceSelection("[".concat(ln.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(ln.id,"?type=").concat(ln.content_type,")"))}));case 4:case"end":return Tn.stop()}},Xt)}));return function(){return Ft.apply(this,arguments)}}();Object(g.useEffect)(function(){ot(J),j==null||j.setValue(J)},[J]),Object(g.useEffect)(function(){Bn==null||Bn(Tt)},[Tt]),Object(g.useEffect)(function(){if(pt.current){var Ft=d.a.fromTextArea(pt.current,{mode:dt,lineNumbers:!Me,lineWrapping:!0,value:Xe,autoCloseTags:!0,autoCloseBrackets:!0});ve&&Ft.focus();function Xt(Kt,tn){if(zn){tn.preventDefault();return}var rn=tn.clipboardData;if(rn){var Tn=rn.types.toString(),ln=rn.items;if(Tn==="Files"||rn.types.indexOf("Files")>-1){if(tn.preventDefault(),dt=="stex")return;try{var Un,ai=ln[1];((Un=ln[0])===null||Un===void 0?void 0:Un.kind)==="file"&&(ai=ln[0]);var nn=ai.getAsFile(),bi=nn.name.split(".").pop();Le(nn,function(bn){if(bn.id){var Qn,qn,mi;(nn==null||((Qn=nn.type)===null||Qn===void 0)?void 0:Qn.indexOf("image"))>-1?Ft.replaceSelection(".concat(bn.content_type,")")):(nn==null||((qn=nn.type)===null||qn===void 0)?void 0:qn.indexOf("video"))>-1?Ft.replaceSelection('')):(nn==null||((mi=nn.type)===null||mi===void 0)?void 0:mi.indexOf("pdf"))>-1?Ft.replaceSelection('').concat(nn.name,"")):re.includes(bi)?Ft.replaceSelection('').concat(nn.name,"")):Ft.replaceSelection("[".concat(nn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(bn.id,"?type=").concat(bn.content_type,")"))}else(bn==null?void 0:bn.status)===401&&(document.location.href="/user/login")})}catch(bn){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Ft.on("paste",Xt),Ft.on("dragleave",function(Kt,tn){$t.current.classList.remove("mouse-hover-md")}),Ft.on("dragover",function(Kt,tn){$t.current.classList.add("mouse-hover-md")}),Ft.on("drop",function(Kt,tn){$t.current.classList.add("mouse-hover-md");var rn;if(rn=tn.dataTransfer.files,rn.length>0){tn.preventDefault(),tn.stopPropagation();for(var Tn=function(ai){var nn=rn[ai],bi=nn.name.split(".").pop();Le(nn,function(bn){if(bn.id){var Qn,qn,mi;(nn==null||((Qn=nn.type)===null||Qn===void 0)?void 0:Qn.indexOf("image"))>-1?Ft.replaceSelection(".concat(bn.content_type,")")):(nn==null||((qn=nn.type)===null||qn===void 0)?void 0:qn.indexOf("video"))>-1?Ft.replaceSelection('')):(nn==null||((mi=nn.type)===null||mi===void 0)?void 0:mi.indexOf("pdf"))>-1?Ft.replaceSelection('').concat(nn.name,"")):re.includes(bi)?Ft.replaceSelection('').concat(nn.name,"")):Ft.replaceSelection("[".concat(nn.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(bn.id,"?type=").concat(bn.content_type,")"))}else(bn==null?void 0:bn.status)===401&&(document.location.href="/user/login")})},ln=0;ln0||ln.target.offsetWidth>0)&&(Zn(),j.setSize("100%","100%"),j.refresh())}}catch(Un){rn.e(Un)}finally{rn.f()}});return Kt.observe(pt.current.parentElement),Kt}if(j){var Xt=Ft();return function(){Xt.unobserve(pt.current.parentElement)}}},[j,Zn]),Object(g.useEffect)(function(){if(j){for(var Ft=[],Xt=function(){var ln=tn[Kt];rn=Object(H.a)(ln,2);var Un=rn[0],ai=rn[1],nn=Object(F.a)({},Un,function(){Ki(ai)});Ft.push(nn),j.addKeyMap(nn)},Kt=0,tn=Object.entries(ae);Kt0){var Ft=new Date().getTime(),Xt=window.sessionStorage.getItem(ke);Ft>=xn+ze&&(!Xt||Xt!==Ve)&&(window.sessionStorage.setItem(ke,Ve),mn(!0))}},ze),Object(g.useEffect)(function(){Rt(Ke)},[j,Ke]),Object(g.useEffect)(function(){j&&(ve&&j.focus())},[j,ve]),Object(g.useEffect)(function(){if(mt&&j){var Ft=j.getScrollerElement();function Xt(Kt){var tn=Kt.target;if(Xn.current){var rn=tn.scrollTop/tn.scrollHeight;Xn.current.scrollTop=Xn.current.scrollHeight*rn}}return Ft.addEventListener("scroll",Xt),function(){Ft.removeEventListener("scroll",Xt)}}},[j,mt]),Object(g.useEffect)(function(){if(j&&Sn){function Ft(Xt,Kt){Sn(Xt,Kt)}return j.on("beforeChange",Ft),function(){j.off("beforeChange",Ft)}}},[j,Sn]),Object(g.useEffect)(function(){if(j&&Qt){function Ft(){Qt(j.getValue())}return j.on("blur",Ft),function(){j.off("blur",Ft)}}},[j,Qt]),Object(g.useEffect)(function(){if(j){function Ft(Xt){var Kt=Xt.getValue();ot(Kt),In(new Date().getTime()),Xt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),ut&&ut(Kt)}return j.on("change",Ft),function(){j.off("change",Ft)}}},[j,ut]),Object(g.useEffect)(function(){j&&(Xe==null?(j.setValue(""),ot("")):Xe!==j.getValue()&&(j.setValue(Xe),ot(Xe),j.setCursor(j.lineCount(),0)))},[j,Xe]);var Ki=Object(g.useCallback)(function(Ft){var Xt=j.getCursor(),Kt=j.getSelection(),tn=Kt.split(`
`);switch(Ft){case"bold":return j.replaceSelection("**"+Kt+"**"),Kt===""&&j.setCursor(Xt.line,Xt.ch+2),j.focus();case"italic":return j.replaceSelection("*"+Kt+"*"),Kt===""&&j.setCursor(Xt.line,Xt.ch+1),j.focus();case"code":return j.replaceSelection("`"+Kt+"`"),Kt===""&&j.setCursor(Xt.line,Xt.ch+1),j.focus();case"inline-latex":return j.replaceSelection("`$$"+Kt+"$$`"),Kt===""&&j.setCursor(Xt.line,Xt.ch+3),j.focus();case"latex":return j.replaceSelection("```latex\n"+Kt+"\n```"),j.setCursor(Xt.line+1,Kt.length+1),j.focus();case"line-break":return j.replaceSelection(`
`),j.focus();case"list-ul":return Kt===""?j.replaceSelection("- "+Kt):j.replaceSelection(tn.map(function(rn){return rn===""?"":"- ".concat(rn)}).join(`
`)),j.focus();case"list-ol":return Kt===""?j.replaceSelection("1. "+Kt):j.replaceSelection(tn.map(function(rn,Tn){return rn===""?"":"".concat(Tn+1,". ").concat(rn)}).join(`
`)),j.focus();case"add-null-ch":return Kt===""&&j.setCursor(Xt.line,Xt.ch+1),j.replaceSelection(Re),j.focus();case"inster-template-1":return Kt===""&&j.setCursor(Xt.line,Xt.ch),j.replaceSelection(je),j.focus();case"eraser":return j.setValue(""),j.focus();case"trigger-watch":return Rt(!mt),j.focus();case"trigger-full-screen":return qt(!Tt),j.focus();case tt:wn(tt);return;case vt:wn(vt);return;case Je:wn(Je);return;case wt:wn(wt);return;default:throw new Error}},[j,mt,Tt]),Ci=Object(g.useCallback)(function(Ft){wn("");switch(Gt){case tt:var Xt=Ft.title,Kt=Ft.link;return j.replaceSelection("[".concat(Xt,"](").concat(Kt,")")),j.focus();case vt:var tn=Ft.language,rn=Ft.content;return j.replaceSelection(["```"+tn,rn,"```"].join(`
`)),j.focus();case Je:var Tn=Ft.src,ln=Ft.alt;return ln?j.replaceSelection(".concat(Tn,' "').concat(ln,'" )')):j.replaceSelection("")),j.focus();case wt:for(var Un=Ft.row,ai=Ft.col,nn=Ft.align,bi=`
`,bn=0;bn300&&(Un=300);var ai=Be+Un+"px";_n(ai)}}return Ft.addEventListener("mousedown",tn),document.addEventListener("mousemove",Tn),document.addEventListener("mouseup",rn),function(){Ft.removeEventListener("mousedown",tn),document.removeEventListener("mousemove",Tn),document.removeEventListener("mouseup",rn)}}},[j,Nt]),Object(g.useEffect)(function(){_n(Be)},[Be]);var Ri=ge(ft),Gi=ge(Vn),Kn={width:Ri,height:Gi},Ht=Object(g.useMemo)(function(){if(xn){var Ft=new Date(xn),Xt=Ft.getHours(),Kt=Ft.getMinutes(),tn=Ft.getSeconds();return Xt=Xt<10?"0"+Xt:Xt,Kt=Kt<10?"0"+Kt:Kt,tn=tn<10?"0"+tn:tn,"".concat(Xt,":").concat(Kt,":").concat(tn)}return 0},[xn]);function Xi(){window.sessionStorage.removeItem(ke),mn(!1),In(0)}function _i(){mn(!1),In(0),j.setValue(window.sessionStorage.getItem(ke))}function nr(Ft,Xt){var Kt=j.getValue();Kt=Kt.replace(Ft,Xt),ot(Kt),j==null||j.setValue(Kt)}return f.a.createElement(g.Fragment,null,f.a.createElement("div",{className:"markdown-editor-wrapper",ref:$t},f.a.createElement("div",{className:"markdown-editor-container ".concat(ct," ").concat(mt?"on-preview":""," ").concat(Me?"mini":""," ").concat(Tt?"full-screen":""),style:Kn},f.a.createElement(_,{insertTemp:Pe,watch:mt,fullScreen:Tt,showNullButton:en,onActionCallback:Ki,hidetoolBar:Rn,uuid:zt.current,setOpenPhones:function(){yt.current=!0}}),f.a.createElement("div",{className:"markdown-editor-body"},f.a.createElement("div",{className:"codemirror-container"},f.a.createElement("textarea",{ref:pt,placeholder:ui})),mt?f.a.createElement("div",{ref:Xn,className:"preview-container"},dt==="stex"&&f.a.createElement(A,{value:Ve}),dt!=="stex"&&f.a.createElement(x.a,{edit:!0,value:Ve,replaces:nr})):null))),Ct?f.a.createElement("a",{ref:Nt,className:"editor-resize"}):null,f.a.createElement(P.a,null,ue[Gt]?f.a.createElement(V.a,{centered:!0,title:ue[Gt],visible:!0,onCancel:Ni,footer:null,className:"markdown-popup-form"},Vi):null))}},PD8m:function(Fe,Se){Fe.exports={name:"memoryStorage",read:q,write:V,each:M,remove:z,clearAll:U};var W={};function q(L){return W[L]}function V(L,H){W[L]=H}function M(L){for(var H in W)W.hasOwnProperty(H)&&L(W[H],H)}function z(L){delete W[L]}function U(L){W={}}},QUZ3:function(Fe,Se,W){"use strict";W.r(Se);var q=W("0Owb"),V=W("PpiC"),M=W("OaEy"),z=W("2fM7"),U=W("T2oS"),L=W("W9HT"),H=W("+L6B"),F=W("2/Rp"),D=W("9og8"),I=W("2qtc"),g=W("kLXV"),f=W("tJVT"),u=W("k1fw"),d=W("aHsQ"),s=W("sGsY"),l=W("WmNS"),r=W.n(l),a=W("q1tI"),n=W.n(a),h=W("Icgb"),O=W("Fvcw"),S=W("GIiI"),x=W("Ty5D"),A=W("55Ip"),C=W("OJz4"),b=W("V0Rq"),v=W("bntm"),p=W("cDPC"),c=W("m3rI"),E=W("RCxd"),y=W("EHPI"),_=W("S+dL"),P=W.n(_),N=W("J66h"),K=W("uMZB"),$=W.n(K),B=W("p/48"),R=W("JPnl"),G=W("y8nQ"),Q=W("Vl3Y"),ne=W("5NDa"),le=W("5rEg"),_e=le.a.TextArea,pe=5e3,Ee=function(T){var j=T.callback,ee=T.onCancel,X=T.notes;function ye(Ve){j(Ve)}return n.a.createElement(Q.a,{className:"note-form-panel",onFinish:ye,initialValues:{notes:X}},n.a.createElement(Q.a.Item,{name:"notes",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9"},{max:pe,message:"\u7B14\u8BB0\u6700\u5927\u5B57\u6570\u4E3A".concat(pe)}]},n.a.createElement(_e,{placeholder:"\u8BF7\u8F93\u5165\u7B14\u8BB0\u5185\u5BB9",rows:5})),n.a.createElement(Q.a.Item,{style:{textAlign:"right"}},n.a.createElement(F.a,{type:"ghost",onClick:ee,style:{marginRight:10}}," \u53D6\u6D88 "),n.a.createElement(F.a,{type:"primary",htmlType:"submit"}," \u63D0\u4EA4 ")))},Oe=W("bbsP"),we=W("/wGt"),he=W("DjyN"),oe=W("NUBc"),Le=W("H2Ag"),Ye=W.n(Le),nt=W("miYZ"),qe=W("tsqr"),it=W("g9YV"),He=W("wCAj"),$e=W("+k/U"),Qe=W.n($e),gt=W("ye1Q"),et=W("lfch"),tt=W("JB8y"),Je=W("p5ED"),vt=W("ErOA"),wt=W("wd/R"),Et=W.n(wt),xt=He.a.Column,kt=function(T){var j,ee=T.submitResult,X=T.submitting,ye=T.submitRecords,Ve=T.page,ot=T.onPageChange,ht=T.topicId,Ue=ee||{},mt=Ue.status,Rt=Ue.id,Mt=Ue.input,Jt=Ue.output,Tt=Ue.expected_output,qt=Ue.is_file,Zt=Ue.input_file_url,Mn=Ue.output_file_url,Gt=Ue.expected_output_file_url,wn=Ue.error_msg,On=ye||{},Ln=On.records,xn=On.records_count,In=Object(a.useState)(""),Hn=Object(f.a)(In,2),ri=Hn[0],Vn=Hn[1],_n=Object(a.useState)(""),jn=Object(f.a)(_n,2),dn=jn[0],pn=jn[1],mn=Object(x.h)(),zt=(mn==null||((j=mn.query)===null||j===void 0)?void 0:j.type)==="1";function yt(){qt?navigator.clipboard.writeText(N.Base64.decode(wn)).then(function(){qe.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")}):navigator.clipboard.writeText(N.Base64.decode(Jt)).then(function(){qe.b.success("\u590D\u5236\u9519\u8BEF\u4FE1\u606F\u6210\u529F")})}return n.a.createElement(L.a,{spinning:X,tip:"\u8BC4\u6D4B\u4E2D...",indicator:n.a.createElement(gt.a,{style:{fontSize:24},spin:!0})},Rt?n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:Qe.a.info},n.a.createElement("li",null,"\u6267\u884C\u7ED3\u679C\uFF1A",n.a.createElement("span",{className:mt===tt.a.OK?"c-green":"c-red"},R.a[mt])),n.a.createElement("li",{className:Qe.a.error},n.a.createElement("a",{onClick:yt},"\u590D\u5236\u9519\u8BEF\u4FE1\u606F ",n.a.createElement(et.a,null)," ")),n.a.createElement("li",null,n.a.createElement(A.a,{to:"/myproblems/".concat(ht,"/record-detail/").concat(Rt)},"\u663E\u793A\u8BE6\u60C5 >"," "))),mt!==tt.a.OK?n.a.createElement(n.a.Fragment,null,n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),n.a.createElement("pre",null,!qt&&Mt,qt&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(D.a)(r.a.mark(function Wt(){var pt;return r.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,fetch(Zt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return pt=Nt.sent,Nt.t0=pn,Nt.next=6,pt.text();case 6:Nt.t1=Nt.sent,(0,Nt.t0)(Nt.t1),setTimeout(function(){Vn(Zt)},200);case 9:case"end":return Nt.stop()}},Wt)}))},Mt)),n.a.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,(mt===4||mt===5)&&N.Base64.decode(wn),mt!=4&&mt!=5&&(qt?n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(D.a)(r.a.mark(function Wt(){var pt;return r.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(vt.a)(Mn,{method:"Get",headers:{"Content-Type":"application/xml",Accept:"*/*"}});case 2:pt=Nt.sent;try{pn(pt)}catch(Xn){pn("")}setTimeout(function(){Vn(Mn)},200);case 5:case"end":return Nt.stop()}},Wt)}))},Jt):N.Base64.decode(Jt))),n.a.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),n.a.createElement("pre",null,!qt&&N.Base64.decode(Tt),qt&&n.a.createElement("a",{style:{fontSize:"16px"},onClick:Object(D.a)(r.a.mark(function Wt(){var pt;return r.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,fetch(Gt,{method:"Get",headers:{"Content-Type":"application/octet-stream",Accept:"*/*"}});case 2:return pt=Nt.sent,Nt.t0=pn,Nt.next=6,pt.text();case 6:Nt.t1=Nt.sent,(0,Nt.t0)(Nt.t1),setTimeout(function(){Vn(Gt)},200);case 9:case"end":return Nt.stop()}},Wt)}))},Tt))):null):null,(Ln==null?void 0:Ln.length)>0?n.a.createElement(He.a,{dataSource:Ln,rowKey:"id",pagination:!1},n.a.createElement(xt,{title:"\u63D0\u4EA4\u65F6\u95F4",dataIndex:"created_at",key:"created_at",render:function(pt,$t){return n.a.createElement("span",null," ",Et()(pt).format("YYYY-MM-DD HH:mm:ss"))}}),n.a.createElement(xt,{title:"\u63D0\u4EA4\u7ED3\u679C",dataIndex:"status",key:"status",render:function(pt,$t){var Nt;return n.a.createElement(A.a,{className:pt===0?"c-green":"c-red",to:"/myproblems/".concat(ht,"/record-detail/").concat($t.id)},(Nt=R.a[pt])===null||Nt===void 0?void 0:Nt.replace("\u8C03\u8BD5","\u8BC4\u6D4B"))}}),n.a.createElement(xt,{title:"\u6267\u884C\u7528\u65F6 (".concat(zt?"MS":"S",")"),dataIndex:"execute_time",key:"execute_time",render:function(pt){return pt?zt?pt:pt/1e3:""}}),n.a.createElement(xt,{title:"\u5185\u5B58\u6D88\u8017\uFF08".concat(zt?"KB":"MB","\uFF09"),dataIndex:"execute_memory",key:"execute_memory",render:function(pt){return pt?zt?pt:parseFloat((pt/1024).toFixed(2)):""}}),n.a.createElement(xt,{title:"\u8BED\u8A00",dataIndex:"language",key:"language"}),n.a.createElement(xt,{title:"\u64CD\u4F5C",dataIndex:"status",key:"status",render:function(pt,$t){return n.a.createElement(A.a,{className:"c-light-primary",to:"/myproblems/".concat(ht,"/record-detail/").concat($t.id)},"\u67E5\u770B")}})):n.a.createElement("div",{style:{height:300,width:"100%"}}),xn>15?n.a.createElement(oe.a,{className:Qe.a.pagination,current:Ve,pageSize:15,total:xn,onChange:ot}):null,n.a.createElement(Je.a,{close:!0,data:ri,type:ri.length?"txt":"",onClose:function(){return Vn("")},monacoEditor:{value:dn,language:"txt",onChange:function(){},options:{fontSize:14,readOnly:!0,minimap:{enabled:!1}}}}))},Ot=W("BdwD"),Ae=W("DYRE"),Ce=W("zeV3"),Ge=W("+BJd"),ze=W("mr32"),Re=W("pPuO"),je=W.n(Re),ge=W("9Bee"),de={1:{name:"\u7B80\u5355",color:"#52c41a"},2:{name:"\u4E2D\u7B49",color:"#faad14"},3:{name:"\u56F0\u96BE",color:"#f5222d"}},ce=function(T){var j=T.hack,ee=T.onTriggerPraise,X=T.toDiscuss,ye=j.language,Ve=j.difficult,ot=j.time_limit,ht=j.username,Ue=j.user_path,mt=j.user_praise,Rt=j.comments_count,Mt=j.praises_count,Jt=j.description,Tt=j.pass_count,qt=j.submit_count,Zt=Object(x.h)(),Mn=de[Ve];return n.a.createElement(n.a.Fragment,null,n.a.createElement("ul",{className:je.a.info},n.a.createElement("li",null,"\u7F16\u7A0B\u8BED\uFF1A",n.a.createElement("b",null,ye)),n.a.createElement("li",null,"\u96BE\u5EA6\uFF1A",n.a.createElement(ze.a,{color:Mn.color},Mn.name)),n.a.createElement("li",null,"\u8BC4\u6D4B\u65F6\u957F\u9650\u5236\uFF1A",n.a.createElement("b",null,ot,"\u79D2"))),n.a.createElement(ge.a,{value:Jt,className:je.a.desc}),n.a.createElement("ul",{className:je.a["commit-info"]},n.a.createElement("li",null,n.a.createElement(Ce.a,{size:4},n.a.createElement("span",null,"\u901A\u8FC7\u6B21\u6570")," ",n.a.createElement("b",null,Tt))),n.a.createElement("li",null,n.a.createElement(Ce.a,{size:4},n.a.createElement("span",null,"\u63D0\u4EA4\u6B21\u6570")," ",n.a.createElement("b",null,qt))," "),n.a.createElement("li",{style:{flex:"1 0 0"}}),Zt.query.type!=="exercises"&&n.a.createElement("li",null,n.a.createElement(Ce.a,{size:4},n.a.createElement("i",{className:"iconfont icon-huifu1",onClick:X})," ",n.a.createElement("b",null,Rt))," ")))},re=W("dhSg"),ae=W("oBTY"),ue=W("M8RZ"),fe=W("qJ4+");function be(T,j){return Object(vt.c)("/problems/".concat(T,"/comments.json?page=").concat(j,"&limit=10"))}function Ie(T){return Object(vt.f)("/discusses/".concat(T,"/plus.json"),{container_type:"Discuss",type:1})}function Xe(T,j,ee){return Object(vt.f)("/problems/".concat(T,"/comments/reply.json"),{comments:{content:ee,parent_id:j}})}function ut(T,j){return Object(vt.f)("/problems/".concat(T,"/comments.json"),{comments:{content:j}})}function bt(T,j,ee){return Object(vt.f)("/problems/".concat(T,"/comments/").concat(j,"/hidden.json"),ee)}function ft(T,j){return Object(vt.b)("/problems/".concat(T,"/comments/").concat(j))}var at=W("U7T7"),Be=W("AMnG");function We(T){var j=T.author;return n.a.createElement("a",{href:"/users/".concat(j.login),target:"_blank"},n.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"50",style:{borderRadius:"50%"},src:"".concat(c.a.IMG_SERVER,"/images/").concat(j.image_url),width:"50"}))}function Me(T){var j=T.data,ee=T.index,X=T.parentDiscussIndex,ye=T.user,Ve=T.onSetActionType,ot=j.author,ht=j.can_delete,Ue=j.content,mt=j.id,Rt=j.time;function Mt(){Ve({id:mt,index:ee,type:"delete-discuss",parentDiscussIndex:X,message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}var Jt=ye.admin||ht||ot.user_id===ye.user_id;return n.a.createElement("div",{className:"discuss-item-container second-discuss "},n.a.createElement(We,{author:ot}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(ot.login),target:"_blank"},ot.name),n.a.createElement("span",{className:"grey"},Rt),n.a.createElement("div",{className:"btn-group",style:{marginBottom:0}},Jt?n.a.createElement("a",{onClick:Mt,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null)),n.a.createElement(ge.a,{className:"discuss-content",value:Ue})))}var se=function(T){var j=T.user,ee=T.data,X=T.index,ye=T.onPlusDiscuss,Ve=T.onSetActionType,ot=T.activeDiscussIndex,ht=T.onReplyDiscuss,Ue=T.onSetActiveDiscussIndex,mt=ee.content,Rt=ee.children,Mt=ee.hidden,Jt=ee.id,Tt=ee.praise_count,qt=ee.time,Zt=ee.user_praise,Mn=ee.can_delete,Gt=ee.author;function wn(){Ue(Jt)}function On(){ye(Jt,!Zt,X)}function Ln(){Ve({id:Jt,index:X,type:"delete-discuss",message:"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417"})}function xn(){Ve({id:Jt,index:X,params:{hidden:Mt?"0":"1"},type:"hidden-discuss",message:Mt?"\u786E\u5B9A\u8981\u53D6\u6D88\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417":"\u786E\u5B9A\u8981\u9690\u85CF\u8BE5\u6761\u56DE\u590D\u5417"})}var In=j.admin||j.user_id===Gt.user_id;return n.a.createElement("div",{className:"discuss-item-container",key:Jt},n.a.createElement(We,{author:Gt}),n.a.createElement("section",null,n.a.createElement("div",{className:"discuss-info"},n.a.createElement("a",{href:"/users/".concat(Gt.login),target:"_blank"}," ",Gt.name," "),n.a.createElement("span",{className:"grey"},qt)),n.a.createElement(ge.a,{className:"discuss-content",value:mt}),Rt&&Rt.length>0?n.a.createElement("div",{className:"reply-discuss-container"},Rt.map(function(Hn,ri){return n.a.createElement(Me,{key:Hn.id,data:Hn,index:ri,user:j,onSetActionType:Ve,parentDiscussIndex:X})})):null,n.a.createElement("div",{className:"btn-group"},In?n.a.createElement("a",{onClick:xn,title:Mt?"\u53D6\u6D88\u9690\u85CF":"\u9690\u85CF\u8BC4\u8BBA"},n.a.createElement("i",{className:Mt?"iconfont icon-yincangbiyan":"fa fa-eye"})):null,Mn&&(!Rt||Rt.length==0)?n.a.createElement("a",{onClick:Ln,title:"\u5220\u9664"},n.a.createElement("i",{className:"iconfont icon-shanchu"})):null,n.a.createElement("a",{onClick:wn,title:"\u56DE\u590D"}," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," "),n.a.createElement("a",{onClick:On,className:Zt?"c-orange":""},n.a.createElement("i",{className:Zt?"iconfont icon-dianzan mr3":"iconfont icon-dianzan-xian mr3 "}),n.a.createElement("span",null,Tt||""))),n.a.createElement(Be.a,{id:Jt,activeDiscussIndex:ot,onReplyDiscuss:ht})))},ve=W("kaH+"),Ke=W("uD2n"),Pe=W.n(Ke),st=W("Ot1p"),dt=function(T){var j=T.user_praise,ee=T.praise_count,X=T.praisePlus,ye=T.onCreateDiscuss,Ve=T.discuss_count,ot=Object(a.useState)(!1),ht=Object(f.a)(ot,2),Ue=ht[0],mt=ht[1],Rt=Object(a.useState)(""),Mt=Object(f.a)(Rt,2),Jt=Mt[0],Tt=Mt[1];function qt(On){Tt(On)}function Zt(){mt(!0)}function Mn(){mt(!1)}function Gt(){return wn.apply(this,arguments)}function wn(){return wn=Object(D.a)(r.a.mark(function On(){return r.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:ye(Jt),Tt(""),mt(!1);case 3:case"end":return xn.stop()}},On)})),wn.apply(this,arguments)}return n.a.createElement("div",{className:"".concat(Pe.a["dis-input-editor-container"]," ").concat(Ue?Pe.a.active:""," ")},n.a.createElement("div",{className:Ue?"hide ".concat(Pe.a["text-area"]):Pe.a["text-area"]},n.a.createElement("input",{placeholder:"\u8BF4\u70B9\u4EC0\u4E48",onClick:Zt}),n.a.createElement("a",null," ",n.a.createElement("i",{className:"iconfont icon-huifu1"})," \xA0 \xA0",Ve," "),n.a.createElement("a",{className:"c-light-black",onClick:X,title:j?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},n.a.createElement("i",{className:"mr3 ".concat(j?"iconfont icon-dianzan c-orange":"iconfont icon-dianzan-xian"," ")}),ee?n.a.createElement("span",null,ee):"")),Ue?n.a.createElement("div",{className:Pe.a["input-mask"],onClick:Mn}):null,n.a.createElement("div",{className:Ue?Pe.a["md-container"]:"".concat(Pe.a["md-container"]," hide")},n.a.createElement(st.a,{id:"discuss-input-editor",miniToolbar:!0,watch:!1,noStorage:!0,defaultValue:Jt,height:240,onChange:qt}),n.a.createElement("div",{className:Pe.a["tip-container"],onClick:Mn},n.a.createElement("a",{className:Pe.a["btn-send"],onClick:Gt}," \u53D1\u9001 "))))},Te={loading:!1,page:1,data:[],count:0,actionType:null,activeDiscussIndex:null},ke;(function(T){T[T.GET_DISCUSSES=0]="GET_DISCUSSES",T[T.TOP_OR_DOWN_DISCUSS=1]="TOP_OR_DOWN_DISCUSS",T[T.ACTIVE_DISCUSS_INDEX=2]="ACTIVE_DISCUSS_INDEX",T[T.PLUS_DISCUSS=3]="PLUS_DISCUSS",T[T.SET_ACTION_TYPE=4]="SET_ACTION_TYPE",T[T.SET_PAGE=5]="SET_PAGE",T[T.SHOW_DISCUSSES_LOADING=6]="SHOW_DISCUSSES_LOADING"})(ke||(ke={}));function rt(T,j){switch(j.type){case ke.SHOW_DISCUSSES_LOADING:return Object(u.a)(Object(u.a)({},T),{},{loading:!0});case ke.GET_DISCUSSES:return Object(u.a)(Object(u.a)({},T),j.payload);case ke.TOP_OR_DOWN_DISCUSS:return Object(u.a)(Object(u.a)({},T),j.payload);case ke.SET_ACTION_TYPE:return Object(u.a)(Object(u.a)({},T),j.payload);case ke.PLUS_DISCUSS:return Object(u.a)(Object(u.a)({},T),j.payload);case ke.SET_PAGE:return Object(u.a)(Object(u.a)({},T),{},{page:j.payload});case ke.ACTIVE_DISCUSS_INDEX:return Object(u.a)(Object(u.a)({},T),j.payload);default:throw new Error}}var Ct=function(T){var j=T.user,ee=T.identifier,X=T.hack,ye=T.onTriggerPraise,Ve=Object(a.useReducer)(rt,Te),ot=Object(f.a)(Ve,2),ht=ot[0],Ue=ot[1],mt=ht.loading,Rt=ht.page,Mt=ht.data,Jt=ht.count,Tt=ht.actionType,qt=ht.activeDiscussIndex,Zt=Object(a.useCallback)(Object(D.a)(r.a.mark(function dn(){var pn,mn,zt;return r.a.wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return Ue({type:ke.SHOW_DISCUSSES_LOADING}),Wt.next=3,be(ee,Rt);case 3:pn=Wt.sent,mn=pn.comments,zt=pn.disscuss_count,Ue({type:ke.GET_DISCUSSES,payload:{data:mn,count:zt,loading:!1}});case 6:case"end":return Wt.stop()}},dn)})),[Rt,ee]);Object(a.useEffect)(function(){Zt()},[ee,Rt]);function Mn(dn){Ue({type:ke.SET_PAGE,page:dn})}function Gt(dn){Ue({type:ke.SET_ACTION_TYPE,payload:{actionType:dn}})}function wn(dn){qt===dn?Ue({type:ke.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:null}}):Ue({type:ke.ACTIVE_DISCUSS_INDEX,payload:{activeDiscussIndex:dn}})}function On(dn,pn,mn){return Ln.apply(this,arguments)}function Ln(){return Ln=Object(D.a)(r.a.mark(function dn(pn,mn,zt){var yt;return r.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.prev=0,pt.next=3,Ie(pn);case 3:yt=pt.sent,Mt[zt].user_praise=mn,Mt[zt].praise_count=yt.praise_count,Ue({type:ke.PLUS_DISCUSS,payload:{data:Object(ae.a)(Mt)}}),pt.next=12;break;case 9:pt.prev=9,pt.t0=pt.catch(0),console.log(pt.t0);case 12:case"end":return pt.stop()}},dn,null,[[0,9]])})),Ln.apply(this,arguments)}function xn(){return In.apply(this,arguments)}function In(){return In=Object(D.a)(r.a.mark(function dn(){var pn,mn,zt,yt,Wt,pt,$t,Nt;return r.a.wrap(function(sn){for(;;)switch(sn.prev=sn.next){case 0:if(pn=Tt.id,mn=Tt.params,zt=Tt.type,yt=Tt.index,Wt=Tt.parentDiscussIndex,!(zt==="hidden-discuss")){sn.next=6;break}return sn.next=4,bt(ee,pn,mn);case 4:Wt?Mt[Wt].children[yt].hidden=mn.hidden==1:Mt[yt].hidden=mn.hidden==1,Ue({type:ke.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ae.a)(Mt)}});case 6:if(!(zt==="delete-discuss")){sn.next=31;break}return sn.next=9,ft(ee,pn);case 9:if(!(Wt||Wt===0)){sn.next=22;break}pt=Mt[Wt].children,$t=pt.length-1;case 12:if(!($t>=0)){sn.next=19;break}if(!(pt[$t].id===pn)){sn.next=16;break}return pt.splice($t,1),sn.abrupt("break",19);case 16:$t--,sn.next=12;break;case 19:Mt[Wt].children=pt,sn.next=30;break;case 22:Nt=Mt.length-1;case 23:if(!(Nt>=0)){sn.next=30;break}if(!(Mt[Nt].id===pn)){sn.next=27;break}return Mt.splice(Nt,1),sn.abrupt("break",30);case 27:Nt--,sn.next=23;break;case 30:Ue({type:ke.SET_ACTION_TYPE,payload:{actionType:null,data:Object(ae.a)(Mt)}});case 31:case"end":return sn.stop()}},dn)})),In.apply(this,arguments)}function Hn(){Ue({type:ke.SET_ACTION_TYPE,payload:{actionType:null}})}function ri(dn,pn){return Vn.apply(this,arguments)}function Vn(){return Vn=Object(D.a)(r.a.mark(function dn(pn,mn){return r.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.prev=0,yt.next=3,Xe(ee,pn,mn);case 3:Zt(),yt.next=9;break;case 6:yt.prev=6,yt.t0=yt.catch(0),console.log(yt.t0);case 9:case"end":return yt.stop()}},dn,null,[[0,6]])})),Vn.apply(this,arguments)}function _n(dn){return jn.apply(this,arguments)}function jn(){return jn=Object(D.a)(r.a.mark(function dn(pn){return r.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:return Ue({type:ke.SHOW_DISCUSSES_LOADING}),zt.next=3,ut(ee,pn);case 3:Zt();case 4:case"end":return zt.stop()}},dn)})),jn.apply(this,arguments)}return n.a.createElement(n.a.Fragment,null,n.a.createElement("div",{className:"discuss-panel"},Mt.length===0?n.a.createElement(Ot.a,null):Mt.map(function(dn,pn){return n.a.createElement(se,{onReplyDiscuss:ri,onPlusDiscuss:On,onSetActiveDiscussIndex:wn,onSetActionType:Gt,data:dn,index:pn,user:j,activeDiscussIndex:qt})}),Jt>10?n.a.createElement("div",{className:"pagination-container"},n.a.createElement(oe.a,{showQuickJumper:!0,onChange:Mn,current:Rt,total:Jt})):null),n.a.createElement(dt,{user_praise:X.user_praise,praise_count:X.praises_count,praisePlus:ye,discuss_count:X.comments_count,onCreateDiscuss:_n}),n.a.createElement(ue.a,null,n.a.createElement(g.a,{centered:!0,title:"\u63D0\u793A",visible:!!Tt,onOk:xn,onCancel:Hn},n.a.createElement("p",null,Tt?Tt.message:"")),n.a.createElement(ve.a,null)))},At=W("9kvl"),cn={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},yn={1:"#2fa34f",2:"#0152d9",3:"#fa6400"},en=function(T){var j,ee=T.hack,X=T.onTriggerPraise,ye=T.topicId,Ve=T.page,ot=T.onPageChange,ht=T.user,Ue=T.submitRecords,mt=T.submitting,Rt=T.submitResult,Mt=Object(a.useState)("0"),Jt=Object(f.a)(Mt,2),Tt=Jt[0],qt=Jt[1],Zt=Object(x.h)(),Mn=Object(a.useState)(!1),Gt=Object(f.a)(Mn,2),wn=Gt[0],On=Gt[1],Ln=Object(a.useState)([]),xn=Object(f.a)(Ln,2),In=xn[0],Hn=xn[1],ri=Object(a.useState)(Object(u.a)(Object(u.a)({},Object(x.i)()),{},{page:1,per_page:20,name:""})),Vn=Object(f.a)(ri,2),_n=Vn[0],jn=Vn[1];function dn(yt){var Wt=yt.target.id;qt(Wt)}Object(a.useEffect)(function(){var yt=re.a.subscribe("to-commit-info",function(){qt("1")});return yt},[]);function pn(){qt("2")}function mn(){return zt.apply(this,arguments)}function zt(){return zt=Object(D.a)(r.a.mark(function yt(){var Wt;return r.a.wrap(function($t){for(;;)switch($t.prev=$t.next){case 0:return $t.next=2,Object(vt.a)("/api/problems/my_hack_list.json",{method:"get",params:Object(u.a)({identifier:_n==null?void 0:_n.id},_n)});case 2:Wt=$t.sent,Hn(Wt);case 4:case"end":return $t.stop()}},yt)})),zt.apply(this,arguments)}return console.log(Ue,"submitRecords"),n.a.createElement("div",{className:Ye.a["left-panel"]},n.a.createElement("ul",{className:"".concat(Ye.a["s-navs"]," ").concat(Ye.a["bg-white"]," ").concat(Ye.a.b1)},n.a.createElement("li",null,n.a.createElement("a",{className:Tt==="0"?Ye.a.active:"",id:"0",onClick:dn},"\u4EFB\u52A1\u63CF\u8FF0")),n.a.createElement("li",null,n.a.createElement("a",{className:Tt==="1"?Ye.a.active:"",id:"1",onClick:dn},"\u63D0\u4EA4\u8BB0\u5F55")),Zt.query.type!=="exercises"&&n.a.createElement("li",null,n.a.createElement("a",{className:Tt==="2"?Ye.a.active:"",id:"2",onClick:dn},"\u8BC4\u8BBA"))),n.a.createElement("div",{className:"".concat(Ye.a["tab-panel-body"]," ").concat(Tt==="0"?"":"hide")},n.a.createElement(ce,{hack:ee,onTriggerPraise:X,toDiscuss:pn})),n.a.createElement("div",{style:{padding:"0 12px"},className:"".concat(Ye.a["tab-panel-body"]," ").concat(Tt==="1"?"":"hide")},!!(Ue!=null&&Ue.records_count)||mt?n.a.createElement(kt,{page:Ve,onPageChange:ot,topicId:ye,submitting:mt,submitRecords:Ue,submitResult:Rt}):n.a.createElement(Ot.a,null)),n.a.createElement("div",{className:"".concat(Ye.a["tab-panel-body"]," ").concat(Tt==="2"?"":"hide"),style:{padding:0}},n.a.createElement(Ct,{user:ht,identifier:ee.identifier,hack:ee,onTriggerPraise:X})),n.a.createElement(we.a,{className:Ye.a.drawer,headerStyle:{background:"#000",border:0},closable:!1,title:n.a.createElement("div",{style:{display:"flex",alignItems:"center"}},n.a.createElement("span",{style:{color:"#fff"}},"\u9898\u76EE\u5217\u8868"),n.a.createElement(le.a.Search,{onSearch:function(Wt){_n.name=Wt,_n.page=1,jn(Object(u.a)({},_n)),mn()},style:{width:180,margin:"0px 20px",marginLeft:"auto"},placeholder:"\u8BF7\u8F93\u5165\u9898\u76EE\u540D\u79F0\u641C\u7D22"}),n.a.createElement(z.a,{style:{width:100},placeholder:"\u8BF7\u9009\u62E9\u96BE\u5EA6",onChange:function(Wt){_n.page=1,_n.difficult=Wt||null,jn(Object(u.a)({},_n)),mn()}},n.a.createElement(z.a.Option,{value:0},"\u5168\u90E8"),n.a.createElement(z.a.Option,{value:1},"\u7B80\u5355"),n.a.createElement(z.a.Option,{value:2},"\u9002\u4E2D"),n.a.createElement(z.a.Option,{value:3},"\u56F0\u96BE"))),bodyStyle:{background:"#0f1e31",padding:"20px 0px"},footerStyle:{background:"#0f1e31",border:0,textAlign:"center"},footer:n.a.createElement("div",null,n.a.createElement(oe.a,{current:_n.page,className:"mt10 mb10",hideOnSinglePage:!0,total:In==null?void 0:In.count,pageSize:_n.per_page,onChange:function(Wt,pt){_n.page=Wt,_n.per_page=pt,mn()}})),width:530,placement:"left",onClose:function(){return On(!1)},visible:wn},In==null||((j=In.data)===null||j===void 0)?void 0:j.map(function(yt,Wt){return n.a.createElement("div",{onClick:Object(D.a)(r.a.mark(function pt(){var $t;return r.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:return Xn.next=2,Object(vt.a)("/api/problems/".concat(yt==null?void 0:yt.identifier,"/start.json"),{method:"get",params:{hack_user_id:ht==null?void 0:ht.user_id}});case 2:$t=Xn.sent,$t&&(At.d.replace("/myproblems/".concat($t==null?void 0:$t.identifier,"?type=1")),window.location.reload());case 4:case"end":return Xn.stop()}},pt)})),className:"".concat(Ye.a.list," ").concat(yt!=null&&yt.checked?Ye.a.active:"")},n.a.createElement("div",null,(yt==null?void 0:yt.opened)&&(yt==null?void 0:yt.passed)&&n.a.createElement("i",{className:"iconfont icon-wancheng1 c-green-29b"}),(yt==null?void 0:yt.opened)&&!(yt!=null&&yt.passed)&&n.a.createElement("i",{className:"iconfont icon-cuowu c-red"}),n.a.createElement("span",{style:{color:"rgb(186, 196, 205)",fontWeight:400,fontSize:14,marginLeft:10}},yt.name)),n.a.createElement("span",{style:{color:yn[yt.difficult]}},cn[yt.difficult]))})),(ee==null?void 0:ee.is_program)&&n.a.createElement("div",{onClick:function(){mn(),On(!0)},className:Ye.a.btns},n.a.createElement("i",{className:"iconfont icon-timuliebiao"}),n.a.createElement("span",null,"\u9898\u76EE\u5217\u8868")))},Dt=W("oFv4"),Rn=W.n(Dt),Fn=W("+aKw"),Cn=W("S/kP"),Qt=W.n(Cn),Sn=W("t/PP"),Bn=W.n(Sn),li=s.a.Countdown,ct={Java:"java",C:"c",Python:"py","C++":"c"},St;(function(T){T[T.SET_LOADING=0]="SET_LOADING",T[T.GET_DATA=1]="GET_DATA",T[T.GET_SUBMIT_RECORDS=2]="GET_SUBMIT_RECORDS",T[T.SET_DATA=3]="SET_DATA",T[T.SET_DEBUGING=4]="SET_DEBUGING",T[T.SET_SUBMITING=5]="SET_SUBMITING",T[T.SET_EXECUTE_MESSAGE=6]="SET_EXECUTE_MESSAGE",T[T.SET_EXECUTE_RESULT=7]="SET_EXECUTE_RESULT",T[T.SET_SUBMIT_RESULT=8]="SET_SUBMIT_RESULT",T[T.SET_SHOW_NOTE=9]="SET_SHOW_NOTE",T[T.SET_PAGE=10]="SET_PAGE"})(St||(St={}));function zn(){return new Date().getTime()}var pi={loading:!0,data:void 0,showNote:!1,debugResult:void 0,submitResult:void 0,debuging:!1,submitting:!1,submitRecords:void 0,submitRecordPage:1,executingMessage:""};function ui(T,j){switch(j.type){case St.GET_DATA:return Object(u.a)(Object(u.a)({},T),j.payload);case St.SET_DATA:return Object(u.a)(Object(u.a)({},T),{},{data:j.payload});case St.SET_LOADING:return Object(u.a)(Object(u.a)({},T),{},{loading:j.payload});case St.SET_SHOW_NOTE:return Object(u.a)(Object(u.a)({},T),{},{showNote:j.payload});case St.SET_DEBUGING:return Object(u.a)(Object(u.a)({},T),{},{debuging:j.payload});case St.SET_SUBMITING:return Object(u.a)(Object(u.a)({},T),{},{submitting:j.payload});case St.GET_SUBMIT_RECORDS:return Object(u.a)(Object(u.a)({},T),{},{submitRecords:j.payload});case St.SET_PAGE:return Object(u.a)(Object(u.a)({},T),{},{submitRecordPage:j.payload});case St.SET_EXECUTE_MESSAGE:return Object(u.a)(Object(u.a)({},T),{},{executingMessage:j.payload});case St.SET_EXECUTE_RESULT:return Object(u.a)(Object(u.a)({},T),j.payload);case St.SET_SUBMIT_RESULT:return Object(u.a)(Object(u.a)({},T),j.payload);default:throw new Error}}var ki=Se.default=function(T){var j,ee,X,ye,Ve=T.children,ot=Object(a.useReducer)(ui,pi),ht=Object(f.a)(ot,2),Ue=ht[0],mt=ht[1],Rt=Object(x.i)(),Mt=Rt.id,Jt=Object(x.g)(),Tt=Object(x.h)(),qt=Ue.loading,Zt=Ue.data,Mn=Ue.debugResult,Gt=Ue.submitResult,wn=Ue.submitRecords,On=Ue.submitRecordPage,Ln=Ue.showNote,xn=Ue.debuging,In=Ue.submitting,Hn=Ue.executingMessage,ri=Object(a.useState)("#FFF"),Vn=Object(f.a)(ri,2),_n=Vn[0],jn=Vn[1],dn=Object(a.useState)(null),pn=Object(f.a)(dn,2),mn=pn[0],zt=pn[1],yt=Object(a.useState)({}),Wt=Object(f.a)(yt,2),pt=Wt[0],$t=Wt[1],Nt=Object(a.useState)(!0),Xn=Object(f.a)(Nt,2),sn=Xn[0],Zn=Xn[1],Ki=Object(a.useState)(!1),Ci=Object(f.a)(Ki,2),Vi=Ci[0],Ni=Ci[1],Ri=Object(a.useRef)(null),Gi=Object(a.useRef)(0),Kn=Zt==null?void 0:Zt.user,Ht=Zt==null?void 0:Zt.hack,Xi=Object(a.useRef)(),_i=Object(a.useRef)();Object(a.useEffect)(function(){var on;if(clearTimeout(Xi.current),clearTimeout(_i.current),pt!=null&&(on=pt.exercise)!==null&&on!==void 0&&on.left_time){var Bt,an;if((pt==null||((Bt=pt.exercise)===null||Bt===void 0)?void 0:Bt.left_time)>1800){var Pt;_i.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670930\u5206\u949F",icon:n.a.createElement(h.a,null),okText:"\u77E5\u9053\u4E86"})},((pt==null||((Pt=pt.exercise)===null||Pt===void 0)?void 0:Pt.left_time)-1800)*1e3)}if((pt==null||((an=pt.exercise)===null||an===void 0)?void 0:an.left_time)>900){var fn;Xi.current=setTimeout(function(){g.a.info({content:"\u5F53\u524D\u8DDD\u79BB\u8003\u8BD5\u7ED3\u675F\u8FD8\u670915\u5206\u949F",icon:n.a.createElement(h.a,null),okText:"\u77E5\u9053\u4E86"})},((pt==null||((fn=pt.exercise)===null||fn===void 0)?void 0:fn.left_time)-900)*1e3)}}},[pt]),Object(a.useEffect)(function(){function on(){return Bt.apply(this,arguments)}function Bt(){return Bt=Object(D.a)(r.a.mark(function an(){var Pt,fn,Pn,ei,Si,ti,vn,kn,Yi,Fi,$n,vi;return r.a.wrap(function(oi){for(;;)switch(oi.prev=oi.next){case 0:return Zn(!0),oi.next=3,Object(C.d)(Mt);case 3:if(Pt=oi.sent,setTimeout(function(){Zn(!1)},800),Pt.status===401)document.location.href="/user/login";else{try{Pt.hack.code=N.Base64.decode(Pt.hack.code)}catch(zi){console.log(zi)}Pt.hack=Object(u.a)(Object(u.a)({},Pt.hack),{},{is_program:(Tt==null||((fn=Tt.query)===null||fn===void 0)?void 0:fn.type)==="1"}),mt({type:St.GET_DATA,payload:{loading:!1,data:Pt}})}if(!(Tt.query.type==="exercises")){oi.next=18;break}if(!(Tt.query.coursesId=="coursesId")){oi.next=13;break}return oi.next=10,Object(b.Y)({categoryId:Tt.query.exercisesId,login:Tt.query.login});case 10:ti=oi.sent,oi.next=16;break;case 13:return oi.next=15,Object(b.z)({categoryId:Tt.query.exercisesId,login:Tt.query.login});case 15:ti=oi.sent;case 16:$t(Object(u.a)({},ti)),(Pn=ti)!==null&&Pn!==void 0&&Pn.left_banner_id&&(ei=ti)!==null&&ei!==void 0&&(Si=ei.exercise)!==null&&Si!==void 0&&Si.left_time&&(zt(Date.now()+((vn=ti)===null||vn===void 0||((kn=vn.exercise)===null||kn===void 0)?void 0:kn.left_time)*1e3),setTimeout(function(){jn("red")},(((Yi=ti)===null||Yi===void 0||((Fi=Yi.exercise)===null||Fi===void 0)?void 0:Fi.left_time)-300>0?(($n=ti)===null||$n===void 0||((vi=$n.exercise)===null||vi===void 0)?void 0:vi.left_time)-300:0)*1e3));case 18:case"end":return oi.stop()}},an)})),Bt.apply(this,arguments)}Mt&&on()},[Mt]),Object(a.useEffect)(function(){return Tt.query.type==="exercises"&&(window.addEventListener(Object(v.c)(),Ft),window.focus(),window.onblur=function(){Object(v.a)()&&Object(v.b)()}),function(){document.removeEventListener(Object(v.c)(),Ft)}},[Mt]),Object(a.useEffect)(function(){Mt&&Ht!==null&&Ht!==void 0&&Ht.language&&Xt()},[Mt,On,Ht==null?void 0:Ht.language]),Object(a.useEffect)(function(){return Ht!=null&&Ht.is_program&&(Gi.current=0,Ri.current=setInterval(function(){nr()},15e3)),function(){clearInterval(Ri.current)}},[Ht==null?void 0:Ht.is_program]);var nr=function(){var on=Object(D.a)(r.a.mark(function Bt(){var an;return r.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(vt.a)("/api/myproblems/".concat(Mt,"/save_long_time.json"),{method:"get",params:{answer_long_time:Gi.current}});case 2:an=fn.sent;case 3:case"end":return fn.stop()}},Bt)}));return function(){return on.apply(this,arguments)}}(),Ft=function(){window.parent.postMessage("backExercise","*")};function Xt(){return Kt.apply(this,arguments)}function Kt(){return Kt=Object(D.a)(r.a.mark(function on(){var Bt;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.prev=0,Pt.next=3,Object(C.f)(Mt,{limit:15,page:On,language:Ht==null?void 0:Ht.language});case 3:Bt=Pt.sent,mt({type:St.GET_SUBMIT_RECORDS,payload:Bt}),Pt.next=10;break;case 7:Pt.prev=7,Pt.t0=Pt.catch(0),console.log(Pt.t0);case 10:case"end":return Pt.stop()}},on,null,[[0,7]])})),Kt.apply(this,arguments)}function tn(on){mt({type:St.SET_PAGE,payload:on})}function rn(){return Tn.apply(this,arguments)}function Tn(){return Tn=Object(D.a)(r.a.mark(function on(){var Bt;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(C.k)(Mt,{code:N.Base64.encode(Ht.code),language:Ht==null?void 0:Ht.language});case 2:return Bt=Pt.sent,Pt.abrupt("return",Bt);case 4:case"end":return Pt.stop()}},on)})),Tn.apply(this,arguments)}function ln(){return Un.apply(this,arguments)}function Un(){return Un=Object(D.a)(r.a.mark(function on(){var Bt,an,Pt,fn,Pn,ei,Si,ti;return r.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:if(!In){kn.next=2;break}return kn.abrupt("return");case 2:return mt({type:St.SET_SUBMITING,payload:!0}),kn.prev=3,re.a.publish("to-commit-info"),kn.next=7,rn();case 7:if(Bt=kn.sent,console.log(Bt,1),!(Bt.status===0)){kn.next=23;break}return ti=function(){return ti=Object(D.a)(r.a.mark(function Fi(){var $n,vi,wi,oi,zi,Cr,Bi;return r.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,Object(C.c)(Mt,"submit");case 2:if($n=Ei.sent,vi=$n.status,wi=$n.data,oi=zn(),zi=oi-ei>(Pn+3)*1e3,vi!==0&&!zi&&setTimeout(Si,1e3),!zi){Ei.next=12;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),mt({type:St.SET_SUBMITING,payload:!1}),Ei.abrupt("return");case 12:if(!(vi===0)){Ei.next=19;break}return wi.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8BC4\u6D4B\u4EE3\u7801\u8D85\u65F6"}),(wi==null?void 0:wi.status)===0&&(Tt==null||((Cr=Tt.query)===null||Cr===void 0)?void 0:Cr.type)==="1"&&Ni(!0),Ei.next=17,Object(C.f)(Mt,{limit:15,page:On,language:Ht==null?void 0:Ht.language});case 17:Bi=Ei.sent,mt({type:St.SET_SUBMIT_RESULT,payload:Object(u.a)(Object(u.a)({},Ue),{},{submitResult:wi,submitting:!1,submitRecords:Bi})});case 19:case"end":return Ei.stop()}},Fi)})),ti.apply(this,arguments)},Si=function(){return ti.apply(this,arguments)},Pt={},Tt.query.type==="exercises"&&(Pt.extras={exercise_id:Tt.query.exercisesId,question_id:Tt.query.questionId}),kn.next=16,Object(C.h)(Mt,Pt);case 16:if(fn=kn.sent,!(fn.status===-1&&Tt!==null&&Tt!==void 0&&(an=Tt.query)!==null&&an!==void 0&&an.coursesId)){kn.next=20;break}return window.parent.location.href="/classrooms/".concat(Tt.query.coursesId,"/exercise/").concat(Tt.query.exercisesId,"/detail"),kn.abrupt("return");case 20:Pn=Ht.time_limit,ei=zn(),Si();case 23:kn.next=29;break;case 25:kn.prev=25,kn.t0=kn.catch(3),console.log(kn.t0),mt({type:St.SET_SUBMITING,payload:!1});case 29:case"end":return kn.stop()}},on,null,[[3,25]])})),Un.apply(this,arguments)}function ai(){return nn.apply(this,arguments)}function nn(){return nn=Object(D.a)(r.a.mark(function on(){var Bt,an,Pt,fn,Pn,ei,Si;return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return Ue.debuging=!0,mt({type:St.SET_DEBUGING,payload:!0}),vn.prev=2,vn.next=5,rn();case 5:if(Bt=vn.sent,!(Bt.status===0)){vn.next=22;break}return Si=function(){return Si=Object(D.a)(r.a.mark(function Yi(){var Fi,$n,vi,wi,oi,zi;return r.a.wrap(function(Bi){for(;;)switch(Bi.prev=Bi.next){case 0:return Bi.next=2,Object(C.c)(Mt,"debug");case 2:if(Fi=Bi.sent,$n=Fi.status,vi=Fi.message,wi=Fi.data,oi=zn(),zi=oi-Pn>(an+3)*1e3,$n!==0&&!zi&&(mt({type:St.SET_EXECUTE_MESSAGE,payload:vi}),setTimeout(ei,1e3)),!zi){Bi.next=13;break}return g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),mt({type:St.SET_DEBUGING,payload:!1}),Bi.abrupt("return");case 13:$n===0&&(mt({type:St.SET_DEBUGING,payload:!1}),wi.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),wi.status===2&&g.a.error({centered:!0,okText:"\u77E5\u9053\u5566",content:"\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"}),mt({type:St.SET_EXECUTE_RESULT,payload:Object(u.a)(Object(u.a)({},Ue),{},{debugResult:wi,debuging:!1})}));case 14:case"end":return Bi.stop()}},Yi)})),Si.apply(this,arguments)},ei=function(){return Si.apply(this,arguments)},an=Ht.time_limit,Pt={input:encodeURIComponent(Zt.test_case.input)},Tt.query.type==="exercises"&&(Pt.exercise_id=Tt.query.exercisesId),vn.next=14,Object(C.b)(Mt,Pt);case 14:if(fn=vn.sent,!(fn.status===-1&&Tt.query.coursesId)){vn.next=18;break}return window.parent.location.href="/classrooms/".concat(Tt.query.coursesId,"/exercise/").concat(Tt.query.exercisesId,"/detail"),vn.abrupt("return");case 18:Pn=zn(),ei(),vn.next=23;break;case 22:mt({type:St.SET_DEBUGING,payload:!1});case 23:vn.next=28;break;case 25:vn.prev=25,vn.t0=vn.catch(2),console.log(vn.t0);case 28:return vn.prev=28,vn.finish(28);case 30:case"end":return vn.stop()}},on,null,[[2,25,28,30]])})),nn.apply(this,arguments)}function bi(on){mt({type:St.SET_DATA,payload:Object(u.a)(Object(u.a)({},Zt),{},{hack:Object(u.a)(Object(u.a)({},Ht),{},{code:on})})})}var bn=function(){var on=Object(D.a)(r.a.mark(function Bt(an){var Pt,fn;return r.a.wrap(function(ei){for(;;)switch(ei.prev=ei.next){case 0:return ei.next=2,Object(vt.a)("/api/problems/".concat(Ht==null?void 0:Ht.identifier,"/start.json"),{method:"get",params:{language:an==="C++"||an==="c++"?encodeURIComponent(an):an,hack_user_id:Kn==null?void 0:Kn.user_id}});case 2:Pt=ei.sent,Pt.status!==-1&&Jt.replace("/myproblems/".concat(Pt==null?void 0:Pt.identifier,"?type=").concat(Tt==null||((fn=Tt.query)===null||fn===void 0)?void 0:fn.type));case 4:case"end":return ei.stop()}},Bt)}));return function(an){return on.apply(this,arguments)}}();function Qn(on){var Bt=on.target.value;mt({type:St.SET_DATA,payload:Object(u.a)(Object(u.a)({},Zt),{},{test_case:{input:Bt}})})}function qn(){return mi.apply(this,arguments)}function mi(){return mi=Object(D.a)(r.a.mark(function on(){var Bt;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.prev=0,Pt.next=3,Object(C.g)(Mt);case 3:Bt=Pt.sent,Bt.status===401?Jt.replace("/login",{from:Tt.pathname}):bi(N.Base64.decode(Bt.code)),Pt.next=10;break;case 7:Pt.prev=7,Pt.t0=Pt.catch(0),console.log(Pt.t0);case 10:case"end":return Pt.stop()}},on,null,[[0,7]])})),mi.apply(this,arguments)}function Wr(){g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("p",null,"\u521D\u59CB\u4EE3\u7801\u6709\u4FEE\u6539\uFF0C\u66F4\u65B0\u540E\u5C06\u8986\u76D6\u73B0\u6709\u4EE3\u7801\u54E6~ ",n.a.createElement("br",null),"\u8BF7\u5C06\u60A8\u7F16\u8F91\u7684\u4EE3\u7801\u4FDD\u5B58\u81F3\u672C\u5730\uFF0C\u4EE5\u9632\u4E22\u5931"),onOk:function(){return Object(D.a)(r.a.mark(function Bt(){var an;return r.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(C.i)(Mt);case 2:an=fn.sent,an.status===401?Jt.replace("/login",{from:Tt.pathname}):bi(N.Base64.decode(an.code));case 4:case"end":return fn.stop()}},Bt)}))()}})}function En(){mt({type:St.SET_SHOW_NOTE,payload:!0})}function hn(){mt({type:St.SET_SHOW_NOTE,payload:!1})}function gn(on){return gi.apply(this,arguments)}function gi(){return gi=Object(D.a)(r.a.mark(function on(Bt){return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(C.a)(Mt,Bt);case 2:mt({type:St.GET_DATA,payload:{showNote:!1,data:Object(u.a)(Object(u.a)({},Zt),{},{hack:Object(u.a)(Object(u.a)({},Ht),{},{notes:Bt.notes})})}});case 3:case"end":return Pt.stop()}},on)})),gi.apply(this,arguments)}var Qi={hack:Ht,isLoading:sn,input:Zt==null||((j=Zt.test_case)===null||j===void 0)?void 0:j.input,language:Ht==null?void 0:Ht.language,code:Ht==null?void 0:Ht.code,title:"main."+ct[Ht==null?void 0:Ht.language],modify_code:Ht==null?void 0:Ht.modify_code,notes:Ht==null?void 0:Ht.notes,debugResult:Mn,debuging:xn,submitting:In,executingMessage:Hn,onCancelNote:hn,onAddNote:gn,showNote:Ln,user:Kn,onShowNote:En,onSubmitCode:ln,onChangeCode:bi,onChangeInput:Qn,onDebugCode:ai,onResetCode:qn,onSyncCode:Wr,onUpdateCode:rn,onChangeLanguage:bn};function qi(){return ir.apply(this,arguments)}function ir(){return ir=Object(D.a)(r.a.mark(function on(){var Bt,an,Pt;return r.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:return Pn.next=2,Object(C.j)(Ht.id,{container_type:"Hack",type:1});case 2:Bt=Pn.sent,an=Bt.praise_count,Pt=Object(u.a)(Object(u.a)({},Zt),{},{hack:Object(u.a)(Object(u.a)({},Ht),{},{praises_count:an,user_praise:!Ht.user_praise})}),mt({type:St.SET_DATA,payload:Pt});case 6:case"end":return Pn.stop()}},on)})),ir.apply(this,arguments)}var Tr={topicId:Mt,submitResult:Gt,submitRecords:wn,submitting:In,page:On,onPageChange:tn,hack:Ht,user:Zt==null?void 0:Zt.user,onTriggerPraise:qi};return n.a.createElement(n.a.Fragment,null,n.a.createElement(L.a,{spinning:qt,delay:500},Zt?n.a.createElement(n.a.Fragment,null,n.a.createElement("header",{className:$.a.header},Tt.query.type!=="exercises"&&n.a.createElement("div",null,n.a.createElement("img",{src:"".concat(c.a.IMG_SERVER,"/images/").concat(Kn.image_url),alt:"user",width:30}),n.a.createElement("span",null,Kn.name)),n.a.createElement("h2",{className:"flex-wrp flex_box_column flex_box_center"},n.a.createElement("div",null,Ht.name),(Ht==null?void 0:Ht.is_program)&&n.a.createElement(Fn.a,{defaultValue:Ht==null?void 0:Ht.answer_long_time,onChange:function(Bt){console.log(Bt),Gi.current=Bt},className:"font12 c-grey-999"})),Kn.hack_manager?n.a.createElement(A.a,{className:$.a.btn_back,to:(Tt==null||((ee=Tt.query)===null||ee===void 0)?void 0:ee.type)==="1"?"/problems/".concat(Ht.identifier,"/edit?type=1"):"/problems/".concat(Ht.identifier,"/edit"),style:{marginRight:10}}," ",n.a.createElement(O.a,null)," \u7F16\u8F91"):null,(pt==null||((X=pt.exercise)===null||X===void 0)?void 0:X.left_time)&&n.a.createElement(n.a.Fragment,null,n.a.createElement("span",{style:{color:_n},className:"iconfont icon-kaoshishichang mr5"}),n.a.createElement("span",{className:"c-white mr20"},n.a.createElement(li,{valueStyle:{color:_n,fontSize:16,fontWeight:"normal"},title:n.a.createElement("span",{style:{color:_n,fontSize:16}},"\u5269\u4F59\u65F6\u95F4\uFF1A"),value:mn,onFinish:Object(D.a)(r.a.mark(function on(){var Bt,an;return r.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:return fn.next=2,Object(b.Z)({categoryId:Tt.query.exercisesId,commit_method:2});case 2:Bt=fn.sent,(Bt==null?void 0:Bt.status)===0&&(rn(),g.a.info({width:530,title:"\u63D0\u793A",centered:!0,okText:"\u786E\u5B9A",content:n.a.createElement("div",{className:"tc font16"},"\u7B54\u9898\u7ED3\u675F\u4E86\uFF0C\u7CFB\u7EDF\u5DF2\u81EA\u52A8\u63D0\u4EA4\u8BD5\u5377",n.a.createElement("br",null),"\u4E0D\u80FD\u518D\u4FEE\u6539\u7B54\u9898"),onOk:function(){var Pn=Object(D.a)(r.a.mark(function Si(){return r.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:window.parent.location.href="/classrooms/".concat(Tt.query.coursesId,"/exercise/").concat(Tt.query.exercisesId,"/detail");case 1:case"end":return vn.stop()}},Si)}));function ei(){return Pn.apply(this,arguments)}return ei}()})),(Bt==null?void 0:Bt.status)===-3&&(an=parseInt(Bt==null?void 0:Bt.message),zt(Date.now()+an*1e3));case 5:case"end":return fn.stop()}},on)}))}))),(Tt==null||((ye=Tt.query)===null||ye===void 0)?void 0:ye.type)==="exercises"?n.a.createElement(F.a,{type:"primary",onClick:function(){rn(),g.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:n.a.createElement("div",{className:"tc"},"\u8BF7\u786E\u8BA4\u4F60\u7684\u7B54\u9898\u5185\u5BB9\u5DF2\u7ECF\u63D0\u4EA4\uFF1F"),onOk:function(){Ft()}})}},n.a.createElement("span",{className:"iconfont icon-yiguanbi mr5 font14"})," \u8FD4\u56DE\u8BD5\u5377"):n.a.createElement("span",{className:$.a.btn_back,onClick:function(){var Bt;if((Tt==null||((Bt=Tt.query)===null||Bt===void 0)?void 0:Bt.type)==="1"){var an,Pt=(an=localStorage.getItem("program_homework"))===null||an===void 0?void 0:an.split(",");Jt.push("/classrooms/".concat(Pt==null?void 0:Pt[0],"/program_homework/").concat(Pt==null?void 0:Pt[1],"/detail"))}else Jt.push("/problemset")}}," ",n.a.createElement(S.a,null),"\u9000\u51FA")),n.a.createElement(L.a,{size:"large",spinning:sn},n.a.createElement(p.a,{className:"my-problems",leftChild:n.a.createElement(en,Tr),rightChild:n.a.createElement(w,Qi)}))):null,n.a.createElement(g.a,{centered:!0,closable:!1,width:680,footer:null,visible:Vi,className:"oj-modal"},n.a.createElement("section",{className:"oj-modal-content"},n.a.createElement("div",{className:"oj-modal-head"},n.a.createElement("img",{src:Rn.a,alt:""}),n.a.createElement("i",{onClick:function(){return Ni(!1)},className:"iconfont icon-guanbi1"})),n.a.createElement("aside",null,n.a.createElement("img",{className:"mr30",src:Bn.a}),"\u8FD0\u884C\u65F6\u95F4:\xA0",n.a.createElement("span",{style:{color:"#75d6ba",marginRight:100}},Gt==null?void 0:Gt.execute_time,"ms"),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Gt==null?void 0:Gt.time_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("aside",{className:"mb50"},n.a.createElement("img",{src:Qt.a,className:"mr30"}),n.a.createElement("span",{className:"oj-modal-tt"},n.a.createElement("span",null,n.a.createElement("span",null,"\u5360\u7528\u5185\u5B58:\xA0"),n.a.createElement("span",{className:"c-light-primary"},Gt==null?void 0:Gt.execute_memory,"kb")),n.a.createElement("span",null,n.a.createElement("span",null))),"\u4F18\u4E8E",n.a.createElement("span",{style:{color:"#f3b087",margin:"0 5px"}},(Gt==null?void 0:Gt.memory_better_than)||100,"%"),"\u7684\u7528\u6237"),n.a.createElement("div",{id:"oj-modal-next",onClick:Object(D.a)(r.a.mark(function on(){var Bt,an,Pt;return r.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(!(Gt!=null&&Gt.next_identifier)){Pn.next=7;break}return Pn.next=3,Object(vt.a)("/api/problems/".concat(Gt==null?void 0:Gt.next_identifier,"/start.json"),{method:"get",params:{hack_user_id:Kn==null?void 0:Kn.user_id}});case 3:Bt=Pn.sent,Bt&&(Jt.replace("/myproblems/".concat(Bt==null?void 0:Bt.identifier,"?type=1")),window.location.reload()),Pn.next=9;break;case 7:Pt=(an=localStorage.getItem("program_homework"))===null||an===void 0?void 0:an.split(","),Jt.push("/classrooms/".concat(Pt==null?void 0:Pt[0],"/program_homework/").concat(Pt==null?void 0:Pt[1],"/detail"));case 9:case"end":return Pn.stop()}},on)})),className:"oj-modal-btn"},Gt!=null&&Gt.next_identifier?"\u8FDB\u5165\u4E0B\u4E00\u9898":"\u56DE\u5230\u4F5C\u4E1A\u8BE6\u60C5\u9875")))))};function J(T){var j,ee=T.title,X=T.modify_code,ye=T.onSyncCode,Ve=T.onShowCodeSetting,ot=T.onResetCode,ht=T.hack,Ue=T.onChangeLanguage,mt=function(){g.a.confirm({title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",icon:n.a.createElement(E.a,null),content:"\u4F60\u5728\u672C\u6587\u4EF6\u4E2D\u4FEE\u6539\u7684\u5185\u5BB9\u5C06\u4E22\u5931\uFF0C\u662F\u5426\u786E\u5B9A\u91CD\u65B0\u52A0\u8F7D\u521D\u59CB\u4EE3\u7801\uFF1F",centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",onOk:ot})};return console.log(ht,"hack"),n.a.createElement("div",{className:"action-bar",style:{paddingLeft:0}},(ht==null?void 0:ht.is_program)&&n.a.createElement(z.a,{className:"oj-select",value:ht==null?void 0:ht.language,style:{width:100},placeholder:"\u9009\u62E9\u8BED\u8A00",onChange:Ue},ht==null||((j=ht.all_language)===null||j===void 0)?void 0:j.map(function(Rt){return n.a.createElement(z.a.Option,{key:Rt,value:Rt},Rt)})),n.a.createElement("span",null),X?n.a.createElement("a",{title:"\u66F4\u65B0\u901A\u77E5",onClick:ye},n.a.createElement("img",{src:P.a,alt:"notice"})):null,n.a.createElement("a",{title:"\u6062\u590D\u521D\u59CB\u4EE3\u7801",onClick:mt},n.a.createElement("i",{className:"iconfont icon-zhongzhi font-20 "})),n.a.createElement("a",{onClick:Ve},n.a.createElement("i",{className:"iconfont icon-shezhi"})))}function w(T){var j=T.input,ee=T.showNote,X=T.onShowNote,ye=T.notes,Ve=T.onCancelNote,ot=T.onAddNote,ht=T.debugResult,Ue=T.language,mt=T.debuging,Rt=T.submitting,Mt=T.executingMessage,Jt=T.code,Tt=T.onSubmitCode,qt=T.onDebugCode,Zt=T.onChangeCode,Mn=T.onChangeInput,Gt=T.onUpdateCode,wn=T.user,On=T.isLoading,Ln=Object(V.a)(T,["input","showNote","onShowNote","notes","onCancelNote","onAddNote","debugResult","language","debuging","submitting","executingMessage","code","onSubmitCode","onDebugCode","onChangeCode","onChangeInput","onUpdateCode","user","isLoading"]);function xn(Hn){return n.a.createElement(J,Object(q.a)({},Ln,{onShowCodeSetting:Hn}))}var In=Object(u.a)({input:j,debugResult:ht,debuging:mt,submitting:Rt,executingMessage:Mt,onDebugCode:qt,onChangeCode:Zt,onSubmitCode:Tt,onChangeInput:Mn,user:wn},Ln);return n.a.createElement("div",{className:"right-panel"},n.a.createElement(y.a,{isLoading:On,language:Ue,value:Jt,onChange:Zt,ActionBarRender:xn}),n.a.createElement("div",{className:"note-form-area ".concat(ee?"active":"")},n.a.createElement(Ee,{onCancel:Ve,notes:ye,callback:ot})),n.a.createElement(R.b,In))}},RELg:function(Fe,Se,W){var q=W("MFOe"),V=q.Global;Fe.exports={name:"oldIE-userDataStorage",write:H,read:F,each:D,remove:I,clearAll:g};var M="storejs",z=V.document,U=d(),L=(V.navigator?V.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function H(s,l){if(L)return;var r=u(s);U(function(a){a.setAttribute(r,l),a.save(M)})}function F(s){if(L)return;var l=u(s),r=null;return U(function(a){r=a.getAttribute(l)}),r}function D(s){U(function(l){for(var r=l.XMLDocument.documentElement.attributes,a=r.length-1;a>=0;a--){var n=r[a];s(l.getAttribute(n.name),n.name)}})}function I(s){var l=u(s);U(function(r){r.removeAttribute(l),r.save(M)})}function g(){U(function(s){var l=s.XMLDocument.documentElement.attributes;s.load(M);for(var r=l.length-1;r>=0;r--)s.removeAttribute(l[r].name);s.save(M)})}var f=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function u(s){return s.replace(/^\d/,"___$&").replace(f,"___")}function d(){if(!z||!z.documentElement||!z.documentElement.addBehavior)return null;var s="script",l,r,a;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+s+">document.w=window"+s+'>'),r.close(),l=r.w.frames[0].document,a=l.createElement("div")}catch(n){a=z.createElement("div"),l=z.body}return function(n){var h=[].slice.call(arguments,0);h.unshift(a),l.appendChild(a),a.addBehavior("#default#userData"),a.load(M),n.apply(this,h),l.removeChild(a);return}}},"S+dL":function(Fe,Se){Fe.exports="data:image/gif;base64,R0lGODlhFAAQAOZVAD6Q33p6ezZto2VnaW5vcDuCxiYvNysvM1tdXzNij5eXlyg0QTA0OExOUWZnaS8zN19hYzFYf0Oi/Sg1QoeHh2JjZWZoaTdzrTRmljl5tzFZgDBWez6P3Tl4tjl8uzdxqWBiYys/VCUqL39/gHV2dy4yNScyPDJeiEpNTzk8P0CX6jc7PiYuNWlqaywwNDZtojAzNytDWScrLitAVUGb8Xl6eoWFhTp+wDNgjWRmZ4+QkFdZWzo9QIODgyo/Uzh3syg0QCczPmprbTRllW9wcSotMVJUVjZupDuEylBSVUGb8kxPUZGRkTd0rUGc82JkZUKe9j2M1zg7P4iIiEOj/yUpLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6N0U3Nzk1NkY5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6N0U3Nzk1NzA5QkRGMTFFQUIzQzFDQjY5MEVFODZDMDciPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo3RTc3OTU2RDlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo3RTc3OTU2RTlCREYxMUVBQjNDMUNCNjkwRUU4NkMwNyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUyAFUALAAAAAAUABAAAAd5gFWCg4RSLoSIiVUPFlNEhAwDCIoyST1TUwGCBwM6AweJPCSYmJpVCAMMgykgFRUtFKSlilVCsreZtAS4sqaJu7yzisDBvhAKyBDEvL6Iy7jNhA7BwoklKA0NRiO30bRFOzakpqiqtItPsTWbA0wWoOcrOUuEMA6TgQAh+QQFMgBVACwAAAAAFAAQAAAHeIBVgoOEISaEiIlVExlUSIQLAgmKIidOVFQAggYCNAIGiTFRmJiaVQkCC4MzHxcXHhKkpYpVN7K3mbQFuLKmibu8s4rAwb4YpBjEvL6IyrjMhB3BwolBGxEROCq30LQsQ1CkpqiqtItNsRybAkpHoOY+PxqEQC+TgQA7"},"S/kP":function(Fe,Se,W){Fe.exports=W.p+"static/time.a3dc82f3.svg"},"SA+Z":function(Fe,Se,W){var q=W("wTVA"),V=W("EbDI"),M=W("ZhPi"),z=W("wkBT");function U(L){return q(L)||V(L)||M(L)||z()}Fe.exports=U,Fe.exports.__esModule=!0,Fe.exports.default=Fe.exports},SJMd:function(Fe,Se){/**
* @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 W,q,V,M=!1,z,U;window.PR_SHOULD_USE_CONTINUATION=!0;var L,H;(function(){var F=window,D=["break,continue,do,else,for,if,return,while"],I=[D,"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"],g=[I,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[g,"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"],u=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],d=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",l=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],r="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",a=[D,"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"],n=[D,"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"],h=[D,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],O=[f,d,u,l,r,a,n,h],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,x="str",A="kwd",C="com",b="typ",v="lit",p="pun",c="pln",E="tag",y="dec",_="src",P="atn",N="atv",K="nocode",$="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function B(He){for(var $e=0,Qe=!1,gt=!1,et=0,tt=He.length;et122||(re<65||ce>90||Ge.push([Math.max(65,ce)|32,Math.min(re,90)|32]),re<97||ce>122||Ge.push([Math.max(97,ce)&~32,Math.min(re,122)&~32]))}}Ge.sort(function(be,Ie){return be[0]-Ie[0]||Ie[1]-be[1]});for(var ae=[],ue=[],je=0;jefe[0]&&(fe[1]+1>fe[0]&&Re.push("-"),Re.push(Et(fe[1])))}return Re.push("]"),Re.join("")}function kt(Ae){for(var Ce=Ae.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")),Ge=Ce.length,ze=[],Re=0,je=0;Re=2&&ce==="["?Ce[Re]=xt(ge):ce!=="\\"&&(Ce[Re]=ge.replace(/[a-zA-Z]/g,function(ue){var fe=ue.charCodeAt(0);return"["+String.fromCharCode(fe&~32,fe|32)+"]"}))}return Ce.join("")}for(var Ot=[],et=0,tt=He.length;et=0;)Qe[Ot.charAt(Ae)]=kt;var Ce=kt[1],Ge=""+Ce;wt.hasOwnProperty(Ge)||(vt.push(Ce),wt[Ge]=null)}vt.push(/[\0-\uffff]/),gt=B(vt)})();var et=$e.length,tt=function(Je){for(var vt=Je.sourceCode,wt=Je.basePos,Et=Je.sourceNode,xt=[wt,c],kt=0,Ot=vt.match(gt)||[],Ae={},Ce=0,Ge=Ot.length;Ce=5&&Re.substring(0,5)==="lang-",ge&&!(je&&typeof je[1]=="string")&&(ge=!1,Re=_),ge||(Ae[ze]=Re)}var re=kt;if(kt+=ze.length,!ge)xt.push(wt+re,Re);else{var ae=je[1],ue=ze.indexOf(ae),fe=ue+ae.length;je[2]&&(fe=ze.length-je[2].length,ue=fe-ae.length);var be=Re.substring(5);G(Et,wt+re,ze.substring(0,ue),tt,xt),G(Et,wt+re+ue,ae,oe(be,ae),xt),G(Et,wt+re+fe,ze.substring(fe),tt,xt)}}Je.decorations=xt};return tt}function _e(He){var $e=[],Qe=[];He.tripleQuotedStrings?$e.push([x,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):He.multiLineStrings?$e.push([x,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):$e.push([x,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),He.verbatimStrings&&Qe.push([x,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var gt=He.hashComments;gt&&(He.cStyleComments?(gt>1?$e.push([C,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):$e.push([C,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Qe.push([x,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):$e.push([C,/^#[^\r\n]*/,null,"#"])),He.cStyleComments&&(Qe.push([C,/^\/\/[^\r\n]*/,null]),Qe.push([C,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var et=He.regexLiterals;if(et){var tt=et>1?"":`
\r`,Je=tt?".":"[\\S\\s]",vt="/(?=[^/*"+tt+"])(?:[^/\\x5B\\x5C"+tt+"]|\\x5C"+Je+"|\\x5B(?:[^\\x5C\\x5D"+tt+"]|\\x5C"+Je+")*(?:\\x5D|$))+/";Qe.push(["lang-regex",RegExp("^"+$+"("+vt+")")])}var wt=He.types;wt&&Qe.push([b,wt]);var Et=(""+He.keywords).replace(/^ | $/g,"");Et.length&&Qe.push([A,new RegExp("^(?:"+Et.replace(/[\s,]+/g,"|")+")\\b"),null]),$e.push([c,/^\s+/,null,` \r
\xA0`]);var xt="^.[^\\s\\w.$@'\"`/\\\\]*";return He.regexLiterals&&(xt+="(?!s*/)"),Qe.push([v,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[v,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[p,new RegExp(xt),null]),le($e,Qe)}var pe=_e({keywords:O,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Ee(He,$e,Qe){for(var gt=/(?:^|\s)nocode(?:\s|$)/,et=/\r\n?|\n/,tt=He.ownerDocument,Je=tt.createElement("li");He.firstChild;)Je.appendChild(He.firstChild);var vt=[Je];function wt(Ce){var Ge=Ce.nodeType;if(Ge==1&&!gt.test(Ce.className))if(Ce.nodeName==="br")Et(Ce),Ce.parentNode&&Ce.parentNode.removeChild(Ce);else for(var ze=Ce.firstChild;ze;ze=ze.nextSibling)wt(ze);else if((Ge==3||Ge==4)&&Qe){var Re=Ce.nodeValue,je=Re.match(et);if(je){var ge=Re.substring(0,je.index);Ce.nodeValue=ge;var de=Re.substring(je.index+je[0].length);if(de){var ce=Ce.parentNode;ce.insertBefore(tt.createTextNode(de),Ce.nextSibling)}Et(Ce),ge||Ce.parentNode.removeChild(Ce)}}}function Et(Ce){for(;!Ce.nextSibling;)if(Ce=Ce.parentNode,!Ce)return;function Ge(je,ge){var de=ge?je.cloneNode(!1):je,ce=je.parentNode;if(ce){var re=Ge(ce,1),ae=je.nextSibling;re.appendChild(de);for(var ue=ae;ue;ue=ae)ae=ue.nextSibling,re.appendChild(ue)}return de}for(var ze=Ge(Ce.nextSibling,0),Re;(Re=ze.parentNode)&&Re.nodeType===1;)ze=Re;vt.push(ze)}for(var xt=0;xt=ce&&(wt+=2),tt>=re&&(kt+=2)}}finally{Re&&(Re.style.display=je)}}var we={};function he(He,$e){for(var Qe=$e.length;--Qe>=0;){var gt=$e[Qe];we.hasOwnProperty(gt)?F.console&&console.warn("cannot override language handler %s",gt):we[gt]=He}}function oe(He,$e){return He&&we.hasOwnProperty(He)||(He=/^\s*]*(?:>|$)/],[C,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[p,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^