(window.webpackJsonp=window.webpackJsonp||[]).push([[194,5,6,7,8,21],{"+BqJ":function(kt,Ae,U){kt.exports={wrap:"wrap___25UhO",img:"img___2akIE",table:"table___3IRHj",totalScore:"totalScore___2JN2k",people:"people___1rT7q",glassSeal:"glassSeal___2gAyY"}},"+NIl":function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){"use strict";te.defineMode("stex",function(Q,B){"use strict";function J(a,d){a.cmdState.push(d)}function K(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function N(a){var d=a.cmdState.pop();d&&d.closeBracket()}function $(a){for(var d=a.cmdState,s=d.length-1;s>=0;s--){var i=d[s];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function z(a,d,s){return function(){this.name=a,this.bracketNo=0,this.style=d,this.styles=s,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=z("importmodule","tag",["string","builtin"]),r.documentclass=z("documentclass","tag",["","atom"]),r.usepackage=z("usepackage","tag",["atom"]),r.begin=z("begin","tag",["atom"]),r.end=z("end","tag",["atom"]),r.label=z("label","tag",["atom"]),r.ref=z("ref","tag",["atom"]),r.eqref=z("eqref","tag",["atom"]),r.cite=z("cite","tag",["atom"]),r.bibitem=z("bibitem","tag",["atom"]),r.Bibitem=z("Bibitem","tag",["atom"]),r.RBibitem=z("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(a,d){a.f=d}function p(a,d){var s;if(a.match(/^\\[a-zA-Z@]+/)){var i=a.current().slice(1);return s=r.hasOwnProperty(i)?r[i]:r.DEFAULT,s=new s,J(d,s),D(d,m),s.style}if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/\\]/))return"tag";if(a.match("\\["))return D(d,function(u,o){return g(u,o,"\\]")}),"keyword";if(a.match("\\("))return D(d,function(u,o){return g(u,o,"\\)")}),"keyword";if(a.match("$$"))return D(d,function(u,o){return g(u,o,"$$")}),"keyword";if(a.match("$"))return D(d,function(u,o){return g(u,o,"$")}),"keyword";var t=a.next();if(t=="%")return a.skipToEnd(),"comment";if(t=="}"||t=="]"){if(s=K(d),s)s.closeBracket(t),D(d,m);else return"error";return"bracket"}else return t=="{"||t=="["?(s=r.DEFAULT,s=new s,J(d,s),"bracket"):/\d/.test(t)?(a.eatWhile(/[\w.%]/),"atom"):(a.eatWhile(/[\w\-_]/),s=$(d),s.name=="begin"&&(s.argument=a.current()),s.styleIdentifier())}function g(a,d,s){if(a.eatSpace())return null;if(s&&a.match(s))return D(d,p),"keyword";if(a.match(/^\\[a-zA-Z@]+/))return"tag";if(a.match(/^[a-zA-Z]+/))return"variable-2";if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/]/))return"tag";if(a.match(/^[\^_&]/))return"tag";if(a.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(a.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=a.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(a.skipToEnd(),"comment"):"error"}function m(a,d){var s=a.peek(),i;return s=="{"||s=="["?(i=K(d),i.openBracket(s),a.eat(s),D(d,p),"bracket"):/[ \t\r]/.test(s)?(a.eat(s),null):(D(d,p),N(d),p(a,d))}return{startState:function(){var a=B.inMathMode?function(d,s){return g(d,s)}:p;return{cmdState:[],f:a}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,d){return d.f(a,d)},blankLine:function(a){a.f=p,a.cmdState.length=0},lineComment:"%"}}),te.defineMIME("text/x-stex","stex"),te.defineMIME("text/x-latex","stex")})},"+ua5":function(kt,Ae,U){},"/cxE":function(kt,Ae,U){"use strict";U.d(Ae,"f",function(){return B}),U.d(Ae,"g",function(){return J}),U.d(Ae,"h",function(){return K}),U.d(Ae,"e",function(){return $}),U.d(Ae,"b",function(){return z}),U.d(Ae,"c",function(){return r}),U.d(Ae,"d",function(){return D}),U.d(Ae,"a",function(){return p});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
`+g.stack):g},0)}}emit(g){this.listeners.forEach(m=>{m(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const Q=new te;function B(g){$(g)||Q.onUnexpectedError(g);return}function J(g){$(g)||Q.onUnexpectedExternalError(g);return}function K(g){if(g instanceof Error){let{name:m,message:a}=g;const d=g.stacktrace||g.stack;return{$isError:!0,name:m,message:a,stack:d}}return g}const N="Canceled";function $(g){return g instanceof Error&&g.name===N&&g.message===N}function z(){const g=new Error(N);return g.name=g.message,g}function r(g){return g?new Error(`Illegal argument: ${g}`):new Error("Illegal argument")}function D(g){return g?new Error(`Illegal state: ${g}`):new Error("Illegal state")}class p extends Error{constructor(g){super("NotSupported");g&&(this.message=g)}}},"19Vz":function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){te.defineOption("placeholder","",function(z,r,D){var p=D&&D!=te.Init;if(r&&!p)z.on("blur",K),z.on("change",N),z.on("swapDoc",N),te.on(z.getInputField(),"compositionupdate",z.state.placeholderCompose=function(){J(z)}),N(z);else if(!r&&p){z.off("blur",K),z.off("change",N),z.off("swapDoc",N),te.off(z.getInputField(),"compositionupdate",z.state.placeholderCompose),Q(z);var g=z.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}r&&!z.hasFocus()&&K(z)});function Q(z){z.state.placeholder&&(z.state.placeholder.parentNode.removeChild(z.state.placeholder),z.state.placeholder=null)}function B(z){Q(z);var r=z.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=z.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var D=z.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),r.appendChild(D),z.display.lineSpace.insertBefore(r,z.display.lineSpace.firstChild)}function J(z){setTimeout(function(){var r=!1,D=z.getInputField();D.nodeName=="TEXTAREA"?r=!D.value:z.lineCount()==1&&(r=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),r?B(z):Q(z)},20)}function K(z){$(z)&&B(z)}function N(z){var r=z.getWrapperElement(),D=$(z);r.className=r.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?B(z):Q(z)}function $(z){return z.lineCount()===1&&z.getLine(0)===""}})},"1eCo":function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){"use strict";var Q={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},B={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};te.defineMode("xml",function(J,K){var N=J.indentUnit,$={},z=K.htmlMode?Q:B;for(var r in z)$[r]=z[r];for(var r in K)$[r]=K[r];var D,p;function g(f,C){function x(W){return C.tokenize=W,W(f,C)}var _=f.next();if(_=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?x(d("atom","]]>")):null:f.match("--")?x(d("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),x(s(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=d("meta","?>"),"meta"):(D=f.eat("/")?"closeTag":"openTag",C.tokenize=m,"tag bracket");if(_=="&"){var j;return f.eat("#")?f.eat("x")?j=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):j=f.eatWhile(/[\d]/)&&f.eat(";"):j=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),j?"atom":"error"}else return f.eatWhile(/[^&<]/),null}g.isInText=!0;function m(f,C){var x=f.next();if(x==">"||x=="/"&&f.eat(">"))return C.tokenize=g,D=x==">"?"endTag":"selfcloseTag","tag bracket";if(x=="=")return D="equals",null;if(x=="<"){C.tokenize=g,C.state=o,C.tagName=C.tagStart=null;var _=C.tokenize(f,C);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(x)?(C.tokenize=a(x),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(f){var C=function(x,_){for(;!x.eol();)if(x.next()==f){_.tokenize=m;break}return"string"};return C.isInAttribute=!0,C}function d(f,C){return function(x,_){for(;!x.eol();){if(x.match(C)){_.tokenize=g;break}x.next()}return f}}function s(f){return function(C,x){for(var _;(_=C.next())!=null;){if(_=="<")return x.tokenize=s(f+1),x.tokenize(C,x);if(_==">")if(f==1){x.tokenize=g;break}else return x.tokenize=s(f-1),x.tokenize(C,x)}return"meta"}}function i(f,C,x){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=x,($.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function t(f){f.context&&(f.context=f.context.prev)}function u(f,C){for(var x;;){if(!f.context)return;if(x=f.context.tagName,!$.contextGrabbers.hasOwnProperty(x)||!$.contextGrabbers[x].hasOwnProperty(C))return;t(f)}}function o(f,C,x){return f=="openTag"?(x.tagStart=C.column(),R):f=="closeTag"?T:o}function R(f,C,x){return f=="word"?(x.tagName=C.current(),p="tag",P):$.allowMissingTagName&&f=="endTag"?(p="tag bracket",P(f,C,x)):(p="error",R)}function T(f,C,x){if(f=="word"){var _=C.current();return x.context&&x.context.tagName!=_&&$.implicitlyClosed.hasOwnProperty(x.context.tagName)&&t(x),x.context&&x.context.tagName==_||$.matchClosing===!1?(p="tag",S):(p="tag error",A)}else return $.allowMissingTagName&&f=="endTag"?(p="tag bracket",S(f,C,x)):(p="error",A)}function S(f,C,x){return f!="endTag"?(p="error",S):(t(x),o)}function A(f,C,x){return p="error",S(f,C,x)}function P(f,C,x){if(f=="word")return p="attribute",E;if(f=="endTag"||f=="selfcloseTag"){var _=x.tagName,j=x.tagStart;return x.tagName=x.tagStart=null,f=="selfcloseTag"||$.autoSelfClosers.hasOwnProperty(_)?u(x,_):(u(x,_),x.context=new i(x,_,j==x.indented)),o}return p="error",P}function E(f,C,x){return f=="equals"?b:($.allowMissing||(p="error"),P(f,C,x))}function b(f,C,x){return f=="string"?h:f=="word"&&$.allowUnquoted?(p="string",P):(p="error",P(f,C,x))}function h(f,C,x){return f=="string"?h:P(f,C,x)}return{startState:function(f){var C={tokenize:g,state:o,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;D=null;var x=C.tokenize(f,C);return(x||D)&&x!="comment"&&(p=null,C.state=C.state(D||x,f,C),p&&(x=p=="error"?x+" error":p)),x},indent:function(f,C,x){var _=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+N;if(_&&_.noIndent)return te.Pass;if(f.tokenize!=m&&f.tokenize!=g)return x?x.match(/^(\s*)/)[0].length:0;if(f.tagName)return $.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+N*($.multilineTagIndentFactor||1);if($.alignCDATA&&/$/,blockCommentStart:"",configuration:$.htmlMode?"html":"xml",helperType:$.htmlMode?"html":"xml",skipAttribute:function(f){f.state==b&&(f.state=P)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],x=f.context;x;x=x.prev)x.tagName&&C.push(x.tagName);return C.reverse()}}}),te.defineMIME("text/xml","xml"),te.defineMIME("application/xml","xml"),te.mimeModes.hasOwnProperty("text/html")||te.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Q});class te{constructor(B){this.element=B,this.next=te.Undefined,this.prev=te.Undefined}}te.Undefined=new te(void 0);class Q{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let B=this._first;for(;B!==te.Undefined;){const J=B.next;B.prev=te.Undefined,B.next=te.Undefined,B=J}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(B){return this._insert(B,!1)}push(B){return this._insert(B,!0)}_insert(B,J){const K=new te(B);if(this._first===te.Undefined)this._first=K,this._last=K;else if(J){const $=this._last;this._last=K,K.prev=$,$.next=K}else{const $=this._first;this._first=K,K.next=$,$.prev=K}this._size+=1;let N=!1;return()=>{N||(N=!0,this._remove(K))}}shift(){if(this._first===te.Undefined)return;{const B=this._first.element;return this._remove(this._first),B}}pop(){if(this._last===te.Undefined)return;{const B=this._last.element;return this._remove(this._last),B}}_remove(B){if(B.prev!==te.Undefined&&B.next!==te.Undefined){const J=B.prev;J.next=B.next,B.next.prev=J}else B.prev===te.Undefined&&B.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):B.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):B.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let B=this._first;for(;B!==te.Undefined;)yield B.element,B=B.next}}},"2aBv":function(kt,Ae,U){"use strict";var te=U("2qtc"),Q=U("kLXV"),B=U("0Owb"),J=U("14J3"),K=U("BMrR"),N=U("jCWc"),$=U("kPKH"),z=U("+L6B"),r=U("2/Rp"),D=U("oBTY"),p=U("tJVT"),g=U("q1tI"),m=U.n(g),a=U("ngQI"),d=U("Ty5D"),s=U("YIbm"),i=U.n(s),t=function(o){var R=o.visible,T=o.onOk,S=o.onCancel,A=o.data,P=Object(g.useState)([]),E=Object(p.a)(P,2),b=E[0],h=E[1],f=Object(g.useState)(!1),C=Object(p.a)(f,2),x=C[0],_=C[1],j=Object(d.i)();Object(g.useEffect)(function(){if(!R){h([]),_(!1);return}h(Object(D.a)(A)||[])},[R]);var W=function(){_(!0),T(b,function(){_(!1)})},w=function(){S()},F=function(H,Y,ie){var le=Array.from(H),he=le.splice(Y,1),we=Object(p.a)(he,1),Pe=we[0];return le.splice(ie,0,Pe),le},I=function(H,Y){if(!H.destination)return;var ie=F(Y,H.source.index,H.destination.index);h(ie)};return m.a.createElement(Q.a,{title:"\u9898\u578B\u6392\u5E8F",visible:R,centered:!0,onCancel:w,footer:m.a.createElement("div",null,m.a.createElement("span",{style:{float:"left",color:"#999",paddingTop:5}},"\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"),m.a.createElement(r.a,{onClick:w},"\u53D6\u6D88"),m.a.createElement(r.a,{type:"primary",loading:x,onClick:W},"\u786E\u8BA4")),width:"680px"},m.a.createElement("div",{className:i.a.content},m.a.createElement(K.a,null,m.a.createElement($.a,{span:12},"\u5E8F\u53F7"),m.a.createElement($.a,{span:12},"\u9898\u578B\u540D\u79F0")),m.a.createElement(a.a,{onDragEnd:function(H){return I(H,b)}},m.a.createElement(a.c,{droppableId:"droppable"},function(v,H){return m.a.createElement("div",Object(B.a)({ref:v.innerRef},v.droppableProps,{style:{width:"100%"}}),b.map(function(Y,ie){return m.a.createElement(a.b,{key:ie,draggableId:ie.toString(),index:ie},function(le,he){return m.a.createElement("aside",Object(B.a)({ref:le.innerRef},le.draggableProps,le.dragHandleProps),m.a.createElement("div",null,m.a.createElement(K.a,{style:{backgroundColor:ie%2===0?"#f5f5f5":"#fff"}},m.a.createElement($.a,{span:12},ie+1),m.a.createElement($.a,{span:12},Y))))})}))}))))};Ae.a=t},"3/fG":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return Q});function te(B,J){let K;return J.length===0?K=B:K=B.replace(/\{(\d+)\}/g,function(N,$){const z=$[0];return typeof J[z]!="undefined"?J[z]:N}),K}function Q(B,J,...K){return te(J,K)}},"55Ip":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return u});var te=U("Ty5D"),Q=U("dI71"),B=U("q1tI"),J=U.n(B),K=U("YS25"),N=U("17x9"),$=U.n(N),z=U("wx14"),r=U("zLVn"),D=U("9R94"),p=function(b){Object(Q.a)(h,b);function h(){for(var C,x=arguments.length,_=new Array(x),j=0;j=0||x.relatedTarget.className.indexOf("".concat(w,"-next"))>=0))return;b.setState({goInputText:""}),W(b.getValidValue())},b.go=function(x){var _=b.state.goInputText;if(_==="")return;(x.keyCode===a.ENTER||x.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(K.a)(E,[{key:"getValidValue",value:function(){var h=this.state,f=h.goInputText,C=h.current;return!f||isNaN(f)?C:Number(f)}},{key:"getPageSizeOptions",value:function(){var h=this.props,f=h.pageSize,C=h.pageSizeOptions;return C.some(function(x){return x.toString()===f.toString()})?C:C.concat([f.toString()]).sort(function(x,_){var j=isNaN(Number(x))?0:Number(x),W=isNaN(Number(_))?0:Number(_);return j-W})}},{key:"render",value:function(){var h=this,f=this.props,C=f.pageSize,x=f.locale,_=f.rootPrefixCls,j=f.changeSize,W=f.quickGo,w=f.goButton,F=f.selectComponentClass,I=f.buildOptionText,v=f.selectPrefixCls,H=f.disabled,Y=this.state.goInputText,ie="".concat(_,"-options"),le=F,he=null,we=null,Pe=null;if(!j&&!W)return null;var xe=this.getPageSizeOptions();if(j&&le){var Oe=xe.map(function(pe,be){return r.a.createElement(le.Option,{key:be,value:pe.toString()},(I||h.buildOptionText)(pe))});he=r.a.createElement(le,{disabled:H,prefixCls:v,showSearch:!1,className:"".concat(ie,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||xe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(be){return be.parentNode}},Oe)}return W&&(w&&(Pe=typeof w=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(ie,"-quick-jumper-button")},x.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},w)),we=r.a.createElement("div",{className:"".concat(ie,"-quick-jumper")},x.jump_to,r.a.createElement("input",{disabled:H,type:"text",value:Y,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),x.page,Pe)),r.a.createElement("li",{className:"".concat(ie)},he,we)}}]),E}(r.a.Component);d.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=d,i=U("N2Kk");function t(){}function u(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function o(A,P,E){return E}function R(A,P,E){var b=typeof A=="undefined"?P.pageSize:A;return Math.floor((E.total-1)/b)+1}var T=function(A){Object(N.a)(E,A);var P=Object($.a)(E);function E(b){var h;Object(J.a)(this,E),h=P.call(this,b),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(R(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(j,W){var w=h.props.prefixCls,F=j||r.a.createElement("button",{type:"button","aria-label":W,className:"".concat(w,"-item-link")});return typeof j=="function"&&(F=r.a.createElement(j,Object(B.a)({},h.props))),F},h.savePaginationNode=function(j){h.paginationNode=j},h.isValid=function(j){return u(j)&&j!==h.state.current},h.shouldDisplayQuickJumper=function(){var j=h.props,W=j.showQuickJumper,w=j.pageSize,F=j.total;return F<=w?!1:W},h.handleKeyDown=function(j){(j.keyCode===a.ARROW_UP||j.keyCode===a.ARROW_DOWN)&&j.preventDefault()},h.handleKeyUp=function(j){var W=h.getValidValue(j),w=h.state.currentInputValue;W!==w&&h.setState({currentInputValue:W}),j.keyCode===a.ENTER?h.handleChange(W):j.keyCode===a.ARROW_UP?h.handleChange(W-1):j.keyCode===a.ARROW_DOWN&&h.handleChange(W+1)},h.changePageSize=function(j){var W=h.state.current,w=R(j,h.state,h.props);W=W>w?w:W,w===0&&(W=h.state.current),typeof j=="number"&&("pageSize"in h.props||h.setState({pageSize:j}),"current"in h.props||h.setState({current:W,currentInputValue:W})),h.props.onShowSizeChange(W,j),"onChange"in h.props&&h.props.onChange&&h.props.onChange(W,j)},h.handleChange=function(j){var W=h.props.disabled,w=j;if(h.isValid(w)&&!W){var F=R(void 0,h.state,h.props);w>F?w=F:w<1&&(w=1),"current"in h.props||h.setState({current:w,currentInputValue:w});var I=h.state.pageSize;return h.props.onChange(w,I),w}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current2?w-2:0),I=2;I=C?_=C:_=Number(f),_}},{key:"getShowSizeChanger",value:function(){var h=this.props,f=h.showSizeChanger,C=h.total,x=h.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:C>x}},{key:"renderPrev",value:function(h){var f=this.props,C=f.prevIcon,x=f.itemRender,_=x(h,"prev",this.getItemIcon(C,"prev page")),j=!this.hasPrev();return Object(z.isValidElement)(_)?Object(z.cloneElement)(_,{disabled:j}):_}},{key:"renderNext",value:function(h){var f=this.props,C=f.nextIcon,x=f.itemRender,_=x(h,"next",this.getItemIcon(C,"next page")),j=!this.hasNext();return Object(z.isValidElement)(_)?Object(z.cloneElement)(_,{disabled:j}):_}},{key:"render",value:function(){var h=this,f=this.props,C=f.prefixCls,x=f.className,_=f.style,j=f.disabled,W=f.hideOnSinglePage,w=f.total,F=f.locale,I=f.showQuickJumper,v=f.showLessItems,H=f.showTitle,Y=f.showTotal,ie=f.simple,le=f.itemRender,he=f.showPrevNextJumpers,we=f.jumpPrevIcon,Pe=f.jumpNextIcon,xe=f.selectComponentClass,Oe=f.selectPrefixCls,pe=f.pageSizeOptions,be=this.state,ne=be.current,fe=be.pageSize,_e=be.currentInputValue;if(W===!0&&w<=fe)return null;var ke=R(void 0,this.state,this.props),qe=[],je=null,st=null,vt=null,Re=null,Be=null,Ye=I&&I.goButton,Ke=v?1:2,yt=ne-1>0?ne-1:0,Pt=ne+1=Ke*2&&ne!==1+2&&(qe[0]=Object(z.cloneElement)(qe[0],{className:"".concat(C,"-item-after-jump-prev")}),qe.unshift(je)),ke-ne>=Ke*2&&ne!==ke-2&&(qe[qe.length-1]=Object(z.cloneElement)(qe[qe.length-1],{className:"".concat(C,"-item-before-jump-next")}),qe.push(st)),Ct!==1&&qe.unshift(vt),At!==ke&&qe.push(Re)}var He=null;Y&&(He=r.a.createElement("li",{className:"".concat(C,"-total-text")},Y(w,[w===0?0:(ne-1)*fe+1,ne*fe>w?w:ne*fe])));var Ne=!this.hasPrev()||!ke,Ue=!this.hasNext()||!ke;return r.a.createElement("ul",Object(te.a)({className:p()(C,x,Object(Q.a)({},"".concat(C,"-disabled"),j)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},Ht),He,r.a.createElement("li",{title:H?F.prev_page:null,onClick:this.prev,tabIndex:Ne?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(C,"-prev"),Object(Q.a)({},"".concat(C,"-disabled"),Ne)),"aria-disabled":Ne},this.renderPrev(yt)),qe,r.a.createElement("li",{title:H?F.next_page:null,onClick:this.next,tabIndex:Ue?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(C,"-next"),Object(Q.a)({},"".concat(C,"-disabled"),Ue)),"aria-disabled":Ue},this.renderNext(Pt)),r.a.createElement(s,{disabled:j,locale:F,rootPrefixCls:C,selectComponentClass:xe,selectPrefixCls:Oe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ne,pageSize:fe,pageSizeOptions:pe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ye}))}}],[{key:"getDerivedStateFromProps",value:function(h,f){var C={};if("current"in h&&(C.current=h.current,h.current!==f.current&&(C.currentInputValue=C.current)),"pageSize"in h&&h.pageSize!==f.pageSize){var x=f.current,_=R(h.pageSize,f,h);x=x>_?_:x,"current"in h||(C.current=x,C.currentInputValue=x),C.pageSize=h.pageSize}return C}}]),E}(r.a.Component);T.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:i.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var S=T},"69hG":function(kt,Ae,U){kt.exports={customModal:"customModal___1AnAw",content:"content___1zYYV",upload:"upload___1W2G-"}},"6RRn":function(kt,Ae,U){"use strict";var te=U("wCXF"),Q=U("n6Qo");U.d(Ae,"b",function(){return Q.a});var B=U("IBYe"),J=U("6eGT"),K=U("hW8S");U.d(Ae,"a",function(){return K.a}),Ae.c=te.b},"6UM0":function(kt,Ae,U){var te,Q;(function(){var B;(function(){"use strict";var K=[function(r,D,p){var g=p(1).Beautifier,m=p(5).Options;function a(d,s){var i=new g(d,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new m}},function(r,D,p){var g=p(2).Output,m=p(3).Token,a=p(4),d=p(5).Options,s=p(7).Tokenizer,i=p(7).line_starters,t=p(7).positionable_operators,u=p(7).TOKEN;function o(v,H){return H.indexOf(v)!==-1}function R(v){return v.replace(/^\s+/g,"")}function T(v){for(var H={},Y=0;YY&&(Y=v.line_indent_level));var ie={mode:H,parent:v,last_token:v?v.last_token:new m(u.START_BLOCK,""),last_word:v?v.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:Y,alignment:0,line_indent_level:v?v.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},F.prototype._reset=function(v){var H=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var Y=new s(v,this._options);return this._tokens=Y.tokenize(),v},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,H=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
`,H&&a.lineBreak.test(H||"")&&(Y=H.match(a.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return v=this._output.get_code(Y),v},F.prototype.handle_token=function(v,H){v.type===u.START_EXPR?this.handle_start_expr(v):v.type===u.END_EXPR?this.handle_end_expr(v):v.type===u.START_BLOCK?this.handle_start_block(v):v.type===u.END_BLOCK?this.handle_end_block(v):v.type===u.WORD?this.handle_word(v):v.type===u.RESERVED?this.handle_word(v):v.type===u.SEMICOLON?this.handle_semicolon(v):v.type===u.STRING?this.handle_string(v):v.type===u.EQUALS?this.handle_equals(v):v.type===u.OPERATOR?this.handle_operator(v):v.type===u.COMMA?this.handle_comma(v):v.type===u.BLOCK_COMMENT?this.handle_block_comment(v,H):v.type===u.COMMENT?this.handle_comment(v,H):v.type===u.DOT?this.handle_dot(v):v.type===u.EOF?this.handle_eof(v):v.type===u.UNKNOWN?this.handle_unknown(v,H):this.handle_unknown(v,H)},F.prototype.handle_whitespace_and_comments=function(v,H){var Y=v.newlines,ie=this._options.keep_array_indentation&&_(this._flags.mode);if(v.comments_before)for(var le=v.comments_before.next();le;)this.handle_whitespace_and_comments(le,H),this.handle_token(le,H),le=v.comments_before.next();if(ie)for(var he=0;he0,H);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,H);for(var we=1;we0&&(!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))},F.prototype.set_mode=function(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},F.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"]))},F.prototype.start_of_statement=function(v){var H=!1;return H=H||A(this._flags.last_token,["var","let","const"])&&v.type===u.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&A(this._flags.last_token,I)&&!v.newlines,H=H||S(this._flags.last_token,"else")&&!(S(v,"if")&&!v.comments_before),H=H||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),H=H||this._flags.last_token.type===u.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==u.WORD&&v.type!==u.RESERVED,H=H||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),H?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,A(v,["do","for","if","while"])),!0):!1},F.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var H=f.Expression;if(v.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=f.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())),o(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=f.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=f.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var ie=this._tokens.peek(-4);A(Y,["async","function"])||Y.text==="*"&&A(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(ie.text==="{"||ie.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(v);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&o(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===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},F.prototype.handle_end_expr=function(v){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&_(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.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(v),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},F.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var H=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):Y&&(o(Y.text,[":",","])&&o(H.type,[u.STRING,u.WORD,u.RESERVED])||o(H.text,["get","set","..."])&&o(Y.type,[u.WORD,u.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(Y.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):o(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!H.comments_before&&H.text==="}",le=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var he=0,we=null;this._flags.inline_frame=!0;do if(he+=1,we=this._tokens.peek(he-1),we.newlines){this._flags.inline_frame=!1;break}while(we.type!==u.EOF&&!(we.type===u.END_BLOCK&&we.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(le||this._flags.last_token.type===u.EQUALS||A(this._flags.last_token,P)&&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===u.START_EXPR||this._flags.last_token.type===u.COMMA)&&((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},F.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===f.Statement;)this.restore_mode();var H=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(_(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(v)},F.prototype.handle_word=function(v){if(v.type===u.RESERVED){if(o(v.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)v.type=u.WORD;else if(v.text==="import"&&o(this._tokens.peek().text,["(","."]))v.type=u.WORD;else if(o(v.text,["as","from"])&&!this._flags.import_block)v.type=u.WORD;else if(this._flags.mode===f.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(v.type=u.WORD)}}if(this.start_of_statement(v)?A(this._flags.last_token,["var","let","const"])&&v.type===u.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!j(this._flags.mode)&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==u.EQUALS&&(this._options.preserve_newlines||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(S(v,"while")){this._output.space_before_token=!0,this.print_token(v),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&&S(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&A(v,["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(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v)),S(v,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,I)?this._output.space_before_token=!0:S(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===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(j(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var Y="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":A(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===f.BlockStatement?Y="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&j(this._flags.mode)?Y="SPACE":this._flags.last_token.type===u.STRING?Y="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&o(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),A(v,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),A(v,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?A(this._flags.last_token,P)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!A(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(v,"if")&&S(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(v,i)&&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():Y==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===u.WORD||v.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===u.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(v,"from")&&(this._flags.import_block=!1))},F.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var H=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},F.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},F.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},F.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(j(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(v)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},F.prototype.handle_operator=function(v){var H=v.text==="*"&&(A(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),Y=o(v.text,["-","+"])&&(o(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||o(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var ie=!H;this.handle_whitespace_and_comments(v,ie)}if(v.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(this._flags.last_token.type===u.OPERATOR&&o(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.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,he=!0,we=!1;if(v.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,we=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!H&&this._options.preserve_newlines&&o(v.text,t)){var Pe=v.text===":",xe=Pe&&we,Oe=Pe&&!we;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Oe,this.print_token(v),(!Pe||xe)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!Pe||xe?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case b.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(v),le=!(this._output.just_added_newline()||Oe),this._output.space_before_token=le,this.print_token(v),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(v),le=!1;var pe=this._tokens.peek();he=pe&&o(pe.type,[u.WORD,u.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),le=this._flags.last_token.type===u.START_BLOCK,he=!1;else if(o(v.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),le=!1,he=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var be=A(this._flags.last_token,P)&&v.newlines;be&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(be,!0)}this._flags.last_token.text===";"&&j(this._flags.mode)&&(le=!0),this._flags.last_token.type===u.RESERVED?le=!0:this._flags.last_token.type===u.END_EXPR?le=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===u.OPERATOR&&(le=o(v.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(v.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(he=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.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(v),this._output.space_before_token=he},F.prototype.handle_block_comment=function(v,H){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,H),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,H)},F.prototype.print_block_commment=function(v,H){var Y=x(v.text),ie,le=!1,he=!1,we=v.whitespace_before,Pe=we.length;if(this.print_newline(!1,H),this.print_token_line_indentation(v),this._output.add_token(Y[0]),this.print_newline(!1,H),Y.length>1){for(Y=Y.slice(1),le=W(Y,"*"),he=w(Y,we),le&&(this._flags.alignment=1),ie=0;ie=0;a--)if(this.__items[a].match(m))return!0;return!1},D.prototype.set_indent=function(m,a){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.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)},D.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},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var a=m.lastIndexOf(`
`);a!==-1?this.__character_count=m.length-a:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function p(m,a){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),a=a||"",m.indent_level>0&&(a=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}p.prototype.get_indent_size=function(m,a){var d=this.__base_string_length;return a=a||0,m<0&&(d=0),d+=m*this.__indent_size,d+=a,d},p.prototype.get_indent_string=function(m,a){var d=this.__base_string;return a=a||0,m<0&&(m=0,d=""),a+=m*this.__indent_size,this.__ensure_cache(a),d+=this.__cache[a],d},p.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var m=this.__cache.length,a=0,d="";this.__indent_size&&m>=this.__indent_size&&(a=Math.floor(m/this.__indent_size),m-=a*this.__indent_size,d=new Array(a+1).join(this.__indent_string)),m&&(d+=new Array(m+1).join(" ")),this.__cache.push(d)};function g(m,a){this.__indent_cache=new p(m,a),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(m,a){return this.__indent_cache.get_indent_string(m,a)},g.prototype.get_indent_size=function(m,a){return this.__indent_cache.get_indent_size(m,a)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(m){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var d=this.__lines.join(`
`);return m!==`
`&&(d=d.replace(/[\n]/g,m)),d},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(m,a){return m=m||0,a=a||0,this.next_line.set_indent(m,a),this.__lines.length>1?(this.current_line.set_indent(m,a),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(m){for(var a=0;a1&&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},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(m,a){for(var d=this.__lines.length-2;d>=0;){var s=this.__lines[d];if(s.is_empty())break;if(s.item(0).indexOf(m)!==0&&s.item(-1)!==a){this.__lines.splice(d+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}d--}},r.exports.Output=g},function(r){function D(p,g,m,a){this.type=p,this.text=g,this.comments_before=null,this.newlines=m||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=D},function(r,D){var p="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",m="\\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",a="\\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",d="(?:\\\\u[0-9a-fA-F]{4}|["+p+m+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+g+m+a+"])*";D.identifier=new RegExp(d+s,"g"),D.identifierStart=new RegExp(d),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+m+a+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(r,D,p){var g=p(6).Options,m=["before-newline","after-newline","preserve-newline"];function a(d){g.call(this,d,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="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 i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var t=0;t>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),E=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";E=E.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),E="\\?\\.(?!\\d) "+E,E=E.replace(/ /g,"|");var b=new RegExp(E),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+f.join("|")+")$"),x,_=function(W,w){m.call(this,W,w),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var F=new i(this._input),I=new t(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(s.identifier).matching(s.identifierMatch),number:F.matching(T),punct:F.matching(b),comment:F.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:F.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:F.matching(//),include:F.starting_with(/#include/).until_after(s.lineBreak),shebang:F.starting_with(/#!/).until_after(s.lineBreak),xml:F.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:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};_.prototype=new m,_.prototype._is_comment=function(W){return W.type===o.COMMENT||W.type===o.BLOCK_COMMENT||W.type===o.UNKNOWN},_.prototype._is_opening=function(W){return W.type===o.START_BLOCK||W.type===o.START_EXPR},_.prototype._is_closing=function(W,w){return(W.type===o.END_BLOCK||W.type===o.END_EXPR)&&w&&(W.text==="]"&&w.text==="["||W.text===")"&&w.text==="("||W.text==="}"&&w.text==="{")},_.prototype._reset=function(){x=!1},_.prototype._get_next_token=function(W,w){var F=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(o.EOF,""):(F=F||this._read_non_javascript(I),F=F||this._read_string(I),F=F||this._read_word(W),F=F||this._read_singles(I),F=F||this._read_comment(I),F=F||this._read_regexp(I,W),F=F||this._read_xml(I,W),F=F||this._read_punctuation(),F=F||this._create_token(o.UNKNOWN,this._input.next()),F)},_.prototype._read_word=function(W){var w;if(w=this.__patterns.identifier.read(),w!=="")return w=w.replace(s.allLineBreaks,`
`),!(W.type===o.DOT||W.type===o.RESERVED&&(W.text==="set"||W.text==="get"))&&C.test(w)?(w==="in"||w==="of")&&(W.type===o.WORD||W.type===o.STRING)?this._create_token(o.OPERATOR,w):this._create_token(o.RESERVED,w):this._create_token(o.WORD,w);if(w=this.__patterns.number.read(),w!=="")return this._create_token(o.WORD,w)},_.prototype._read_singles=function(W){var w=null;return W==="("||W==="["?w=this._create_token(o.START_EXPR,W):W===")"||W==="]"?w=this._create_token(o.END_EXPR,W):W==="{"?w=this._create_token(o.START_BLOCK,W):W==="}"?w=this._create_token(o.END_BLOCK,W):W===";"?w=this._create_token(o.SEMICOLON,W):W==="."&&A.test(this._input.peek(1))?w=this._create_token(o.DOT,W):W===","&&(w=this._create_token(o.COMMA,W)),w&&this._input.next(),w},_.prototype._read_punctuation=function(){var W=this.__patterns.punct.read();if(W!=="")return W==="="?this._create_token(o.EQUALS,W):W==="?."?this._create_token(o.DOT,W):this._create_token(o.OPERATOR,W)},_.prototype._read_non_javascript=function(W){var w="";if(W==="#"){if(this._is_first_token()&&(w=this.__patterns.shebang.read(),w))return this._create_token(o.UNKNOWN,w.trim()+`
`);if(w=this.__patterns.include.read(),w)return this._create_token(o.UNKNOWN,w.trim()+`
`);W=this._input.next();var F="#";if(this._input.hasNext()&&this._input.testChar(S)){do W=this._input.next(),F+=W;while(this._input.hasNext()&&W!=="#"&&W!=="=");return W==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(F+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(F+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,F)}this._input.back()}else if(W==="<"&&this._is_first_token()){if(w=this.__patterns.html_comment_start.read(),w){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)w+=this._input.next();return x=!0,this._create_token(o.COMMENT,w)}}else if(x&&W==="-"&&(w=this.__patterns.html_comment_end.read(),w))return x=!1,this._create_token(o.COMMENT,w);return null},_.prototype._read_comment=function(W){var w=null;if(W==="/"){var F="";if(this._input.peek(1)==="*"){F=this.__patterns.block_comment.read();var I=R.get_directives(F);I&&I.ignore==="start"&&(F+=R.readIgnored(this._input)),F=F.replace(s.allLineBreaks,`
`),w=this._create_token(o.BLOCK_COMMENT,F),w.directives=I}else this._input.peek(1)==="/"&&(F=this.__patterns.comment.read(),w=this._create_token(o.COMMENT,F))}return w},_.prototype._read_string=function(W){if(W==="`"||W==="'"||W==='"'){var w=this._input.next();return this.has_char_escapes=!1,W==="`"?w+=this._read_string_recursive("`",!0,"${"):w+=this._read_string_recursive(W),this.has_char_escapes&&this._options.unescape_strings&&(w=j(w)),this._input.peek()===W&&(w+=this._input.next()),w=w.replace(s.allLineBreaks,`
`),this._create_token(o.STRING,w)}return null},_.prototype._allow_regexp_or_xml=function(W){return W.type===o.RESERVED&&u(W.text,["return","case","throw","else","do","typeof","yield"])||W.type===o.END_EXPR&&W.text===")"&&W.opened.previous.type===o.RESERVED&&u(W.opened.previous.text,["if","while","for"])||u(W.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},_.prototype._read_regexp=function(W,w){if(W==="/"&&this._allow_regexp_or_xml(w)){for(var F=this._input.next(),I=!1,v=!1;this._input.hasNext()&&(I||v||this._input.peek()!==W)&&!this._input.testChar(s.newline);)F+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===W&&(F+=this._input.next(),F+=this._input.read(s.identifier)),this._create_token(o.STRING,F)}return null},_.prototype._read_xml=function(W,w){if(this._options.e4x&&W==="<"&&this._allow_regexp_or_xml(w)){var F="",I=this.__patterns.xml.read_match();if(I){for(var v=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=v.indexOf("{")===0,Y=0;I;){var ie=!!I[1],le=I[2],he=!!I[I.length-1]||le.slice(0,8)==="![CDATA[";if(!he&&(le===v||H&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--Y:++Y),F+=I[0],Y<=0)break;I=this.__patterns.xml.read_match()}return I||(F+=this._input.match(/[\s\S]*/g)[0]),F=F.replace(s.allLineBreaks,`
`),this._create_token(o.STRING,F)}}return null};function j(W){for(var w="",F=0,I=new g(W),v=null;I.hasNext();)if(v=I.match(/([\s]|[^\\]|\\\\)+/g),v&&(w+=v[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")v=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")v=I.match(/u([0-9A-Fa-f]{4})/g);else{w+="\\",I.hasNext()&&(w+=I.next());continue}if(!v)return W;if(F=parseInt(v[1],16),F>126&&F<=255&&v[0].indexOf("x")===0)return W;if(F>=0&&F<32){w+="\\"+v[0];continue}else F===34||F===39||F===92?w+="\\"+String.fromCharCode(F):w+=String.fromCharCode(F)}return w}_.prototype._read_string_recursive=function(W,w,F){var I,v;W==="'"?v=this.__patterns.single_quote:W==='"'?v=this.__patterns.double_quote:W==="`"?v=this.__patterns.template_text:W==="}"&&(v=this.__patterns.template_expression);for(var H=v.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===W||!w&&s.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Y+=this._input.next()):F&&(F==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),F===Y&&(W==="`"?Y+=this._read_string_recursive("}",w,"`"):Y+=this._read_string_recursive("`",w,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=v.read(),H+=Y}return H},r.exports.Tokenizer=_,r.exports.TOKEN=o,r.exports.positionable_operators=P.slice(),r.exports.line_starters=h.slice()},function(r){var D=RegExp.prototype.hasOwnProperty("sticky");function p(g){this.__input=g||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position=0&&g=0&&m=g.length&&this.__input.substring(m-g.length,m).toLowerCase()===g},r.exports.InputScanner=p},function(r,D,p){var g=p(8).InputScanner,m=p(3).Token,a=p(10).TokenStream,d=p(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,u){this._input=new g(t),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new d(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var t,u=new m(s.START,""),o=null,R=[],T=new a;u.type!==s.EOF;){for(t=this._get_next_token(u,o);this._is_comment(t);)T.add(t),t=this._get_next_token(u,o);T.isEmpty()||(t.comments_before=T,T=new a),t.parent=o,this._is_opening(t)?(R.push(o),o=t):o&&this._is_closing(t,o)&&(t.opened=o,o.closed=t,o=R.pop(),t.parent=o),t.previous=u,u.next=t,this.__tokens.add(t),u=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,u){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(s.RAW,o):this._create_token(s.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,u){return!1},i.prototype._create_token=function(t,u){var o=new m(t,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=i,r.exports.TOKEN=s},function(r){function D(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position=0&&p/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new g,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(d){var s=this._create();return s._disabled[d]=!0,s._update(),s},a.prototype.read_options=function(d){var s=this._create();for(var i in m)s._disabled[i]=d.templating.indexOf(i)===-1;return s._update(),s},a.prototype.exclude=function(d){var s=this._create();return s._excluded[d]=!0,s._update(),s},a.prototype.read=function(){var d="";this._match_pattern?d=this._input.read(this._starting_pattern):d=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),d+=s,s=this._read_template();return this._until_after&&(d+=this._input.readUntilAfter(this._until_pattern)),d},a.prototype.__set_templated_pattern=function(){var d=[];this._disabled.php||d.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||d.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||d.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(d.push(this.__patterns.django._starting_pattern.source),d.push(this.__patterns.django_value._starting_pattern.source),d.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||d.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&d.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+d.join("|")+")")},a.prototype._read_template=function(){var d="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(d=d||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(d=d||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(d=d||this.__patterns.handlebars_comment.read(),d=d||this.__patterns.handlebars_unescaped.read(),d=d||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(d=d||this.__patterns.django_value.read()),this._excluded.django||(d=d||this.__patterns.django_comment.read(),d=d||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(d=d||this.__patterns.smarty_comment.read(),d=d||this.__patterns.smarty_literal.read(),d=d||this.__patterns.smarty.read()));return d},r.exports.TemplatablePattern=a}],N={};function $(r){var D=N[r];if(D!==void 0)return D.exports;var p=N[r]={exports:{}};return K[r](p,p.exports,$),p.exports}var z=$(0);B=z})();var J=B;!(te=[],Q=function(){return{js_beautify:J}}.apply(Ae,te),Q!==void 0&&(kt.exports=Q))})()},"6eGT":function(kt,Ae,U){"use strict";function te(Q){return null}Ae.a=te},"746U":function(kt,Ae,U){"use strict";U.d(Ae,"f",function(){return te}),U.d(Ae,"l",function(){return Q}),U.d(Ae,"k",function(){return B}),U.d(Ae,"j",function(){return J}),U.d(Ae,"g",function(){return K}),U.d(Ae,"m",function(){return N}),U.d(Ae,"h",function(){return $}),U.d(Ae,"n",function(){return z}),U.d(Ae,"c",function(){return r}),U.d(Ae,"a",function(){return D}),U.d(Ae,"i",function(){return p}),U.d(Ae,"o",function(){return g}),U.d(Ae,"e",function(){return d}),U.d(Ae,"d",function(){return s}),U.d(Ae,"p",function(){return i}),U.d(Ae,"b",function(){return t});function te(u){return Array.isArray(u)}function Q(u){return typeof u=="string"}function B(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)&&!(u instanceof RegExp)&&!(u instanceof Date)}function J(u){return typeof u=="number"&&!isNaN(u)}function K(u){return u===!0||u===!1}function N(u){return typeof u=="undefined"}function $(u){return!z(u)}function z(u){return N(u)||u===null}function r(u,o){if(!u)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function D(u){if(z(u))throw new Error("Assertion Failed: argument is undefined or null");return u}function p(u){return typeof u=="function"}function g(u,o){const R=Math.min(u.length,o.length);for(let T=0;Tfunction(){const A=Array.prototype.slice.call(arguments,0);return o(S,A)};let T={};for(const S of u)T[S]=R(S);return T}function i(u){return u===null?void 0:u}function t(u,o="Unreachable"){throw new Error(o)}},"7Cbv":function(kt,Ae,U){"use strict";var te=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q=new Uint8Array(16);function B(){if(!te)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(Q)}var J=/^(?:[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 K(m){return typeof m=="string"&&J.test(m)}for(var N=K,$=[],z=0;z<256;++z)$.push((z+256).toString(16).substr(1));function r(m){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,d=($[m[a+0]]+$[m[a+1]]+$[m[a+2]]+$[m[a+3]]+"-"+$[m[a+4]]+$[m[a+5]]+"-"+$[m[a+6]]+$[m[a+7]]+"-"+$[m[a+8]]+$[m[a+9]]+"-"+$[m[a+10]]+$[m[a+11]]+$[m[a+12]]+$[m[a+13]]+$[m[a+14]]+$[m[a+15]]).toLowerCase();if(!N(d))throw TypeError("Stringified UUID is invalid");return d}var D=r;function p(m,a,d){m=m||{};var s=m.random||(m.rng||B)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,a){d=d||0;for(var i=0;i<16;++i)a[d+i]=s[i];return a}return D(s)}var g=Ae.a=p},"7ahc":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return R});var te=U("k1fw"),Q=U("0Owb"),B=U("+L6B"),J=U("2/Rp"),K=U("y8nQ"),N=U("Vl3Y"),$=U("tJVT"),z=U("OaEy"),r=U("2fM7"),D=U("q1tI"),p=U.n(D),g=U("VrN/"),m=U.n(g),a=U("p77/"),d=U.n(a),s=U("c5Ni"),i=U.n(s),t=r.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},o={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"]};Ae.b=function(T){var S=T.callback,A=T.onCancel,P=Object(D.useState)("python"),E=Object($.a)(P,2),b=E[0],h=E[1];function f(x){h(o[x][1])}function C(x){S(x)}return p.a.createElement(N.a,Object(Q.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),p.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},p.a.createElement(r.a,{onChange:f},Object.keys(o).map(function(x){return p.a.createElement(t,{key:x,value:x},o[x][0])}))),p.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},p.a.createElement(R,{mode:b})),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(J.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function R(T){var S=T.value,A=T.onChange,P=T.mode,E=T.options,b=E===void 0?{}:E,h=Object(D.useRef)(),f=Object(D.useState)(),C=Object($.a)(f,2),x=C[0],_=C[1];return Object(D.useEffect)(function(){if(x){function j(W){var w=W.getValue();A&&A(w)}return x.on("change",j),function(){x.off("change",j)}}},[x,A]),Object(D.useEffect)(function(){x&&x.setOption("mode",P)},[x,P]),Object(D.useEffect)(function(){x&&((S!==x.getValue()||S==="")&&setTimeout(function(){x.setValue(S||" ")},300))},[x,S]),Object(D.useEffect)(function(){if(h.current&&!x){var j=m.a.fromTextArea(h.current,Object(te.a)({mode:P,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));_(j)}},[h.current,x]),p.a.createElement("div",{className:"my-codemirror-container"},p.a.createElement("textarea",{ref:h}))}},"7qnI":function(kt,Ae,U){"use strict";var te=U("5Dmo"),Q=U("3S7+"),B=U("fWQN"),J=U("mtLc"),K=U("yKVA"),N=U("879j"),$=U("5NDa"),z=U("5rEg"),r=U("q1tI"),D=U.n(r),p=U("O2Wb"),g=U.n(p),m=z.a.TextArea,a=function(d){Object(K.a)(i,d);var s=Object(N.a)(i);function i(){return Object(B.a)(this,i),s.apply(this,arguments)}return Object(J.a)(i,[{key:"render",value:function(){var u=this,o=this.props,R=o.index,T=o.onAnswerChange,S=o.addChildAnswer,A=o.exerciseIsPublish,P=o.answers,E=o.activeOptionErrorIndex,b=o.flex,h=b===void 0?"0 0 1000px":b;return D.a.createElement("div",{className:g.a.flex},D.a.createElement("div",{className:"".concat(g.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",R+1,"):"),D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),style:{flexDirection:"column"}},P.map(function(f,C){var x="".concat(R,"-").concat(C);return D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),key:C},D.a.createElement("div",{className:g.a.flex1,style:{flex:h}},D.a.createElement("div",null,D.a.createElement(m,{className:x===E?g.a.error:"",spellCheck:!1,rows:4,value:f||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(C==0?"":"(\u53EF\u9009)"),onChange:function(j){return T(R,C,j.target.value)},style:{minHeight:95}}))),!A&&D.a.createElement(D.a.Fragment,null,C!=0&&D.a.createElement(Q.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswer(R,C)},style:{float:"right"}})),C===0&&D.a.createElement(Q.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswermain(R,C)},style:{float:"right"}})),D.a.createElement(Q.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(g.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return S(R)},style:{float:"right",visibility:C==P.length-1?"":"hidden"}}))))})))}}]),i}(r.Component);Ae.a=a},"815F":function(kt,Ae,U){"use strict";U.d(Ae,"e",function(){return $}),U.d(Ae,"c",function(){return r}),U.d(Ae,"d",function(){return D}),U.d(Ae,"a",function(){return g}),U.d(Ae,"f",function(){return m}),U.d(Ae,"b",function(){return a});var te=U("KQm4"),Q=U("VTBJ"),B=U("Ff2n"),J=U("Zm9Q"),K=U("Kwbf"),N=U("OZM5");function $(d,s){return d!=null?d:s}function z(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function i(t){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(o){var R=o.key,T=o.children;Object(K.a)(R!=null,"Tree node must have a certain key: [".concat(u).concat(R,"]"));var S=String(R);Object(K.a)(!s.has(S)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(S)),s.set(S,!0),i(T,"".concat(u).concat(S," > "))})}i(d)}function r(d){function s(i){var t=Object(J.a)(i);return t.map(function(u){if(!Object(N.i)(u))return Object(K.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var o=u.key,R=u.props,T=R.children,S=Object(B.a)(R,["children"]),A=Object(Q.a)({key:o},S),P=s(T);return P.length&&(A.children=P),A}).filter(function(u){return u})}return s(d)}function D(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(s===!0?[]:s),t=[];function u(o){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(T,S){var A=Object(N.h)(R?R.pos:"0",S),P=$(T.key,A),E=Object(Q.a)(Object(Q.a)({},T),{},{parent:R,pos:A,children:null,data:T,isStart:[].concat(Object(te.a)(R?R.isStart:[]),[S===0]),isEnd:[].concat(Object(te.a)(R?R.isEnd:[]),[S===o.length-1])});return t.push(E),s===!0||i.has(P)?E.children=u(T.children||[],E):E.children=[],E})}return u(d),t}function p(d,s,i){var t;i?typeof i=="string"?t=function(R){return R[i]}:typeof i=="function"&&(t=function(R){return i(R)}):t=function(R,T){return $(R.key,T)};function u(o,R,T){var S=o?o.children:d,A=o?Object(N.h)(T.pos,R):"0";if(o){var P=t(o,A),E={node:o,index:R,pos:A,key:P,parentPos:T.node?T.pos:null,level:T.level+1};s(E)}S&&S.forEach(function(b,h){u(b,h,{node:o,pos:A,level:T?T.level+1:-1})})}u(null)}function g(d){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.initWrapper,t=s.processEntity,u=s.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,R={},T={},S={posEntities:R,keyEntities:T};return i&&(S=i(S)||S),p(d,function(A){var P=A.node,E=A.index,b=A.pos,h=A.key,f=A.parentPos,C=A.level,x={node:P,index:E,key:h,pos:b,level:C},_=$(h,b);R[b]=x,T[_]=x,x.parent=R[f],x.parent&&(x.parent.children=x.parent.children||[],x.parent.children.push(x)),t&&t(x,S)},o),u&&u(S),S}function m(d,s){var i=s.expandedKeys,t=s.selectedKeys,u=s.loadedKeys,o=s.loadingKeys,R=s.checkedKeys,T=s.halfCheckedKeys,S=s.dragOverNodeKey,A=s.dropPosition,P=s.keyEntities,E=P[d],b={eventKey:d,expanded:i.indexOf(d)!==-1,selected:t.indexOf(d)!==-1,loaded:u.indexOf(d)!==-1,loading:o.indexOf(d)!==-1,checked:R.indexOf(d)!==-1,halfChecked:T.indexOf(d)!==-1,pos:String(E?E.pos:""),dragOver:S===d&&A===0,dragOverGapTop:S===d&&A===-1,dragOverGapBottom:S===d&&A===1};return b}function a(d){var s=d.data,i=d.expanded,t=d.selected,u=d.checked,o=d.loaded,R=d.loading,T=d.halfChecked,S=d.dragOver,A=d.dragOverGapTop,P=d.dragOverGapBottom,E=d.pos,b=d.active,h=Object(Q.a)(Object(Q.a)({},s),{},{expanded:i,selected:t,checked:u,loaded:o,loading:R,halfChecked:T,dragOver:S,dragOverGapTop:A,dragOverGapBottom:P,pos:E,active:b});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(K.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),d}}),h}},"8EBN":function(kt,Ae,U){(function(te){te(U("VrN/"))})(function(te){"use strict";te.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 Q=0;Q-1&&J.substring($+1,J.length);if(z)return te.findModeByExtension(z)},te.findModeByName=function(J){J=J.toLowerCase();for(var K=0;K=X.length?se.slice(X.length):se}).join(`
`)}var i=[],t=[""],u=new a.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){i.length=0,t=[""]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(q,O,M,X){if(O>=q.length||q[O].level<=M)return O;var se=q[O];X.push("- "+se.text+""),O++;var Z=[];return O=S(q,O,se.level,Z),Z.length>0&&(X.push("
"),Z.forEach(function(Le){X.push(Le)}),X.push("
")),X.push(" "),O=S(q,O,M,X),O}function A(){return S(i,0,0,t),t.push("
"),t.join("")}var P={heading:function(O){var M=o.exec(O);if(M)return{type:"heading",raw:M[0],depth:M[1].length,text:M[2]}},fences:function(O){var M=this.rules.block.fences.exec(O);if(M){var X=M[0],se=s(X,M[3]||""),Z=M[2]?M[2].trim():M[2];if(["latex","katex","math"].indexOf(Z)>=0){var Le=h(),ot=se;se=Le,f[Le]={type:"block",expression:ot}}return{type:"code",raw:X,lang:Z,text:se}}}},E=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,h=function(){return"__special_katext_id_".concat(b++,"__")},f={};function C(){return f}function x(){b=0,f={}}function _(q){return q=q.replace(E,function(O,M){var X=h();return f[X]={type:"inline",expression:M},X}),q}var j=u.listitem;u.listitem=function(q){return j(_(q))};var W=u.paragraph;u.paragraph=function(q){return W(_(q))};var w=u.tablecell;u.tablecell=function(q,O){return w(_(q),O)},u.code=function(q,O,M){var X=(O||"").match(/\S*/)[0];return X?["latex","katex","math"].indexOf(X)>=0?"".concat(q,"
"):'
').concat(M?q:Object(d.escape)(q,!0),`
`):''+(M?q:Object(d.escape)(q,!0))+"
"},u.heading=function(q,O,M){var X=this.options.headerPrefix+M.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:X,level:O,text:q}),"'+q+""},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:P,renderer:u});var F=a.a,I=U("SJMd"),v=U("ulZh"),H=U.n(v),Y=U("m3rI"),ie=U("Oy/b"),le=U("p5ED"),he=U("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 we=function(q,O){return(we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,X){M.__proto__=X}||function(M,X){for(var se in X)Object.prototype.hasOwnProperty.call(X,se)&&(M[se]=X[se])})(q,O)};function Pe(q,O){function M(){this.constructor=q}we(q,O),q.prototype=O===null?Object.create(O):(M.prototype=O.prototype,new M)}function xe(q,O,M,X){return new(M||(M=Promise))(function(se,Z){function Le(Lt){try{wt(X.next(Lt))}catch(ct){Z(ct)}}function ot(Lt){try{wt(X.throw(Lt))}catch(ct){Z(ct)}}function wt(Lt){var ct;Lt.done?se(Lt.value):(ct=Lt.value,ct instanceof M?ct:new M(function(Et){Et(ct)})).then(Le,ot)}wt((X=X.apply(q,O||[])).next())})}function Oe(q,O){var M,X,se,Z,Le={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return Z={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function ot(wt){return function(Lt){return function(ct){if(M)throw new TypeError("Generator is already executing.");for(;Le;)try{if(M=1,X&&(se=2&ct[0]?X.return:ct[0]?X.throw||((se=X.return)&&se.call(X),0):X.next)&&!(se=se.call(X,ct[1])).done)return se;switch(X=0,se&&(ct=[2&ct[0],se.value]),ct[0]){case 0:case 1:se=ct;break;case 4:return Le.label++,{value:ct[1],done:!1};case 5:Le.label++,X=ct[1],ct=[0];continue;case 7:ct=Le.ops.pop(),Le.trys.pop();continue;default:if(!(se=Le.trys,(se=se.length>0&&se[se.length-1])||ct[0]!==6&&ct[0]!==2)){Le=0;continue}if(ct[0]===3&&(!se||ct[1]>se[0]&&ct[1]',"select"),this.addActionButton(X,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(X,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(X,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(X,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(X,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(X,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(X,'',"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(Z){var Le=document.createElement("div");Le.className=""+M.toolbarButtonStyleClass.name,Le.setAttribute("data-type-name",Z.typeName),Le.innerHTML=Z.icon,Le.addEventListener("click",function(){M.markerToolbarButtonClicked(Le,Z)}),M.buttons.push(Le),M.markerButtons.push(Le)}),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 se=document.createElement("div");se.className=this.toolbarBlockStyleClass.name,se.style.whiteSpace="nowrap",se.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(se),this.addActionButton(se,'',"render"),this.addActionButton(se,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},q.prototype.addButtonClickListener=function(O){this.buttonClickListeners.push(O)},q.prototype.removeButtonClickListener=function(O){this.buttonClickListeners.indexOf(O)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(O),1)},q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var O=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var M=0;M0&&this.buttonClickListeners.forEach(function(X){return X("marker",M)}),this.markerButtonOverflowBlock.style.display="none"},q.prototype.actionToolbarButtonClicked=function(O,M){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("action",M)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},q.prototype.setActiveButton=function(O){this.resetButtonStyles(),O.className=O.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),O.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},q.prototype.setActiveMarkerButton=function(O){var M=this.markerButtons.find(function(X){return X.getAttribute("data-type-name")===O});M&&this.setActiveButton(M)},q.prototype.setCurrentMarker=function(O){var M=this;this.currentMarker=O,this.buttons.filter(function(X){return/delete|notes/.test(X.getAttribute("data-action"))}).forEach(function(X){M.currentMarker===void 0?(X.style.fillOpacity="0.4",X.style.pointerEvents="none"):(X.style.fillOpacity="1",X.style.pointerEvents="all")})},q}(),vt=function(){function q(O,M,X,se){this.panels=[],this.panelButtons=[],this.markerjsContainer=O,this.displayMode=M,this.uiStyleSettings=X,this.styles=se,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return q.prototype.addStyles=function(){var O;this.toolboxStyleClass=this.styles.addClass(new je("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 je("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var M=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new je("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new je("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new je("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 je("toolbox-panel-row_colors",`
background-color: `+((O=this.uiStyleSettings.toolboxBackgroundColor)!==null&&O!==void 0?O:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new je("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
padding: `+M+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new je("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new je("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new qe("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new qe("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},q.prototype.show=function(O){var M;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolboxStyleClass.name+" "+((M=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},q.prototype.setPanelButtons=function(O){var M,X,se=this;this.panels=O,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Z){var Le;Z.uiStyleSettings=se.uiStyleSettings;var ot=document.createElement("div");ot.className=se.toolboxButtonStyleClass.name+" "+((Le=se.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Le!==void 0?Le:se.toolboxButtonStyleColorsClass.name),ot.innerHTML=Z.icon,ot.title=Z.title,ot.addEventListener("click",function(){se.panelButtonClick(Z)}),se.panelButtons.push(ot),se.buttonRow.appendChild(ot)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},q.prototype.panelButtonClick=function(O){var M=this,X=-1;if(O!==this.activePanel){X=this.panels.indexOf(O),this.panelRow.innerHTML="";var se=O.getUi();se.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(se),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=O}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){M.displayMode==="inline"?M.panelRow.style.display="none":M.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Z,Le){var ot,wt;Z.className=M.toolboxButtonStyleClass.name+" "+(Le===X?""+((ot=M.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ot!==void 0?ot:M.toolboxActiveButtonStyleColorsClass.name):""+((wt=M.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&wt!==void 0?wt:M.toolboxButtonStyleColorsClass.name))})},q}(),Re=function(q,O){this.title=q,this.icon=O},Be=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'')||this;return Le.colors=[],Le.addTransparent=!1,Le.colorBoxes=[],Le.colors=X,Le.currentColor=se,Le.setCurrentColor=Le.setCurrentColor.bind(Le),Le.getColorBox=Le.getColorBox.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.whiteSpace="nowrap",this.colors.forEach(function(se){var Z=M.getColorBox(se);X.appendChild(Z),M.colorBoxes.push(Z)}),X},O.prototype.getColorBox=function(M){var X=this,se=this.uiStyleSettings.toolbarHeight/4,Z=this.uiStyleSettings.toolbarHeight-se,Le=document.createElement("div");Le.style.display="inline-block",Le.style.boxSizing="content-box",Le.style.width=Z-2+"px",Le.style.height=Z-2+"px",Le.style.padding="1px",Le.style.marginRight="2px",Le.style.marginBottom="2px",Le.style.borderWidth="2px",Le.style.borderStyle="solid",Le.style.borderRadius=(Z+2)/2+"px",Le.style.borderColor=M===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Le.addEventListener("click",function(){X.setCurrentColor(M,Le)});var ot=document.createElement("div");return ot.style.display="inline-block",ot.style.width=Z-2+"px",ot.style.height=Z-2+"px",ot.style.backgroundColor=M,ot.style.borderRadius=Z/2+"px",M==="transparent"&&(ot.style.fill=this.uiStyleSettings.toolboxAccentColor,ot.innerHTML=``),Le.appendChild(ot),Le},O.prototype.setCurrentColor=function(M,X){var se=this;this.currentColor=M,this.colorBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(M)},O}(Re),Ye=function(){function q(O,M,X){this._state="new",this._isSelected=!1,this._container=O,this._overlayContainer=M,this.globalSettings=X,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),q.prototype.ownsTarget=function(O){return!1},Object.defineProperty(q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},q.prototype.pointerDown=function(O,M){},q.prototype.dblClick=function(O,M){},q.prototype.manipulate=function(O){},q.prototype.pointerUp=function(O){this.stateChanged()},q.prototype.dispose=function(){},q.prototype.addMarkerVisualToContainer=function(O){this.container.childNodes.length>0?this.container.insertBefore(O,this.container.childNodes[0]):this.container.appendChild(O)},q.prototype.getState=function(){return{typeName:q.typeName,state:this.state,notes:this.notes}},q.prototype.restoreState=function(O){this._state=O.state,this.notes=O.notes},q.prototype.scale=function(O,M){},q.prototype.colorChanged=function(O){this.onColorChanged&&this.onColorChanged(O),this.stateChanged()},q.prototype.fillColorChanged=function(O){this.onFillColorChanged&&this.onFillColorChanged(O),this.stateChanged()},q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var O=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),O.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(O)&&this.onStateChanged(this)}},q.typeName="MarkerBase",q}(),Ke=function(){function q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return q.prototype.findGripByVisual=function(O){return this.topLeft.ownsTarget(O)?this.topLeft:this.topCenter.ownsTarget(O)?this.topCenter:this.topRight.ownsTarget(O)?this.topRight:this.centerLeft.ownsTarget(O)?this.centerLeft:this.centerRight.ownsTarget(O)?this.centerRight:this.bottomLeft.ownsTarget(O)?this.bottomLeft:this.bottomCenter.ownsTarget(O)?this.bottomCenter:this.bottomRight.ownsTarget(O)?this.bottomRight:void 0},q}(),yt=function(){function q(){this.GRIP_SIZE=10,this.visual=be.createGroup(),this.visual.appendChild(be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(be.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},q}(),Pt=function(){function q(){}return q.toITransformMatrix=function(O){return{a:O.a,b:O.b,c:O.c,d:O.d,e:O.e,f:O.f}},q.toSVGMatrix=function(O,M){return O.a=M.a,O.b=M.b,O.c=M.c,O.d=M.d,O.e=M.e,O.f=M.f,O},q}(),Ht=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.left=0,Z.top=0,Z.width=0,Z.height=0,Z.defaultSize={x:50,y:20},Z.offsetX=0,Z.offsetY=0,Z.rotationAngle=0,Z.CB_DISTANCE=10,Z._suppressMarkerCreateEvent=!1,Z.container.transform.baseVal.appendItem(be.createTransform()),Z.setupControlBox(),Z}return Pe(O,q),Object.defineProperty(O.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"visual",{get:function(){return this._visual},set:function(M){this._visual=M;var X=be.createTransform();this._visual.transform.baseVal.appendItem(X)},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(M){return!!q.prototype.ownsTarget.call(this,M)||!!(this.controlGrips.findGripByVisual(M)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M))},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.left=M.x,this.top=M.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var se=this.unrotatePoint(M);if(this.manipulationStartX=se.x,this.manipulationStartY=se.y,this.offsetX=se.x-this.left,this.offsetY=se.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(X),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X)){this.activeGrip=this.rotatorGrip;var Z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Z.x-this.width/2,this.top=Z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Le=this.container.transform.baseVal.getItem(0);Le.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Le,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},O.prototype.pointerUp=function(M){var X=this.state;q.prototype.pointerUp.call(this,M),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(M),this._state="select",X==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},O.prototype.moveVisual=function(M){this.visual.style.transform="translate("+M.x+"px, "+M.y+"px)"},O.prototype.manipulate=function(M){var X=this.unrotatePoint(M);this.state==="creating"?this.resize(M):this.state==="move"?(this.left=this.manipulationStartLeft+(X.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(X.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(X):this.state==="rotate"&&this.rotate(M)},O.prototype.resize=function(M){var X=this.manipulationStartLeft,se=this.manipulationStartWidth,Z=this.manipulationStartTop,Le=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:X=this.manipulationStartLeft+M.x-this.manipulationStartX,se=this.manipulationStartWidth+this.manipulationStartLeft-X;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:se=this.manipulationStartWidth+M.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Z=this.manipulationStartTop+M.y-this.manipulationStartY,Le=this.manipulationStartHeight+this.manipulationStartTop-Z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Le=this.manipulationStartHeight+M.y-this.manipulationStartY}se>=0?(this.left=X,this.width=se):(this.left=X+se,this.width=-se),Le>=0?(this.top=Z,this.height=Le):(this.top=Z+Le,this.height=-Le),this.setSize()},O.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},O.prototype.rotate=function(M){if(Math.abs(M.x-this.centerX)>.1){var X=Math.sign(M.x-this.centerX);this.rotationAngle=180*Math.atan((M.y-this.centerY)/(M.x-this.centerX))/Math.PI+90*X,this.applyRotation()}},O.prototype.applyRotation=function(){var M=this.container.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(M,0)},O.prototype.rotatePoint=function(M){if(this.rotationAngle===0)return M;var X=this.container.getCTM(),se=be.createPoint(M.x,M.y);return{x:(se=se.matrixTransform(X)).x,y:se.y}},O.prototype.unrotatePoint=function(M){if(this.rotationAngle===0)return M;var X=this.container.getCTM();X=X.inverse();var se=be.createPoint(M.x,M.y);return{x:(se=se.matrixTransform(X)).x,y:se.y}},O.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=be.createGroup();var M=be.createTransform();M.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(M),this.container.appendChild(this.controlBox),this.controlRect=be.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=be.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ke,this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){var M=this.controlBox.transform.baseVal.getItem(0);M.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(M,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},O.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},O.prototype.createGrip=function(){var M=new yt;return M.visual.transform.baseVal.appendItem(be.createTransform()),this.controlBox.appendChild(M.visual),M},O.prototype.positionGrips=function(){var M=this.controlGrips.topLeft.GRIP_SIZE,X=-M/2,se=X,Z=(this.width+this.CB_DISTANCE)/2-M/2,Le=(this.height+this.CB_DISTANCE)/2-M/2,ot=this.height+this.CB_DISTANCE-M/2,wt=this.width+this.CB_DISTANCE-M/2;this.positionGrip(this.controlGrips.topLeft.visual,X,se),this.positionGrip(this.controlGrips.topCenter.visual,Z,se),this.positionGrip(this.controlGrips.topRight.visual,wt,se),this.positionGrip(this.controlGrips.centerLeft.visual,X,Le),this.positionGrip(this.controlGrips.centerRight.visual,wt,Le),this.positionGrip(this.controlGrips.bottomLeft.visual,X,ot),this.positionGrip(this.controlGrips.bottomCenter.visual,Z,ot),this.positionGrip(this.controlGrips.bottomRight.visual,wt,ot),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Z,se-3*this.CB_DISTANCE)},O.prototype.positionGrip=function(M,X,se){var Z=M.transform.baseVal.getItem(0);Z.setTranslate(X,se),M.transform.baseVal.replaceItem(Z,0)},O.prototype.hideControlBox=function(){this.controlBox.style.display="none"},O.prototype.showControlBox=function(){this.controlBox.style.display=""},O.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Pt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Pt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.left=X.left,this.top=X.top,this.width=X.width,this.height=X.height,this.rotationAngle=X.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,X.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Pt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,X.containerTransformMatrix))},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X);var se=this.rotatePoint({x:this.left,y:this.top}),Z=this.unrotatePoint({x:se.x*M,y:se.y*X});this.left=Z.x,this.top=Z.y,this.width=this.width*M,this.height=this.height*X,this.adjustControlBox()},O}(Ye),Xt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual)},O.prototype.createVisual=function(){this.visual=be.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.setSize()},O.prototype.setSize=function(){q.prototype.setSize.call(this),be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(M){q.prototype.pointerUp.call(this,M),this.setSize()},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},O.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&be.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){var X=M;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize()},O.title="Rectangle marker",O}(Ht),an=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'')||this;return Le.widths=[],Le.widthBoxes=[],Le.widths=X,Le.currentWidth=se,Le.setCurrentWidth=Le.setCurrentWidth.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.widths.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.flexGrow="2",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=se===M.currentWidth?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentWidth(se,Z)}),X.appendChild(Z);var Le=document.createElement("div");Le.innerText=se.toString(),Le.style.marginRight="5px",Z.appendChild(Le);var ot=document.createElement("div");ot.style.minHeight="20px",ot.style.flexGrow="2",ot.style.display="flex",ot.style.alignItems="center";var wt=document.createElement("hr");wt.style.minWidth="20px",wt.style.border="0px",wt.style.borderTop=se+"px solid "+M.uiStyleSettings.toolboxColor,wt.style.flexGrow="2",ot.appendChild(wt),Z.appendChild(ot),M.widthBoxes.push(Z)}),X},O.prototype.setCurrentWidth=function(M,X){var se=this;this.currentWidth=M,this.widthBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},O}(Re),tn=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'')||this;return Le.styles=[],Le.styleBoxes=[],Le.styles=X,Le.currentStyle=se,Le.setCurrentStyle=Le.setCurrentStyle.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.styles.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/M.styles.length-5+"%",Z.style.borderColor=se===M.currentStyle?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentStyle(se,Z)}),X.appendChild(Z);var Le=document.createElement("div");Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.overflow="hidden";var ot=``;Le.innerHTML=ot,Z.appendChild(Le),M.styleBoxes.push(Z)}),X},O.prototype.setCurrentStyle=function(M,X){var se=this;this.currentStyle=M,this.styleBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},O}(Re),et=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new tn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Pe(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="FrameMarker",O.title="Frame marker",O.icon='',O}(Xt),Ze=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},Ct=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.x1=0,Z.y1=0,Z.x2=0,Z.y2=0,Z.defaultLength=50,Z.manipulationStartX=0,Z.manipulationStartY=0,Z.manipulationStartX1=0,Z.manipulationStartY1=0,Z.manipulationStartX2=0,Z.manipulationStartY2=0,Z.setupControlBox(),Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!!q.prototype.ownsTarget.call(this,M)||!(!this.grip1.ownsTarget(M)&&!this.grip2.ownsTarget(M))},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.manipulationStartX=M.x,this.manipulationStartY=M.y,this.state==="new"&&(this.x1=M.x,this.y1=M.y,this.x2=M.x,this.y2=M.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(X)?this.activeGrip=this.grip1:this.grip2.ownsTarget(X)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},O.prototype.pointerUp=function(M){var X=this.state;q.prototype.pointerUp.call(this,M),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(M),this._state="select",X==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},O.prototype.adjustVisual=function(){},O.prototype.manipulate=function(M){this.state==="creating"?this.resize(M):this.state==="move"?(this.x1=this.manipulationStartX1+M.x-this.manipulationStartX,this.y1=this.manipulationStartY1+M.y-this.manipulationStartY,this.x2=this.manipulationStartX2+M.x-this.manipulationStartX,this.y2=this.manipulationStartY2+M.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(M)},O.prototype.resize=function(M){switch(this.activeGrip){case this.grip1:this.x1=M.x,this.y1=M.y;break;case this.grip2:case void 0:this.x2=M.x,this.y2=M.y}this.adjustVisual(),this.adjustControlBox()},O.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=be.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){this.positionGrips()},O.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},O.prototype.createGrip=function(){var M=new yt;return M.visual.transform.baseVal.appendItem(be.createTransform()),this.controlBox.appendChild(M.visual),M},O.prototype.positionGrips=function(){var M=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-M/2,this.y1-M/2),this.positionGrip(this.grip2.visual,this.x2-M/2,this.y2-M/2)},O.prototype.positionGrip=function(M,X,se){var Z=M.transform.baseVal.getItem(0);Z.setTranslate(X,se),M.transform.baseVal.replaceItem(Z,0)},O.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.x1=X.x1,this.y1=X.y1,this.x2=X.x2,this.y2=X.y2},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.x1=this.x1*M,this.y1=this.y1*X,this.x2=this.x2*M,this.y2=this.y2*X,this.adjustVisual(),this.adjustControlBox()},O}(Ye),At=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new tn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorLine&&M!==this.visibleLine)},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.selectorLine=be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},O.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),be.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),be.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.createVisual(),this.adjustVisual()},O.typeName="LineMarker",O.title="Line marker",O.icon='',O}(Ct),dt=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'')||this;return Le.fonts=[],Le.fontBoxes=[],Le.fonts=X,Le.currentFont=se,Le.setCurrentFont=Le.setCurrentFont.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.flexGrow="2",this.fonts.forEach(function(se){var Z=document.createElement("div");Z.style.display="inline-block",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/M.fonts.length-5+"%",Z.style.borderColor=se===M.currentFont?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentFont(se,Z)}),X.appendChild(Z);var Le=document.createElement("div");Le.style.display="flex",Le.style.minHeight="20px",Le.style.flexGrow="2",Le.style.fontFamily=se,Le.style.overflow="hidden";var ot=document.createElement("div");ot.style.whiteSpace="nowrap",ot.style.overflow="hidden",ot.style.textOverflow="ellipsis",ot.innerHTML="The quick brown fox jumps over the lazy dog",Le.appendChild(ot),Z.appendChild(Le),M.fontBoxes.push(Z)}),X},O.prototype.setCurrentFont=function(M,X){var se=this;this.currentFont=M,this.fontBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},O}(Re),ft=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.color="transparent",Z.padding=5,Z.DEFAULT_TEXT="your text here",Z.text=Z.DEFAULT_TEXT,Z.isMoved=!1,Z.color=se.defaultColor,Z.fontFamily=se.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setColor=Z.setColor.bind(Z),Z.setFont=Z.setFont.bind(Z),Z.renderText=Z.renderText.bind(Z),Z.sizeText=Z.sizeText.bind(Z),Z.textEditDivClicked=Z.textEditDivClicked.bind(Z),Z.showTextEditor=Z.showTextEditor.bind(Z),Z.setSize=Z.setSize.bind(Z),Z.positionTextEditor=Z.positionTextEditor.bind(Z),Z.colorPanel=new Be("Color",se.defaultColorSet,se.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.fontFamilyPanel=new dt("Font",se.defaultFontFamilies,se.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){if(q.prototype.ownsTarget.call(this,M)||M===this.visual||M===this.textElement||M===this.bgRectangle)return!0;var X=!1;return this.textElement.childNodes.forEach(function(se){se===M&&(X=!0)}),X},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.bgRectangle=be.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=be.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(be.createTransform()),this.textElement.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.isMoved=!1,this.pointerDownPoint=M,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.renderText=function(){var M=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(X){M.textElement.appendChild(be.createTSpan(X.trim()===""?" ":X.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},O.prototype.getTextScale=function(){var M=this.textElement.getBBox(),X=1;if(M.width>0&&M.height>0){var se=(1*this.width-this.width*this.padding*2/100)/M.width,Z=(1*this.height-this.height*this.padding*2/100)/M.height;X=Math.min(se,Z)}return X},O.prototype.getTextPosition=function(M){var X=this.textElement.getBBox(),se=0,Z=0;return X.width>0&&X.height>0&&(se=(this.width-X.width*M)/2,Z=this.height/2-X.height*M/2),{x:se,y:Z}},O.prototype.sizeText=function(){var M=this.textElement.getBBox(),X=this.getTextScale(),se=this.getTextPosition(X);se.y-=M.y*X,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+se.x+"px, "+se.y+"px) scale("+X+", "+X+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(se.x,se.y),this.textElement.transform.baseVal.getItem(1).setScale(X,X))},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(M.x-this.pointerDownPoint.x)>5||Math.abs(M.y-this.pointerDownPoint.y)>5)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.isMoved=!0,this.setSize(),this.sizeText()},O.prototype.setSize=function(){q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},O.prototype.pointerUp=function(M){var X=this.state;X==="creating"&&(this._suppressMarkerCreateEvent=!0),q.prototype.pointerUp.call(this,M),this.setSize(),(X==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},O.prototype.showTextEditor=function(){var M=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(X){X.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var X=Number.parseFloat(M.textEditor.style.fontSize);M.textEditor.clientWidth>=Number.parseInt(M.textEditor.style.maxWidth)&&X>.9;)X-=.1,M.textEditor.style.fontSize=Math.max(X,.9)+"em"}),this.textEditor.addEventListener("keyup",function(X){X.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(X){if(X.clipboardData){var se=X.clipboardData.getData("text"),Z=window.getSelection();if(!Z.rangeCount)return!1;Z.deleteFromDocument(),Z.getRangeAt(0).insertNode(document.createTextNode(se)),X.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){M.textEditDivClicked(M.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},O.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var M=this.getTextScale(),X=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),se=this.textElement.getBBox(),Z={x:se.width*M,y:se.height*M};X.x-=Z.x/2,X.y-=Z.y/2,this.textEditor.style.top=X.y+"px",this.textEditor.style.left=X.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-X.x+"px",this.textEditor.style.fontSize=Math.max(16*M,12)+"px",this.textElement.style.display="none"}},O.prototype.textEditDivClicked=function(M){this.text=M.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},O.prototype.select=function(){q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},O.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),q.prototype.deselect.call(this)},O.prototype.dblClick=function(M,X){q.prototype.dblClick.call(this,M,X),this.showTextEditor()},O.prototype.setColor=function(M){this.textElement&&be.setAttributes(this.textElement,[["fill",M]]),this.color=M,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(M)},O.prototype.setFont=function(M){this.textElement&&be.setAttributes(this.textElement,[["font-family",M]]),this.fontFamily=M,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},O.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},O.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var X=M;this.color=X.color,this.fontFamily=X.fontFamily,this.padding=X.padding,this.text=X.text,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize(),this.sizeText(),this.positionTextEditor()},O.typeName="TextMarker",O.title="Text marker",O.icon='',O}(Ht),He=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.color="transparent",Z.lineWidth=3,Z.drawing=!1,Z.pixelRatio=1,Z.color=se.defaultColor,Z.lineWidth=se.defaultStrokeWidth,Z.pixelRatio=se.freehandPixelRatio,Z.setColor=Z.setColor.bind(Z),Z.addCanvas=Z.addCanvas.bind(Z),Z.finishCreation=Z.finishCreation.bind(Z),Z.setLineWidth=Z.setLineWidth.bind(Z),Z.colorPanel=new Be("Color",se.defaultColorSet,se.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.lineWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.lineWidthPanel.onWidthChanged=Z.setLineWidth,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.drawingImage)},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.drawingImage=be.createImage(),this.visual.appendChild(this.drawingImage);var M=be.createTransform();this.visual.transform.baseVal.appendItem(M),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){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(M.x,M.y),this.drawing=!0):q.prototype.pointerDown.call(this,M,X)},O.prototype.manipulate=function(M){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(M.x,M.y),this.canvasContext.stroke()):q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(M){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):q.prototype.pointerUp.call(this,M)},O.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},O.prototype.select=function(){this.state==="creating"&&this.finishCreation(),q.prototype.select.call(this)},O.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),q.prototype.deselect.call(this)},O.prototype.finishCreation=function(){for(var M=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),X=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],se=X[0],Z=X[1],Le=X[2],ot=X[3],wt=!1,Lt=0;Lt0&&(wt=!0,Ltot&&(ot=Lt),ct>Le&&(Le=ct));if(wt){this.left=se/this.pixelRatio,this.top=Z/this.pixelRatio,this.width=(Le-se)/this.pixelRatio,this.height=(ot-Z)/this.pixelRatio;var Et=document.createElement("canvas");Et.width=Le-se,Et.height=ot-Z,Et.getContext("2d").putImageData(this.canvasContext.getImageData(se,Z,Le-se,ot-Z),0,0),this.drawingImgUrl=Et.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},O.prototype.setDrawingImage=function(){be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},O.prototype.setColor=function(M){this.color=M,this.colorChanged(M)},O.prototype.setLineWidth=function(M){this.lineWidth=M},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({drawingImgUrl:this.drawingImgUrl},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){this.createVisual(),q.prototype.restoreState.call(this,M),this.drawingImgUrl=M.drawingImgUrl,this.setDrawingImage()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setDrawingImage()},O.typeName="FreehandMarker",O.title="Freehand marker",O.icon='',O}(Ht),Ne=function(q){function O(M,X,se){var Z=q.call(this,M,se||'')||this;return Z.typeBoxes=[],Z.currentType=X,Z.setCurrentType=Z.setCurrentType.bind(Z),Z}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2";for(var se=function(ot){var wt="both";switch(ot){case 0:wt="both";break;case 1:wt="start";break;case 2:wt="end";break;case 3:wt="none"}var Lt=document.createElement("div");if(Lt.style.display="flex",Lt.style.flexGrow="2",Lt.style.alignItems="center",Lt.style.justifyContent="space-between",Lt.style.padding="5px",Lt.style.borderWidth="2px",Lt.style.borderStyle="solid",Lt.style.borderColor=wt===Z.currentType?Z.uiStyleSettings.toolboxAccentColor:"transparent",Lt.addEventListener("click",function(){M.setCurrentType(wt,Lt)}),X.appendChild(Lt),wt==="both"||wt==="start"){var ct=document.createElement("div");ct.style.display="flex",ct.style.alignItems="center",ct.style.minHeight="20px",ct.innerHTML=``,ct.style.marginLeft="5px",Lt.appendChild(ct)}var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.minHeight="20px",Et.style.flexGrow="2";var Mt=document.createElement("hr");if(Mt.style.minWidth="20px",Mt.style.border="0px",Mt.style.borderTop="3px solid "+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee"),Mt.style.flexGrow="2",Et.appendChild(Mt),Lt.appendChild(Et),wt==="both"||wt==="end"){var Cn=document.createElement("div");Cn.style.display="flex",Cn.style.alignItems="center",Cn.style.minHeight="20px",Cn.innerHTML=``,Cn.style.marginRight="5px",Lt.appendChild(Cn)}Z.typeBoxes.push(Lt)},Z=this,Le=0;Le<4;Le++)se(Le);return X},O.prototype.setCurrentType=function(M,X){var se=this;this.currentType=M,this.typeBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},O}(Re),Ue=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.arrowType="end",Z.arrowBaseHeight=10,Z.arrowBaseWidth=10,Z.getArrowPoints=Z.getArrowPoints.bind(Z),Z.setArrowType=Z.setArrowType.bind(Z),Z.arrowTypePanel=new Ne("Arrow type","end"),Z.arrowTypePanel.onArrowTypeChanged=Z.setArrowType,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.arrow1&&M!==this.arrow2)},O.prototype.getArrowPoints=function(M,X){var se=this.arrowBaseWidth+2*this.strokeWidth,Z=this.arrowBaseHeight+2*this.strokeWidth;return M-se/2+","+(X+Z/2)+" "+M+","+(X-Z/2)+" "+(M+se/2)+","+(X+Z/2)},O.prototype.createTips=function(){this.arrow1=be.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=be.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.arrow2)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if(q.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",be.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),be.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.arrow1.transform.baseVal.getItem(0);X.setRotate(M,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(X,0);var se=this.arrow2.transform.baseVal.getItem(0);se.setRotate(M+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(se,0)}},O.prototype.setArrowType=function(M){this.arrowType=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({arrowType:this.arrowType},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.arrowType=X.arrowType,this.createTips(),this.adjustVisual()},O.typeName="ArrowMarker",O.title="Arrow marker",O.icon='',O}(At),ge=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor=se.defaultFillColor,Z.strokeWidth=0,Z.fillPanel=new Be("Color",se.defaultColorSet,se.defaultFillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z}return Pe(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="CoverMarker",O.title="Cover marker",O.icon='',O}(Xt),Ee=function(q){function O(M,X,se,Z){var Le=q.call(this,M,Z||'')||this;return Le.opacities=[],Le.opacityBoxes=[],Le.opacities=X,Le.currentOpacity=se,Le.setCurrentOpacity=Le.setCurrentOpacity.bind(Le),Le}return Pe(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",X.style.justifyContent="space-between",this.opacities.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="center",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=se===M.currentOpacity?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentOpacity(se,Z)}),X.appendChild(Z);var Le=document.createElement("div");Le.innerText=100*se+"%",Z.appendChild(Le),M.opacityBoxes.push(Z)}),X},O.prototype.setCurrentOpacity=function(M,X){var se=this;this.currentOpacity=M,this.opacityBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},O}(Re),De=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.setOpacity=Z.setOpacity.bind(Z),Z.fillColor=se.defaultHighlightColor,Z.strokeWidth=0,Z.opacity=se.defaultHighlightOpacity,Z.fillPanel=new Be("Color",se.defaultColorSet,Z.fillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z.opacityPanel=new Ee("Opacity",se.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return Pe(O,q),O.prototype.setOpacity=function(M){this.opacity=M,this.visual&&be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="HighlightMarker",O.title="Highlight marker",O.icon='',O}(ge),ue='',Fe=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.bgColor="transparent",Z.tipPosition={x:0,y:0},Z.tipBase1Position={x:0,y:0},Z.tipBase2Position={x:0,y:0},Z.tipMoving=!1,Z.color=se.defaultStrokeColor,Z.bgColor=se.defaultFillColor,Z.fontFamily=se.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setBgColor=Z.setBgColor.bind(Z),Z.getTipPoints=Z.getTipPoints.bind(Z),Z.positionTip=Z.positionTip.bind(Z),Z.setTipPoints=Z.setTipPoints.bind(Z),Z.colorPanel=new Be("Text color",se.defaultColorSet,Z.color,''),Z.colorPanel.onColorChanged=Z.setColor,Z.bgColorPanel=new Be("Fill color",se.defaultColorSet,Z.bgColor,ue),Z.bgColorPanel.onColorChanged=Z.setBgColor,Z.fontFamilyPanel=new dt("Font",se.defaultFontFamilies,se.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z.tipGrip=new yt,Z.tipGrip.visual.transform.baseVal.appendItem(be.createTransform()),Z.controlBox.appendChild(Z.tipGrip.visual),Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return q.prototype.ownsTarget.call(this,M)||this.tipGrip.ownsTarget(M)||this.tip===M},O.prototype.createTip=function(){be.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=be.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},O.prototype.pointerDown=function(M,X){this.state==="new"&&q.prototype.pointerDown.call(this,M,X),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(X)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):q.prototype.pointerDown.call(this,M,X)},O.prototype.pointerUp=function(M){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,q.prototype.pointerUp.call(this,M);else{var X=this.state==="creating";q.prototype.pointerUp.call(this,M),this.setTipPoints(X),this.positionTip()}},O.prototype.manipulate=function(M){if(this.tipMoving){var X=this.unrotatePoint(M);this.tipPosition={x:X.x-this.manipulationStartLeft,y:X.y-this.manipulationStartTop},this.positionTip()}else q.prototype.manipulate.call(this,M)},O.prototype.setBgColor=function(M){this.bgRectangle&&this.tip&&(be.setAttributes(this.bgRectangle,[["fill",M]]),be.setAttributes(this.tip,[["fill",M]])),this.bgColor=M,this.fillColorChanged(M)},O.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},O.prototype.setTipPoints=function(M){M===void 0&&(M=!1);var X=Math.min(this.height/2,15),se=this.height/5;M&&(this.tipPosition={x:X+se/2,y:this.height+20});var Z=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?Z',O}(ft),at=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.fillColor=se.defaultFillColor,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.setOpacity=Z.setOpacity.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z.strokePanel=new Be("Line color",pe(se.defaultColorSet,["transparent"]),se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.fillPanel=new Be("Fill color",pe(se.defaultColorSet,["transparent"]),Z.fillColor,ue),Z.fillPanel.onColorChanged=Z.setFillColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new tn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z.opacityPanel=new Ee("Opacity",se.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual)},O.prototype.createVisual=function(){this.visual=be.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.setSize()},O.prototype.setSize=function(){q.prototype.setSize.call(this),be.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},O.prototype.pointerUp=function(M){q.prototype.pointerUp.call(this,M),this.setSize()},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},O.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&be.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(M),this.stateChanged()},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.setOpacity=function(M){this.opacity=M,this.visual&&be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var X=M;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize()},O.typeName="EllipseMarker",O.title="Ellipse marker",O.icon='',O}(Ht),xt=function(q){function O(M,X,se){return q.call(this,M,X,se)||this}return Pe(O,q),Object.defineProperty(O.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.tip1&&M!==this.tip2)},O.prototype.createTips=function(){this.tip1=be.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(be.createTransform()),this.visual.appendChild(this.tip1),this.tip2=be.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(be.createTransform()),this.visual.appendChild(this.tip2)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(be.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()]]),be.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 M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.tip1.transform.baseVal.getItem(0);X.setRotate(M,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(X,0);var se=this.tip2.transform.baseVal.getItem(0);se.setRotate(M+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(se,0)}},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M),this.createTips(),this.adjustVisual()},O.typeName="MeasurementMarker",O.title="Measurement marker",O.icon='',O}(At),Gt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokePanel.colors=se.defaultColorSet,Z.fillColor="transparent",Z}return Pe(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="EllipseFrameMarker",O.title="Ellipse frame marker",O.icon='',O}(at),$t=function(){function q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),q.prototype.addUndoStep=function(O){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(O)||(this.undoStack.push(O),JSON.stringify(this.lastRedoStep)!==JSON.stringify(O)&&this.redoStack.splice(0,this.redoStack.length))},q.prototype.replaceLastUndoStep=function(O){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=O)},q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},q.prototype.undo=function(){if(this.undoStack.length>1){var O=this.undoStack.pop();return O!==void 0&&this.redoStack.push(O),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},q}(),Yt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.curveX=0,Z.curveY=0,Z.manipulationStartCurveX=0,Z.manipulationStartCurveY=0,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.positionGrips=Z.positionGrips.bind(Z),Z.addControlGrips=Z.addControlGrips.bind(Z),Z.adjustVisual=Z.adjustVisual.bind(Z),Z.setupControlBox=Z.setupControlBox.bind(Z),Z.resize=Z.resize.bind(Z),Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new tn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Pe(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorCurve&&M!==this.visibleCurve&&!this.curveGrip.ownsTarget(M))},O.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.selectorCurve=be.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=be.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=M.x,this.curveY=M.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(X)&&(this.activeGrip=this.curveGrip,this._state="resize")},O.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),be.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),be.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setupControlBox=function(){q.prototype.setupControlBox.call(this),this.curveControlLine1=be.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=be.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},O.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,q.prototype.addControlGrips.call(this)},O.prototype.positionGrips=function(){q.prototype.positionGrips.call(this);var M=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-M/2,this.curveY-M/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},O.prototype.manipulate=function(M){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+M.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+M.y-this.manipulationStartY),q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){this.activeGrip===this.curveGrip&&(this.curveX=M.x,this.curveY=M.y),q.prototype.resize.call(this,M),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual()},O.prototype.scale=function(M,X){this.curveX=this.curveX*M,this.curveY=this.curveY*X,q.prototype.scale.call(this,M,X)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.curveX=X.curveX,this.curveY=X.curveY,this.createVisual(),this.adjustVisual()},O.typeName="CurveMarker",O.title="Curve marker",O.icon='',O}(Ct),$n=function(){function q(O,M){M===void 0&&(M=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=O,this.cancelable=M}return Object.defineProperty(q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),q.prototype.preventDefault=function(){this._defaultPrevented=!0},q}(),vn=function(q){function O(M,X,se){var Z=q.call(this,M,!1)||this;return Z.dataUrl=X,Z.state=se,Z}return Pe(O,q),O}($n),ln=function(q){function O(M,X,se){se===void 0&&(se=!1);var Z=q.call(this,M,se)||this;return Z.marker=X,Z}return Pe(O,q),O}($n),hn=function(){function q(){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 q.prototype.addEventListener=function(O,M){this[O].push(M)},q.prototype.removeEventListener=function(O,M){var X=this[O].indexOf(M);X>-1&&this[O].splice(X,1)},q}(),Gn=function(){function q(O){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ze,this._isOpen=!1,this.undoRedoManager=new $t,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 hn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=q.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=O,this.targetRoot=document.body,this.width=O.clientWidth,this.height=O.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(q.prototype,"ALL_MARKER_TYPES",{get:function(){return[et,He,Ue,ft,Gt,at,De,Fe,xt,ge,At,Yt]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[et,He,Ue,ft,at,De,Fe]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[et,He,Ue,ft,De]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(O){var M=this;this._availableMarkerTypes.splice(0),O.forEach(function(X){if(typeof X=="string"){var se=M.ALL_MARKER_TYPES.find(function(Z){return Z.typeName===X});se!==void 0&&M._availableMarkerTypes.push(se)}else M._availableMarkerTypes.push(X)})},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(O){this._zoomLevel=O,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},q.prototype.show=function(){var O=this;this.styles.styleSheetRoot===void 0&&_e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=_e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(M){return M(new $n(O))})},q.prototype.render=function(){return xe(this,void 0,void 0,function(){var O;return Oe(this,function(M){switch(M.label){case 0:return this.setCurrentMarker(),(O=new fe).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.markersOnly=this.renderMarkersOnly,O.width=this.renderWidth,O.height=this.renderHeight,[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return M.sent(),[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,M.sent()]}})})},q.prototype.close=function(O){var M=this;if(O===void 0&&(O=!1),this.isOpen){var X=!1;O||this.eventListeners.beforeclose.forEach(function(se){var Z=new $n(M,!0);se(Z),Z.defaultPrevented&&(X=!0)}),X||(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(se){return se(new $n(M))}),this.detachEvents(),this._isOpen=!1)}},q.prototype.addMarkersToToolbar=function(){for(var O,M=[],X=0;Xthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*O:this.editorCanvas.clientWidth,X=M',O.title="Powered by marker.js",O.style.display="grid",O.style.alignItems="center",O.style.justifyItems="center",O.style.padding="3px",O.style.width="20px",O.style.height="20px",this.logoUI.appendChild(O),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},q.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")},q.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"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new st(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(O),1),O.dispose()},q.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())},q.prototype.toolbarButtonClicked=function(O,M){if(O==="marker"&&M!==void 0)this.createNewMarker(M);else if(O==="action")switch(M){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()}},q.prototype.deleteSelectedMarker=function(){var O=this;if(this._currentMarker!==void 0){var M=!1;if(this.eventListeners.markerbeforedelete.forEach(function(se){var Z=new ln(O,O._currentMarker,!0);se(Z),Z.defaultPrevented&&(M=!0)}),!M){var X=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(se){return se(new ln(O,X))})}}},q.prototype.clear=function(){var O=this,M=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Le){var ot=new ln(O,void 0,!0);Le(ot),ot.defaultPrevented&&(M=!0)}),!M)){this.setCurrentMarker();for(var X=function(Le){var ot=se.markers[Le];se.setCurrentMarker(se.markers[Le]),se._currentMarker.dispose(),se.markerImage.removeChild(se._currentMarker.container),se.markers.splice(se.markers.indexOf(se._currentMarker),1),se.eventListeners.markerdelete.forEach(function(wt){return wt(new ln(O,ot))})},se=this,Z=this.markers.length-1;Z>=0;Z--)X(Z);this.addUndoStep()}},Object.defineProperty(q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),q.prototype.showNotesEditor=function(){var O;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(O=this._currentMarker.notes)!==null&&O!==void 0?O:"",this.overlayContainer.appendChild(this.notesArea))},q.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)},q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},q.prototype.addUndoStep=function(){var O=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var M=this.getState(),X=this.undoRedoManager.getLastUndoStep();if(!X||X.width===M.width&&X.height===M.height){var se=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(M),se1&&this.panTo({x:O.clientX,y:O.clientY}))},q.prototype.onPointerUp=function(O){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(O.clientX,O.clientY)),this.isDragging=!1,this.addUndoStep()},q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},q.prototype.onKeyUp=function(O){this._currentMarker===void 0||this.notesArea!==void 0||O.key!=="Delete"&&O.key!=="Backspace"||this.deleteSelectedMarker()},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.markerImage.getBoundingClientRect();return{x:(O-X.left)/this.zoomLevel,y:(M-X.top)/this.zoomLevel}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},q.prototype.addLicenseKey=function(O){ne.addKey(O)},q.prototype.addEventListener=function(O,M){this.eventListeners.addEventListener(O,M)},q.prototype.removeEventListener=function(O,M){this.eventListeners.removeEventListener(O,M)},q.prototype.renderState=function(O){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(O),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),q.prototype.focus=function(){var O=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(M){return M(new $n(O))}))},q.prototype.blur=function(){var O=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(M){return M(new $n(O))}))},q.instanceCounter=0,q}();/* **********************************
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 fr=function(q,O){return(fr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,X){M.__proto__=X}||function(M,X){for(var se in X)Object.prototype.hasOwnProperty.call(X,se)&&(M[se]=X[se])})(q,O)};function vr(q,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");function M(){this.constructor=q}fr(q,O),q.prototype=O===null?Object.create(O):(M.prototype=O.prototype,new M)}function ir(q,O,M,X){return new(M||(M=Promise))(function(se,Z){function Le(Lt){try{wt(X.next(Lt))}catch(ct){Z(ct)}}function ot(Lt){try{wt(X.throw(Lt))}catch(ct){Z(ct)}}function wt(Lt){var ct;Lt.done?se(Lt.value):(ct=Lt.value,ct instanceof M?ct:new M(function(Et){Et(ct)})).then(Le,ot)}wt((X=X.apply(q,O||[])).next())})}function br(q,O){var M,X,se,Z,Le={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return Z={next:ot(0),throw:ot(1),return:ot(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function ot(wt){return function(Lt){return function(ct){if(M)throw new TypeError("Generator is already executing.");for(;Le;)try{if(M=1,X&&(se=2&ct[0]?X.return:ct[0]?X.throw||((se=X.return)&&se.call(X),0):X.next)&&!(se=se.call(X,ct[1])).done)return se;switch(X=0,se&&(ct=[2&ct[0],se.value]),ct[0]){case 0:case 1:se=ct;break;case 4:return Le.label++,{value:ct[1],done:!1};case 5:Le.label++,X=ct[1],ct=[0];continue;case 7:ct=Le.ops.pop(),Le.trys.pop();continue;default:if(!(se=Le.trys,(se=se.length>0&&se[se.length-1])||ct[0]!==6&&ct[0]!==2)){Le=0;continue}if(ct[0]===3&&(!se||ct[1]>se[0]&&ct[1]0&&M>0){var X=new Ge(O,M),se=X.ratio>=1?20:X.getHorizontalLength(20),Z=X.ratio<1?20:X.getVerticalLength(20),Le=document.createElementNS("http://www.w3.org/2000/svg","svg");Le.setAttribute("xmlns","http://www.w3.org/2000/svg"),Le.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Le);var ot=Jt.createDefs();Le.appendChild(ot);var wt=Jt.createElement("clipPath",[["id","text-bg-clip"]]);ot.appendChild(wt);var Lt=Jt.createPath(Jt.getHollowRectanglePath((24-se)/2,(24-Z)/2,se,Z,(24-se)/2+2,(24-Z)/2+2,se-4,Z-4));Le.appendChild(Lt);var ct=Jt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ct.appendChild(Jt.createTSpan(O+":"+M)),Le.appendChild(ct);var Et=ct.getBBox();Jt.setAttributes(ct,[["x",((24-Et.width)/2).toString()],["y",((24-Et.height)/2-Et.y).toString()]]);var Mt=Jt.createPath(Jt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Et.width))/2,(24-Math.ceil(Et.height))/2,Math.ceil(Et.width),Math.ceil(Et.height)));return wt.appendChild(Mt),Jt.setAttributes(Lt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Le),Le.outerHTML}return''},q}(),Me=function(q){function O(M,X,se){var Z=q.call(this,M,X)||this;return Z.isDropdownOpen=!1,Z.onClick=Z.dropdownButtonClicked,Z.dropdownButtons=se,Z}return vr(O,q),O.prototype.setupDropdown=function(){var M=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(X){X.className=M.className,X.colorsClassName=M.colorsClassName,M.dropdownBlock.appendChild(X.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},O.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},O.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},O.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},O.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},O.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},O}(yr),ye=function(){function q(O,M){this.GRIP_SIZE=10,this.color=O,this.fillColor=M,this.visual=Jt.createGroup(),this.visual.appendChild(Jt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Jt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},q.prototype.setCenter=function(O,M){this.visual.childNodes.forEach(function(X){return Jt.setAttributes(X,[["cx",O.toString()],["cy",M.toString()]])})},q}(),ve=function(){function q(O,M,X,se){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=O,this.canvasHeight=M,this.margin=X,this.container=se,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(q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(O){this._aspectRatio=O,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(O){this._isGridVisible=O,this.gridContainer&&Jt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(O){this._zoomFactor=O,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),q.prototype.open=function(){var O=this;this.cropShadeElement=Jt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Jt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var M=0;Mthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-M.height/2),Jt.setAttributes(this.cropRectElement,[["x",M.x.toString()],["y",M.y.toString()],["width",M.width.toString()],["height",M.height.toString()]]);var X=M.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Z,Le){var ot=M.y+X*(Le+1);Jt.setAttributes(Z,[["x1",""+M.x],["y1",""+ot],["x2",""+(M.x+M.width)],["y2",""+ot]])});var se=M.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Z,Le){var ot=M.x+se*(Le+1);Jt.setAttributes(Z,[["x1",""+ot],["y1",""+M.y],["x2",""+ot],["y2",""+(M.y+M.height)]])}),Jt.setAttributes(this.cropShadeElement,[["d",Jt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,M.x,M.y,M.width,M.height)]]),this.topLeftGrip.setCenter(M.x,M.y),this.topRightGrip.setCenter(M.x+M.width,M.y),this.bottomLeftGrip.setCenter(M.x,M.y+M.height),this.bottomRightGrip.setCenter(M.x+M.width,M.y+M.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},q.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)},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.container.getBoundingClientRect();return{x:O-X.left+this.margin,y:M-X.top+this.margin}},q.prototype.onPointerDown=function(O){this.container.setPointerCapture(O.pointerId),this.previousPoint=this.clientToLocalCoordinates(O.clientX,O.clientY),this.cropRectElement===O.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(O.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(O.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(O.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(O.target)&&(this.activeGrip=this.bottomRightGrip)},q.prototype.onPointerMove=function(O){if(this.isMoving)this.move(this.clientToLocalCoordinates(O.clientX,O.clientY));else if(this.activeGrip){var M=this.clientToLocalCoordinates(O.clientX,O.clientY);this.resize(M)}O.preventDefault()},q.prototype.onPointerUp=function(O){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(O.pointerId)},q.prototype.move=function(O){var M=O.x-this.previousPoint.x,X=O.y-this.previousPoint.y;this.zoomFactor!==1&&(M=-M/this.zoomFactor,X=-X/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+M),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+X),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=O},q.prototype.resize=function(O){var M=Object.assign({},this.cropRect),X=O.x-this.previousPoint.x,se=O.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:M.x+Xthis.canvasWidth*this.zoomFactor&&(X=this.canvasWidth*this.zoomFactor-M.width),M.width+=X}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(M.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(X),M.height=this.aspectRatio.getVerticalLength(M.width)):(M.y+=se,M.height=this.cropRect.y+this.cropRect.height-M.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?M.height=this.aspectRatio.getVerticalLength(M.width):M.height+=se}M.width<10&&(M.x=this.cropRect.x,M.width=10),M.height<10&&(M.y=this.cropRect.y,M.height=10),this.previousPoint=O,M.x>=this.margin&&M.y>=this.margin&&M.x-this.margin+M.width<=this.canvasWidth&&M.y-this.margin+M.height<=this.canvasHeight&&(this.cropRect=M,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var O=this.cropRect.x+this.cropRect.width/2,M=this.cropRect.y+this.cropRect.height/2,X=this.aspectRatio.getHorizontalLength(this.cropRect.height),se=this.aspectRatio.getVerticalLength(this.cropRect.width);X/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=O-this.cropRect.width/2,this.cropRect.y=M-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)}},q.prototype.getRescaledRect=function(O,M,X,se,Z,Le){var ot=X/O,wt=se/M;return{x:(Z.x-Le)*ot+Le,y:(Z.y-Le)*wt+Le,width:Z.width*ot,height:Z.height*wt}},q.prototype.scaleCanvas=function(O,M){var X=this.getRescaledRect(this.canvasWidth,this.canvasHeight,O,M,this.cropRect,this.margin);this.canvasWidth=O,this.canvasHeight=M,this.onCropChange&&this.onCropChange(X),this.setCropRectangle(X)},q}(),or=function(){function q(O){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=O,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(q.prototype,"angle",{get:function(){return this._angle},set:function(O){this._angle=O,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),q.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},q.prototype.onPointerDown=function(O){this.controlContainer.setPointerCapture(O.pointerId),this.isDragging=!0,this.previousPoint={x:O.clientX,y:O.clientY}},q.prototype.onPointerMove=function(O){this.isDragging&&(this.onAngleChange&&this.onAngleChange((O.clientX-this.previousPoint.x)/5),this.previousPoint.x=O.clientX)},q.prototype.onPointerUp=function(O){this.isDragging&&this.onAngleChange&&this.onAngleChange((O.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(O.pointerId)},q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var O=this.angleLabelText.getBBox();Jt.setAttributes(this.angleLabelElement,[["x",((this.width-O.width)/2).toString()],["y",(this.height/2).toString()]])}},q.prototype.positionScaleShape=function(){if(this.scaleShape){var O=this.scaleShape.transform.baseVal.getItem(0);O.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(O,0)}},q.prototype.getVisual=function(){var O=document.createElementNS("http://www.w3.org/2000/svg","svg");O.setAttribute("xmlns","http://www.w3.org/2000/svg"),O.setAttribute("width",this.width+"px"),O.setAttribute("height",this.height+"px"),O.setAttribute("viewBox","0 0 "+this.width+" "+this.height),O.style.flexShrink="0",document.body.appendChild(O);for(var M="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,X=1;X<=this.width/5+10;X++){var se=X%5==0?this.height/3:this.height/6;M+="h4v"+-se+"h1v"+se}M+="v1H0Z",this.scaleShape=Jt.createPath(M);var Z=Jt.createTransform();this.scaleShape.transform.baseVal.appendItem(Z),O.appendChild(this.scaleShape),this.angleLabelElement=Jt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Jt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Le=Jt.createTSpan("");return Le.innerHTML="°",this.angleLabelElement.appendChild(Le),O.appendChild(this.angleLabelElement),document.body.removeChild(O),O},q}(),en=function(){function q(){this.naturalSize=!1,this.imageType="image/png"}return q.prototype.rasterize=function(O,M,X,se,Z,Le,ot){var wt=this;return new Promise(function(Lt){var ct=document.createElement("canvas");ct.width=O.width.baseVal.value-2*se,ct.height=O.height.baseVal.value-2*se;var Et=1,Mt=1;wt.naturalSize===!0?(Et=M.naturalWidth/(O.width.baseVal.value-2*se)/Le,Mt=M.naturalHeight/(O.height.baseVal.value-2*se)/ot,ct.width=M.naturalWidth/Le,ct.height=M.naturalHeight/ot):wt.width!==void 0&&wt.height!==void 0&&(Et=wt.width/X.width,Mt=wt.height/X.height,ct.width*=Et,ct.height*=Mt);var Cn=ct.getContext("2d");Cn.translate(ct.width/2,ct.height/2),Cn.rotate(Z*Math.PI/180),Cn.scale(Le,ot),Cn.translate(-ct.width/2,-ct.height/2),Cn.drawImage(M,0,0,ct.width,ct.height);var Yn=document.createElement("canvas");Yn.width=X.width*Et,Yn.height=X.height*Mt,Yn.getContext("2d").putImageData(Cn.getImageData((X.x-se)*Et,(X.y-se)*Mt,X.width*Et,X.height*Mt),0,0),Lt(Yn.toDataURL(wt.imageType,wt.imageQuality))})},q}(),Ie=function(){function q(O){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=q.instanceCounter++,this.styles=new Ar(this.instanceNo),this.target=O,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(O){this._zoomToCropEnabled=O,O?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(O){this._isGridVisible=O,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(O){this._gridLines=O,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(O){this._rotationAngle=O,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"aspectRatio",{get:function(){var O;return(O=this._aspectRatio)!==null&&O!==void 0?O:this.aspectRatios[0]},set:function(O){this._aspectRatio=O},enumerable:!1,configurable:!0}),q.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},q.prototype.show=function(){this.showUI(),this.open()},q.prototype.close=function(O){O===void 0&&(O=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),O||this.closeEventListeners.forEach(function(M){return M()}),this._isOpen=!1)},q.prototype.addRenderEventListener=function(O){this.renderEventListeners.push(O)},q.prototype.removeRenderEventListener=function(O){this.renderEventListeners.indexOf(O)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(O),1)},q.prototype.addCloseEventListener=function(O){this.closeEventListeners.push(O)},q.prototype.removeCloseEventListener=function(O){this.closeEventListeners.indexOf(O)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(O),1)},q.prototype.setupResizeObserver=function(){var O=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){O.resize(O.target.clientWidth,O.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var O=1*this.target.clientWidth/this.target.clientHeight,M=this.contentDiv.clientWidth/O>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*O:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,X=M+2*this.CANVAS_MARGINO+this.CANVAS_MARGIN?this.target.offsetTop-(O+this.CANVAS_MARGIN):0;this.coverDiv.style.top=M+"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},q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},q.prototype.addTopToolbar=function(){var O=this;this.topToolbar=new pr,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 M=new Pr;M.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(M);var X=[];this.aspectRatios.forEach(function(Mt){var Cn=new yr(Ot.getIcon(Mt.horizontal,Mt.vertical),Mt.horizontal===0&&Mt.vertical===0?"FREE":Mt.horizontal+":"+Mt.vertical);Cn.onClick=function(){return O.ratioButtonClicked(Mt)},X.push(Cn)}),this.aspectRatioButton=new Me(Ot.getIcon(0,0),"Aspect ratio",X),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,M.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var se=new yr('',"Toggle grid");se.isActive=this.isGridVisible,se.onClick=function(){O.isGridVisible=!O.isGridVisible,se.isActive=O.isGridVisible},M.addButton(se);var Z=new yr('',"Zoom to selection");if(Z.isActive=this.zoomToCropEnabled,Z.onClick=function(){O.zoomToCropEnabled=!O.zoomToCropEnabled,Z.isActive=O.zoomToCropEnabled},M.addButton(Z),!Rr.isLicensed){var Le=new mt;this.topToolbar.addElementBlock(Le);var ot=document.createElement("div");ot.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var wt=document.createElement("a");wt.style.color="currentColor",wt.href="https://markerjs.com/products/cropro",wt.target="_blank",wt.innerHTML='',ot.appendChild(wt),Le.addElement(ot)}var Lt=new Pr;Lt.minWidth=3*this.toolbarHeight+"px",Lt.contentAlign="end",this.topToolbar.addButtonBlock(Lt);var ct=new yr('',"OK");ct.onClick=this.startRenderAndClose,Lt.addButton(ct),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ct.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Et=new yr('',"Close");Et.onClick=this.close,Lt.addButton(Et),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Et.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},q.prototype.addBottomToolbar=function(){var O=this;this.bottomToolbar=new pr,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 M=new Pr;M.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(M);var X=new yr('',"Rotate left");X.onClick=this.rotateLeftButtonClicked,M.addButton(X);var se=new yr('',"Rotate right");se.onClick=this.rotateRightButtonClicked,M.addButton(se);var Z=new mt;Z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Z),this.straightener=new or("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(Lt){O.rotateBy(Lt),O.straightener.angle=O.rotationAngle},Z.addElement(this.straightener.getUI());var Le=new Pr;Le.minWidth=2*this.toolbarHeight+"px",Le.contentAlign="end",this.bottomToolbar.addButtonBlock(Le);var ot=new yr('',"Flip horizontal");ot.onClick=this.flipHorizontallyButtonClicked,Le.addButton(ot);var wt=new yr('',"Flip vertical");wt.onClick=this.flipVerticallyButtonClicked,Le.addButton(wt)},q.prototype.ratioButtonClicked=function(O){this.aspectRatio=O,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ot.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ge(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},q.prototype.restoreState=function(O){if(O){var M=this.cropLayer.getRescaledRect(O.width,O.height,this.imageWidth,this.imageHeight,O.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(M),this.cropRectChanged(M),this.flippedHorizontally=O.flippedHorizontally,this.flippedVertically=O.flippedVertically,this.applyFlip(),this.rotationAngle=O.rotationAngle,this.applyRotation()}},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.cropImage.getBoundingClientRect();return{x:O-X.left,y:M-X.top}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var O=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},q.prototype.rotateLeftButtonClicked=function(){var O=this.rotationAngle-90;this.rotationAngle%90!=0&&(O+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(O)},q.prototype.rotateRightButtonClicked=function(){var O=this.rotationAngle+90;this.rotationAngle%90!=0&&(O-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(O)},q.prototype.rotateTo=function(O){O=(O=O>180?O-360:O)<=-180?O+360:O,this.rotationAngle=O,this.applyRotation()},q.prototype.rotateBy=function(O){this.rotateTo((this.rotationAngle+O)%360)},q.prototype.applyRotation=function(){var O=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var M=this.editingTargetRotationContainer.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(M,0);var X=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/X.width,this.imageHeight/X.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=O},q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},q.prototype.startRenderAndClose=function(){return ir(this,void 0,void 0,function(){var O,M;return br(this,function(X){switch(X.label){case 0:return[4,this.render()];case 1:return O=X.sent(),M=this.getState(),this.renderEventListeners.forEach(function(se){return se(O,M)}),this.close(!0),[2]}})})},q.prototype.render=function(){return ir(this,void 0,void 0,function(){var O;return br(this,function(M){switch(M.label){case 0:return(O=new en).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.width=this.renderWidth,O.height=this.renderHeight,this.unzoomFromCrop(),Jt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,O.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return M.sent(),[4,O.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,M.sent()]}})})},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Tn("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 Tn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Tn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var O=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Tn("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*O)+`px;
height: `+(this.toolbarHeight-2*O)+`px;
padding: `+O+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Tn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Tn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Nn("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Nn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Tn("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 Tn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Tn("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 Tn("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*O)+`px;
padding: `+O+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Tn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},q.instanceCounter=0,q}(),gt=U("8hTe"),Ce=U.n(gt),cn=/]*>/g;function hr(q){var O=document.createElement("div");return O.innerHTML=q,O.childNodes.length===0?"":O.childNodes[0].nodeValue}var mr=Ae.a=function(q){var O=q.value,M=O===void 0?"":O,X=q.edit,se=X===void 0?!1:X,Z=q.className,Le=q.showTextOnly,ot=q.showLines,wt=q.replaces,Lt=q.zoomImg,ct=q.hasMask,Et=q.style,Mt=Et===void 0?{}:Et,Cn=q.stylesPrev,Yn=Cn===void 0?{}:Cn,Hn=String(M),fn=Object(D.useRef)(),Wt=Object(D.useRef)(),sn=Object(D.useState)(""),qt=Object($.a)(sn,2),Ft=qt[0],Qn=qt[1],Bn=Object(D.useState)("office"),xn=Object($.a)(Bn,2),Jn=xn[0],pn=xn[1],Sn=function(){var _n=new Ie(Wt.current);_n.displayMode="popup",_n.addRenderEventListener(function(){var In=Object(N.a)(r.a.mark(function wn(Zn){var yn;return r.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return fn.current.style.display="none",qn.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Zn}});case 3:yn=qn.sent,yn!=null&&yn.id&&wt(Wt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 5:case"end":return qn.stop()}},wn)}));return function(wn){return In.apply(this,arguments)}}()),_n.show()},un=function(){var _n=new Gn(Wt.current);_n.settings.displayMode="popup",_n.addEventListener("render",function(){var In=Object(N.a)(r.a.mark(function wn(Zn){var yn;return r.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(fn.current.style.display="none",!Wt.current){qn.next=6;break}return qn.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Zn.dataUrl}});case 4:yn=qn.sent,yn!=null&&yn.id&&wt(Wt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 6:case"end":return qn.stop()}},wn)}));return function(wn){return In.apply(this,arguments)}}()),_n.show(),window.markerArea=_n},Un=Object(D.useMemo)(function(){fn.current&&(fn.current.style.zIndex=-1);try{var rn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,_n=/\"\/api\/attachments\/|\"\/attachments\/download\//g,In=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hn=Hn.replace(rn,"("+Y.a.API_SERVER+"/api/attachments/").replace(_n,'"'+Y.a.API_SERVER+"/api/attachments/").replace(In,'"'+Y.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Vn){}var wn=F(Hn),Zn=C();if(Hn.match(/\[TOC\]/)&&(wn=wn.replace("[TOC]
",A()),R()),wn=wn.replace(/(__special_katext_id_\d+__)/g,function(Vn,qn){var kn=Zn[qn],Pn=kn.type,Mn=kn.expression;return Object(ie.renderToString)(hr(Mn)||"",{displayMode:Pn==="block",throwOnError:!1,output:"html"})}),wn=wn.replace(/▁/g,"\u2581\u2581\u2581"),x(),Le){var yn=document.createElement("div");return yn.innerHTML=wn,yn.innerText}return setTimeout(function(){return Ln()},500),wn},[Hn]),Xn=Object(D.useRef)();T.WebkitLineClamp=ot,ot&&(Mt=Object(K.a)(Object(K.a)({},Mt),T));function nr(rn){var _n=rn.target;if(_n.tagName.toUpperCase()==="IMG"){if(Lt){var In=_n.getAttribute("src");Qn(In),pn("image")}}else if(_n.tagName.toUpperCase()==="A"){var wn=_n.getAttribute("href");if(wn.indexOf("office")>-1)rn.preventDefault(),Qn(wn),pn("office");else if(wn.indexOf("application/pdf")>-1)rn.preventDefault(),Qn(wn),pn("pdf");else if(wn.indexOf("text/html")>-1)rn.preventDefault(),Qn(wn),pn("html");else if(wn.startsWith("#")){rn.preventDefault();var Zn=document.getElementById(wn.replace("#",""));Zn&&Zn.scrollIntoView(!0)}}}var Ln=function(){var _n,In=(_n=Xn.current)===null||_n===void 0?void 0:_n.querySelectorAll("video");In==null||In.forEach(function(wn){if(wn.oncontextmenu=function(){return!1},wn.src.indexOf(".m3u8")>-1&&!wn.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var Zn=new H.a;Zn.loadSource(wn.src),Zn.attachMedia(wn)}}})};Object(D.useEffect)(function(){if(Xn.current&&Un&&(Un.match(cn)&&window.PR.prettyPrint()),Xn.current)return Xn.current.addEventListener("click",nr),function(){Xn.current.removeEventListener("click",nr),x(),R()}},[Un,Xn.current,nr]);var Kn=function(_n){if(!se)return;_n.target.nodeName==="IMG"?(fn.current.style.zIndex=1,fn.current.style.display="flex",fn.current.style.width=_n.target.clientWidth+"px",fn.current.style.height=_n.target.clientHeight+"px",fn.current.style.top=_n.target.offsetTop+"px",fn.current.style.left=_n.target.offsetLeft+"px",Wt.current.src=_n.target.getAttribute("src")):fn.current.style.display="none"};return p.a.createElement("div",{style:{position:"relative"}},p.a.createElement("div",{ref:Xn,style:Object(K.a)({},Mt),className:"".concat(Z||""," markdown-body ").concat(Ce.a.mdBody),onMouseOver:Kn,dangerouslySetInnerHTML:{__html:Un}}),p.a.createElement("div",{ref:fn,className:Ce.a.button},p.a.createElement(Q.a,null,p.a.createElement(J.a,{onClick:function(){return Sn()}},"\u88C1\u526A"),p.a.createElement(J.a,{onClick:function(){return un()}},"\u7F16\u8F91"))),p.a.createElement("img",{ref:Wt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),p.a.createElement(le.a,{close:!0,data:Ft,type:Ft!=null&&Ft.length?Jn:"",style:Object(K.a)({},Yn),onClose:function(){return Qn("")}}))}},"9VGf":function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return B});var te=U("q1tI"),Q=U.n(te);function B(J,K){var N=Object(te.useRef)();Object(te.useEffect)(function(){N.current=J}),Object(te.useEffect)(function(){function $(){N.current()}if(K!==null){var z=setInterval($,K);return function(){return clearInterval(z)}}},[K])}},"9z17":function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return S});var te=U("g9YV"),Q=U("wCAj"),B=U("5NDa"),J=U("5rEg"),K=U("y8nQ"),N=U("Vl3Y"),$=U("2qtc"),z=U("kLXV"),r=U("7Kak"),D=U("9yH6"),p=U("9og8"),g=U("tJVT"),m=U("WmNS"),a=U.n(m),d=U("q1tI"),s=U.n(d),i=U("ie49"),t=U.n(i),u=U("HBuW"),o=function(b){var h=b.total,f=b.used,C=b.copy,x=b.canNotCopy,_=b.inPaper,j="";return C>0&&x>0?j="\u5176\u4E2D\u6709".concat(C,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(x,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236"):C>0&&x===0?j="\u5176\u4E2D\u6709".concat(C,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236"):C===0&&x>0&&(j="\u5176\u4E2D\u6709".concat(x,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236")),"\u5F53\u524D\u9009\u4E2D".concat(h,"\u4E2A\u5B9E\u8BAD\u4E2D\uFF0C\u6709").concat(f,"\u4E2A\u5B9E\u8BAD\u5DF2\u5728\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C").concat(j).concat(_?"\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4F7F\u7528\u8BD5\u5377\uFF1F":"")},R=function(b){return b?{reproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u91CD\u590D\u4F7F\u7528\u7684\u5B9E\u8BAD\u672A\u5F00\u542F\u590D\u5236\u6743\u9650\uFF0C\u82E5\u7EE7\u7EED\u4F7F\u7528\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD"}:{reproducible:"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\u548C\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F"}},T=function(b){var h=b.onCancel,f=b.onOk,C=b.visible,x=b.inPaper,_=b.renderData,j=b.type,W=Object(d.useState)(1),w=Object(g.a)(W,2),F=w[0],I=w[1],v=Object(d.useState)(!1),H=Object(g.a)(v,2),Y=H[0],ie=H[1],le=Object(d.useMemo)(function(){return(_==null?void 0:_.total_num)===1&&(_==null?void 0:_.can_copy_num)===1},[_]);return s.a.createElement(s.a.Fragment,null,le?s.a.createElement(z.a,{centered:!0,closable:!0,visible:C,title:"\u63D0\u793A",width:600,confirmLoading:Y,onCancel:h,onOk:Object(p.a)(a.a.mark(function he(){return a.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return ie(!0),Pe.next=3,f(F);case 3:ie(!1);case 4:case"end":return Pe.stop()}},he)}))},s.a.createElement("div",{className:t.a.content,style:{marginBottom:20}},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u95EE\u662F\u5426\u590D\u5236\u6210\u65B0\u5B9E\u8BAD\u53D1\u9001\u81F3\u6559\u5B66\u8BFE\u5802\u4E2D\uFF1F"),s.a.createElement(D.a.Group,{value:F,onChange:function(we){return I(we.target.value)},className:t.a.content,style:{marginBottom:30}},s.a.createElement(D.a,{value:1,style:{color:"#464f66"}},"\u590D\u5236\u5B9E\u8BAD"),s.a.createElement(D.a,{value:0,style:{color:"#464f66"}},"\u4E0D\u590D\u5236\u5B9E\u8BAD")),s.a.createElement("div",{className:t.a.content,style:{marginBottom:10}},"\u8BF4\u660E\uFF1A"),s.a.createElement("div",{className:t.a.content},"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),s.a.createElement("div",{className:t.a.content},"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")):s.a.createElement(z.a,{centered:!0,closable:!0,visible:C,title:"\u63D0\u793A",width:600,onCancel:h,onOk:Object(p.a)(a.a.mark(function he(){return a.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return ie(!0),Pe.next=3,f(0);case 3:ie(!1);case 4:case"end":return Pe.stop()}},he)}))},s.a.createElement("div",{className:t.a.content},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F")))},S=function(){var b=Object(d.useState)(!1),h=Object(g.a)(b,2),f=h[0],C=h[1],x=Object(d.useState)(),_=Object(g.a)(x,2),j=_[0],W=_[1],w=function(){return C(!1)},F=function(){var I=Object(p.a)(a.a.mark(function v(H){var Y;return a.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,Object(u.p)(H);case 2:if(Y=le.sent,!("status"in Y)){le.next=5;break}return le.abrupt("return",!1);case 5:if(!(Y.repeat_shixun_num===0)){le.next=7;break}return le.abrupt("return",!1);case 7:return W(Y),C(!0),le.abrupt("return",!0);case 10:case"end":return le.stop()}},v)}));return function(H){return I.apply(this,arguments)}}();return[f,w,j,F]},A=function(b){var h=N.a.useForm(),f=Object(g.a)(h,1),C=f[0],x=Object(d.useState)(!1),_=Object(g.a)(x,2),j=_[0],W=_[1],w=b.onCancel,F=b.onOk,I=b.visible,v=b.inPaper,H=v===void 0?!1:v,Y=b.renderData,ie=b.type,le=Object(d.useMemo)(function(){return H?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Oe,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_copy"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426"))),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Oe,pe){return s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_use"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426")))}},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Oe,pe){return s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_copy"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426")))}}]},[H]),he=Object(d.useMemo)(function(){return H?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center",render:function(Oe,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement("span",null,Oe),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center"},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Oe,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],initialValue:0},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426"))),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})))}}]},[H]),we=Object(d.useMemo)(function(){return o({total:Y==null?void 0:Y.total_num,used:Y==null?void 0:Y.repeat_shixun_num,copy:Y==null?void 0:Y.can_copy_num,canNotCopy:Y==null?void 0:Y.no_copy_num,inPaper:H})},[Y,H]),Pe=Object(d.useMemo)(function(){return R(H)},[H]);return s.a.createElement(z.a,{title:"\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",centered:!0,visible:I,confirmLoading:j,onOk:Object(p.a)(a.a.mark(function xe(){var Oe,pe;return a.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return W(!0),Oe=C.getFieldsValue(),pe=Object.keys(Oe).map(function(fe){return{id:parseInt(fe),is_use:Oe[fe].is_use,is_copy:Oe[fe].is_copy}}),ne.next=5,F(pe);case 5:W(!1);case 6:case"end":return ne.stop()}},xe)})),onCancel:w,width:800,okText:"\u786E\u8BA4",className:t.a.antdModal,destroyOnClose:!0},s.a.createElement(N.a,{form:C,preserve:!1},s.a.createElement("div",{className:t.a.brief},we),(Y==null?void 0:Y.can_copy_num)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:t.a.contentTitle},"\u53EF\u590D\u5236\u5B9E\u8BAD"),s.a.createElement("div",{className:t.a.content},Pe.reproducible),s.a.createElement("div",{className:t.a.tips},s.a.createElement("div",null,"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),s.a.createElement("div",null,"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")),s.a.createElement(Q.a,{columns:le,className:t.a.antdTable,dataSource:Y==null?void 0:Y.can_copy_list,rowKey:ie==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})),(Y==null?void 0:Y.no_copy_num)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:t.a.contentTitle},"\u4E0D\u53EF\u590D\u5236\u5B9E\u8BAD"),s.a.createElement("div",{className:t.a.content},Pe.irreproducible),s.a.createElement(Q.a,{columns:he,className:t.a.antdTable,dataSource:Y==null?void 0:Y.no_copy_list,rowKey:ie==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})),(Y==null?void 0:Y.no_use_list.length)>0&&(Y==null?void 0:Y.no_use_list.map(function(xe){return s.a.createElement("div",{key:ie==="subject"?xe.stage_shixun_id:xe.id},s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?xe==null?void 0:xe.stage_shixun_id:xe.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?xe==null?void 0:xe.stage_shixun_id:xe.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.a,{type:"hidden"})))}))))},P=function(b){var h=b.modalType;return h==="multiple"?s.a.createElement(A,b):s.a.createElement(T,b)};Ae.a=P},BU3w:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return N});var te=U("MNnm"),Q="rc-util-key";function B($){if($.attachTo)return $.attachTo;var z=document.querySelector("head");return z||document.body}function J($){var z,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var D=document.createElement("style");if((z=r.csp)===null||z===void 0?void 0:z.nonce){var p;D.nonce=(p=r.csp)===null||p===void 0?void 0:p.nonce}D.innerHTML=$;var g=B(r),m=g.firstChild;return r.prepend&&g.prepend?g.prepend(D):r.prepend&&m?g.insertBefore(D,m):g.appendChild(D),D}var K=new Map;function N($,z){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=B(r);if(!K.has(D)){var p=J("",r),g=p.parentNode;K.set(D,g),g.removeChild(p)}var m=Array.from(K.get(D).children).find(function(t){return t.tagName==="STYLE"&&t[Q]===z});if(m){var a,d;if(((a=r.csp)===null||a===void 0?void 0:a.nonce)&&m.nonce!==((d=r.csp)===null||d===void 0?void 0:d.nonce)){var s;m.nonce=(s=r.csp)===null||s===void 0?void 0:s.nonce}return m.innerHTML!==$&&(m.innerHTML=$),m}var i=J($,r);return i[Q]=z,i}},Bd2K:function(kt,Ae,U){(function(te){te(U("VrN/"),U("osHv"))})(function(te){te.defineOption("autoCloseTags",!1,function(r,D,p){if(p!=te.Init&&p&&r.removeKeyMap("autoCloseTags"),!D)return;var g={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(g["'/'"]=function(m){return N(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(g["'>'"]=function(m){return J(m)}),r.addKeyMap(g)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],B=["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 J(r){if(r.getOption("disableInput"))return te.Pass;for(var D=r.listSelections(),p=[],g=r.getOption("autoCloseTags"),m=0;ma.ch&&(u=u.slice(0,u.length-d.end+a.ch));var S=u.toLowerCase();if(!u||d.type=="string"&&(d.end!=a.ch||!/[\"\']/.test(d.string.charAt(d.string.length-1))||d.string.length==1)||d.type=="tag"&&t.close||d.string.indexOf("/")==a.ch-d.start-1||R&&$(R,S)>-1||z(r,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i)||[],u,a,!0))return te.Pass;var A=typeof g=="object"&&g.emptyTags;if(A&&$(A,u)>-1){p[m]={text:"/>",newPos:te.Pos(a.line,a.ch+2)};continue}var P=T&&$(T,S)>-1;p[m]={indent:P,text:">"+(P?`
`:"")+""+u+">",newPos:P?te.Pos(a.line+1,0):te.Pos(a.line,a.ch+1)}}for(var E=typeof g=="object"&&g.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var b=p[m];r.replaceRange(b.text,D[m].head,D[m].anchor,"+insert");var h=r.listSelections().slice(0);h[m]={head:b.newPos,anchor:b.newPos},r.setSelections(h),!E&&b.indent&&(r.indentLine(b.newPos.line,null,!0),r.indentLine(b.newPos.line+1,null,!0))}}function K(r,D){for(var p=r.listSelections(),g=[],m=D?"/":"",a=r.getOption("autoCloseTags"),d=typeof a=="object"&&a.dontIndentOnSlash,s=0;s"&&(R+=">"),g[s]=R}if(r.replaceSelections(g),p=r.listSelections(),!d)for(var s=0;s=0&&D[i]==p;i--)++s;g=d.to;for(var i=1;i0){for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:"",D=[],p=0;pN,te.serviceIds.set(N,$),$}function K(N){return function($,z,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");B(N,$,r,!0)}}},DlQD:function(kt,Ae,U){(function(te,Q){kt.exports=Q()})(this,function(){"use strict";function te(He,Ne){for(var Ue=0;UeHe.length)&&(Ne=He.length);for(var Ue=0,ge=new Array(Ne);Ue=He.length?{done:!0}:{done:!1,value:He[ge++]}}}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 Ue=He[Symbol.iterator](),Ue.next.bind(Ue)}function N(He,Ne){return Ne={exports:{}},He(Ne,Ne.exports),Ne.exports}var $=N(function(He){function Ne(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function Ue(ge){He.exports.defaults=ge}He.exports={defaults:Ne(),getDefaults:Ne,changeDefaults:Ue}}),z=$.defaults,r=$.getDefaults,D=$.changeDefaults,p=/[&<>"']/,g=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,d={"&":"&","<":"<",">":">",'"':""","'":"'"},s=function(Ne){return d[Ne]};function i(He,Ne){if(Ne){if(p.test(He))return He.replace(g,s)}else if(m.test(He))return He.replace(a,s);return He}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(He){return He.replace(t,function(Ne,Ue){return Ue=Ue.toLowerCase(),Ue==="colon"?":":Ue.charAt(0)==="#"?Ue.charAt(1)==="x"?String.fromCharCode(parseInt(Ue.substring(2),16)):String.fromCharCode(+Ue.substring(1)):""})}var o=/(^|[^\[])\^/g;function R(He,Ne){He=He.source||He,Ne=Ne||"";var Ue={replace:function(Ee,De){return De=De.source||De,De=De.replace(o,"$1"),He=He.replace(Ee,De),Ue},getRegex:function(){return new RegExp(He,Ne)}};return Ue}var T=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(He,Ne,Ue){if(He){var ge;try{ge=decodeURIComponent(u(Ue)).replace(T,"").toLowerCase()}catch(Ee){return null}if(ge.indexOf("javascript:")===0||ge.indexOf("vbscript:")===0||ge.indexOf("data:")===0)return null}Ne&&!S.test(Ue)&&(Ue=f(Ne,Ue));try{Ue=encodeURI(Ue).replace(/%25/g,"%")}catch(Ee){return null}return Ue}var P={},E=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(He,Ne){P[" "+He]||(E.test(He)?P[" "+He]=He+"/":P[" "+He]=j(He,"/",!0)),He=P[" "+He];var Ue=He.indexOf(":")===-1;return Ne.substring(0,2)==="//"?Ue?Ne:He.replace(b,"$1")+Ne:Ne.charAt(0)==="/"?Ue?Ne:He.replace(h,"$1")+Ne:He+Ne}var C={exec:function(){}};function x(He){for(var Ne=1,Ue,ge;Ne=0&&Fe[xt]==="\\";)at=!at;return at?"|":" |"}),ge=Ue.split(/ \|/),Ee=0;if(ge.length>Ne)ge.splice(Ne);else for(;ge.length=ge.length?Ee.slice(ge.length):Ee}).join(`
`)}var we=function(){function He(Ue){this.options=Ue||I}var Ne=He.prototype;return Ne.space=function(ge){var Ee=this.rules.block.newline.exec(ge);if(Ee)return Ee[0].length>1?{type:"space",raw:Ee[0]}:{raw:`
`}},Ne.code=function(ge,Ee){var De=this.rules.block.code.exec(ge);if(De){var ue=Ee[Ee.length-1];if(ue&&ue.type==="paragraph")return{raw:De[0],text:De[0].trimRight()};var Fe=De[0].replace(/^ {4}/gm,"");return{type:"code",raw:De[0],codeBlockStyle:"indented",text:this.options.pedantic?Fe:v(Fe,`
`)}}},Ne.fences=function(ge){var Ee=this.rules.block.fences.exec(ge);if(Ee){var De=Ee[0],ue=he(De,Ee[3]||"");return{type:"code",raw:De,lang:Ee[2]?Ee[2].trim():Ee[2],text:ue}}},Ne.heading=function(ge){var Ee=this.rules.block.heading.exec(ge);if(Ee)return{type:"heading",raw:Ee[0],depth:Ee[1].length,text:Ee[2]}},Ne.nptable=function(ge){var Ee=this.rules.block.nptable.exec(ge);if(Ee){var De={type:"table",header:H(Ee[1].replace(/^ *| *\| *$/g,"")),align:Ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ee[3]?Ee[3].replace(/\n$/,"").split(`
`):[],raw:Ee[0]};if(De.header.length===De.align.length){var ue=De.align.length,Fe;for(Fe=0;Fe ?/gm,"");return{type:"blockquote",raw:Ee[0],text:De}}},Ne.list=function(ge){var Ee=this.rules.block.list.exec(ge);if(Ee){for(var De=Ee[0],ue=Ee[2],Fe=ue.length>1,at=ue[ue.length-1]===")",xt={type:"list",raw:De,ordered:Fe,start:Fe?+ue.slice(0,-1):"",loose:!1,items:[]},Gt=Ee[0].match(this.rules.block.item),$t=!1,Yt,$n,vn,ln,hn,Gn,fr,vr=Gt.length,ir=0;ir1||this.options.smartLists&&vn!==ue)&&(ln=Gt.slice(ir+1).join(`
`),xt.raw=xt.raw.substring(0,xt.raw.length-ln.length),ir=vr-1)),hn=$t||/\n\n(?!\s*$)/.test(Yt),ir!==vr-1&&($t=Yt.charAt(Yt.length-1)===`
`,hn||(hn=$t)),hn&&(xt.loose=!0),Gn=/^\[[ xX]\] /.test(Yt),fr=void 0,Gn&&(fr=Yt[1]!==" ",Yt=Yt.replace(/^\[[ xX]\] +/,"")),xt.items.push({type:"list_item",raw:De,task:Gn,checked:fr,loose:hn,text:Yt});return xt}},Ne.html=function(ge){var Ee=this.rules.block.html.exec(ge);if(Ee)return{type:this.options.sanitize?"paragraph":"html",raw:Ee[0],pre:!this.options.sanitizer&&(Ee[1]==="pre"||Ee[1]==="script"||Ee[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):Y(Ee[0]):Ee[0]}},Ne.def=function(ge){var Ee=this.rules.block.def.exec(ge);if(Ee){Ee[3]&&(Ee[3]=Ee[3].substring(1,Ee[3].length-1));var De=Ee[1].toLowerCase().replace(/\s+/g," ");return{tag:De,raw:Ee[0],href:Ee[2],title:Ee[3]}}},Ne.table=function(ge){var Ee=this.rules.block.table.exec(ge);if(Ee){var De={type:"table",header:H(Ee[1].replace(/^ *| *\| *$/g,"")),align:Ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ee[3]?Ee[3].replace(/\n$/,"").split(`
`):[]};if(De.header.length===De.align.length){De.raw=Ee[0];var ue=De.align.length,Fe;for(Fe=0;Fe/i.test(ue[0])&&(Ee=!1),!De&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?De=!0:De&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(De=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:Ee,inRawBlock:De,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Y(ue[0]):ue[0]}},Ne.link=function(ge){var Ee=this.rules.inline.link.exec(ge);if(Ee){var De=ie(Ee[2],"()");if(De>-1){var ue=Ee[0].indexOf("!")===0?5:4,Fe=ue+Ee[1].length+De;Ee[2]=Ee[2].substring(0,De),Ee[0]=Ee[0].substring(0,Fe).trim(),Ee[3]=""}var at=Ee[2],xt="";if(this.options.pedantic){var Gt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(at);Gt?(at=Gt[1],xt=Gt[3]):xt=""}else xt=Ee[3]?Ee[3].slice(1,-1):"";at=at.trim().replace(/^<([\s\S]*)>$/,"$1");var $t=le(Ee,{href:at&&at.replace(this.rules.inline._escapes,"$1"),title:xt&&xt.replace(this.rules.inline._escapes,"$1")},Ee[0]);return $t}},Ne.reflink=function(ge,Ee){var De;if((De=this.rules.inline.reflink.exec(ge))||(De=this.rules.inline.nolink.exec(ge))){var ue=(De[2]||De[1]).replace(/\s+/g," ");if(ue=Ee[ue.toLowerCase()],!ue||!ue.href){var Fe=De[0].charAt(0);return{type:"text",raw:Fe,text:Fe}}var at=le(De,ue,De[0]);return at}},Ne.strong=function(ge,Ee,De){De===void 0&&(De="");var ue=this.rules.inline.strong.start.exec(ge);if(ue&&(!ue[1]||ue[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){Ee=Ee.slice(-1*ge.length);var Fe=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Fe.lastIndex=0;for(var at;(ue=Fe.exec(Ee))!=null;)if(at=this.rules.inline.strong.middle.exec(Ee.slice(0,ue.index+3)),at)return{type:"strong",raw:ge.slice(0,at[0].length),text:ge.slice(2,at[0].length-2)}}},Ne.em=function(ge,Ee,De){De===void 0&&(De="");var ue=this.rules.inline.em.start.exec(ge);if(ue&&(!ue[1]||ue[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){Ee=Ee.slice(-1*ge.length);var Fe=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Fe.lastIndex=0;for(var at;(ue=Fe.exec(Ee))!=null;)if(at=this.rules.inline.em.middle.exec(Ee.slice(0,ue.index+2)),at)return{type:"em",raw:ge.slice(0,at[0].length),text:ge.slice(1,at[0].length-1)}}},Ne.codespan=function(ge){var Ee=this.rules.inline.code.exec(ge);if(Ee){var De=Ee[2].replace(/\n/g," "),ue=/[^ ]/.test(De),Fe=De.startsWith(" ")&&De.endsWith(" ");return ue&&Fe&&(De=De.substring(1,De.length-1)),De=Y(De,!0),{type:"codespan",raw:Ee[0],text:De}}},Ne.br=function(ge){var Ee=this.rules.inline.br.exec(ge);if(Ee)return{type:"br",raw:Ee[0]}},Ne.del=function(ge){var Ee=this.rules.inline.del.exec(ge);if(Ee)return{type:"del",raw:Ee[0],text:Ee[1]}},Ne.autolink=function(ge,Ee){var De=this.rules.inline.autolink.exec(ge);if(De){var ue,Fe;return De[2]==="@"?(ue=Y(this.options.mangle?Ee(De[1]):De[1]),Fe="mailto:"+ue):(ue=Y(De[1]),Fe=ue),{type:"link",raw:De[0],text:ue,href:Fe,tokens:[{type:"text",raw:ue,text:ue}]}}},Ne.url=function(ge,Ee){var De;if(De=this.rules.inline.url.exec(ge)){var ue,Fe;if(De[2]==="@")ue=Y(this.options.mangle?Ee(De[0]):De[0]),Fe="mailto:"+ue;else{var at;do at=De[0],De[0]=this.rules.inline._backpedal.exec(De[0])[0];while(at!==De[0]);ue=Y(De[0]),De[1]==="www."?Fe="http://"+ue:Fe=ue}return{type:"link",raw:De[0],text:ue,href:Fe,tokens:[{type:"text",raw:ue,text:ue}]}}},Ne.inlineText=function(ge,Ee,De){var ue=this.rules.inline.text.exec(ge);if(ue){var Fe;return Ee?Fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Y(ue[0]):ue[0]:Fe=Y(this.options.smartypants?De(ue[0]):ue[0]),{type:"text",raw:ue[0],text:Fe}}},He}(),Pe=F.noopTest,xe=F.edit,Oe=F.merge,pe={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:Pe,table:Pe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=xe(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=xe(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=xe(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=//,pe.html=xe(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=xe(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=xe(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Oe({},pe),pe.gfm=Oe({},pe.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*|$)"}),pe.gfm.nptable=xe(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=xe(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=Oe({},pe.normal,{html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._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:Pe,paragraph:xe(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Pe,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:Pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",be.punctuation=xe(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex(),be._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",be._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",be.em.start=xe(be.em.start).replace(/punctuation/g,be._punctuation).getRegex(),be.em.middle=xe(be.em.middle).replace(/punctuation/g,be._punctuation).replace(/overlapSkip/g,be._overlapSkip).getRegex(),be.em.endAst=xe(be.em.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.em.endUnd=xe(be.em.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.start=xe(be.strong.start).replace(/punctuation/g,be._punctuation).getRegex(),be.strong.middle=xe(be.strong.middle).replace(/punctuation/g,be._punctuation).replace(/blockSkip/g,be._blockSkip).getRegex(),be.strong.endAst=xe(be.strong.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.endUnd=xe(be.strong.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.blockSkip=xe(be._blockSkip,"g").getRegex(),be.overlapSkip=xe(be._overlapSkip,"g").getRegex(),be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,be._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])?)+(?![-_])/,be.autolink=xe(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex(),be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,be.tag=xe(be.tag).replace("comment",pe._comment).replace("attribute",be._attribute).getRegex(),be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,be._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,be.link=xe(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex(),be.reflink=xe(be.reflink).replace("label",be._label).getRegex(),be.reflinkSearch=xe(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex(),be.normal=Oe({},be),be.pedantic=Oe({},be.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:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()}),be.gfm=Oe({},be.normal,{escape:xe(be.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&&(ge="x"+ge.toString(16)),Ne+=""+ge+";";return Ne}var st=function(){function He(Ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ue||fe,this.options.tokenizer=this.options.tokenizer||new we,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:_e.normal,inline:ke.normal};this.options.pedantic?(ge.block=_e.pedantic,ge.inline=ke.pedantic):this.options.gfm&&(ge.block=_e.gfm,this.options.breaks?ge.inline=ke.breaks:ge.inline=ke.gfm),this.tokenizer.rules=ge}He.lex=function(ge,Ee){var De=new He(Ee);return De.lex(ge)};var Ne=He.prototype;return Ne.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},Ne.blockTokens=function(ge,Ee,De){Ee===void 0&&(Ee=[]),De===void 0&&(De=!0),ge=ge.replace(/^ +$/gm,"");for(var ue,Fe,at,xt;ge;){if(ue=this.tokenizer.space(ge)){ge=ge.substring(ue.raw.length),ue.type&&Ee.push(ue);continue}if(ue=this.tokenizer.code(ge,Ee)){ge=ge.substring(ue.raw.length),ue.type?Ee.push(ue):(xt=Ee[Ee.length-1],xt.raw+=`
`+ue.raw,xt.text+=`
`+ue.text);continue}if(ue=this.tokenizer.fences(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.heading(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.nptable(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.hr(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.blockquote(ge)){ge=ge.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],De),Ee.push(ue);continue}if(ue=this.tokenizer.list(ge)){for(ge=ge.substring(ue.raw.length),at=ue.items.length,Fe=0;Fe0)for(;(Gt=this.tokenizer.rules.inline.reflinkSearch.exec(xt))!=null;)$t.includes(Gt[0].slice(Gt[0].lastIndexOf("[")+1,-1))&&(xt=xt.slice(0,Gt.index)+"["+"a".repeat(Gt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Gt=this.tokenizer.rules.inline.blockSkip.exec(xt))!=null;)xt=xt.slice(0,Gt.index)+"["+"a".repeat(Gt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ge;){if(at=this.tokenizer.escape(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.tag(ge,De,ue)){ge=ge.substring(at.raw.length),De=at.inLink,ue=at.inRawBlock,Ee.push(at);continue}if(at=this.tokenizer.link(ge)){ge=ge.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,ue)),Ee.push(at);continue}if(at=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,ue)),Ee.push(at);continue}if(at=this.tokenizer.strong(ge,xt,Fe)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.em(ge,xt,Fe)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.codespan(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.br(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.del(ge)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.autolink(ge,je)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(!De&&(at=this.tokenizer.url(ge,je))){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.inlineText(ge,ue,qe)){ge=ge.substring(at.raw.length),Fe=at.raw.slice(-1),Ee.push(at);continue}if(ge){var Yt="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(Yt);break}else throw new Error(Yt)}}return Ee},Q(He,null,[{key:"rules",get:function(){return{block:_e,inline:ke}}}]),He}(),vt=$.defaults,Re=F.cleanUrl,Be=F.escape,Ye=function(){function He(Ue){this.options=Ue||vt}var Ne=He.prototype;return Ne.code=function(ge,Ee,De){var ue=(Ee||"").match(/\S*/)[0];if(this.options.highlight){var Fe=this.options.highlight(ge,ue);Fe!=null&&Fe!==ge&&(De=!0,ge=Fe)}return ue?''+(De?ge:Be(ge,!0))+`
`:""+(De?ge:Be(ge,!0))+`
`},Ne.blockquote=function(ge){return`
`+ge+`
`},Ne.html=function(ge){return ge},Ne.heading=function(ge,Ee,De,ue){return this.options.headerIds?"
`:""+ge+"
`},Ne.hr=function(){return this.options.xhtml?`
`:`
`},Ne.list=function(ge,Ee,De){var ue=Ee?"ol":"ul",Fe=Ee&&De!==1?' start="'+De+'"':"";return"<"+ue+Fe+`>
`+ge+""+ue+`>
`},Ne.listitem=function(ge){return""+ge+`
`},Ne.checkbox=function(ge){return" "},Ne.paragraph=function(ge){return""+ge+`
`},Ne.table=function(ge,Ee){return Ee&&(Ee=""+Ee+""),`
`},Ne.tablerow=function(ge){return`
`+ge+`
`},Ne.tablecell=function(ge,Ee){var De=Ee.header?"th":"td",ue=Ee.align?"<"+De+' align="'+Ee.align+'">':"<"+De+">";return ue+ge+""+De+`>
`},Ne.strong=function(ge){return""+ge+""},Ne.em=function(ge){return""+ge+""},Ne.codespan=function(ge){return""+ge+""},Ne.br=function(){return this.options.xhtml?"
":"
"},Ne.del=function(ge){return""+ge+""},Ne.link=function(ge,Ee,De){if(ge=Re(this.options.sanitize,this.options.baseUrl,ge),ge===null)return De;var ue='"+De+"",ue},Ne.image=function(ge,Ee,De){if(ge=Re(this.options.sanitize,this.options.baseUrl,ge),ge===null)return De;var ue='
":">",ue},Ne.text=function(ge){return ge},He}(),Ke=function(){function He(){}var Ne=He.prototype;return Ne.strong=function(ge){return ge},Ne.em=function(ge){return ge},Ne.codespan=function(ge){return ge},Ne.del=function(ge){return ge},Ne.html=function(ge){return ge},Ne.text=function(ge){return ge},Ne.link=function(ge,Ee,De){return""+De},Ne.image=function(ge,Ee,De){return""+De},Ne.br=function(){return""},He}(),yt=function(){function He(){this.seen={}}var Ne=He.prototype;return Ne.slug=function(ge){var Ee=ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ee)){var De=Ee;do this.seen[De]++,Ee=De+"-"+this.seen[De];while(this.seen.hasOwnProperty(Ee))}return this.seen[Ee]=0,Ee},He}(),Pt=$.defaults,Ht=F.unescape,Xt=function(){function He(Ue){this.options=Ue||Pt,this.options.renderer=this.options.renderer||new Ye,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ke,this.slugger=new yt}He.parse=function(ge,Ee){var De=new He(Ee);return De.parse(ge)};var Ne=He.prototype;return Ne.parse=function(ge,Ee){Ee===void 0&&(Ee=!0);var De="",ue,Fe,at,xt,Gt,$t,Yt,$n,vn,ln,hn,Gn,fr,vr,ir,br,Rr,Jt,Ar=ge.length;for(ue=0;ue0&&ir.tokens[0].type==="text"?(ir.tokens[0].text=Jt+" "+ir.tokens[0].text,ir.tokens[0].tokens&&ir.tokens[0].tokens.length>0&&ir.tokens[0].tokens[0].type==="text"&&(ir.tokens[0].tokens[0].text=Jt+" "+ir.tokens[0].tokens[0].text)):ir.tokens.unshift({type:"text",text:Jt}):vr+=Jt),vr+=this.parse(ir.tokens,fr),vn+=this.renderer.listitem(vr,Rr,br);De+=this.renderer.list(vn,hn,Gn);continue}case"html":{De+=this.renderer.html(ln.text);continue}case"paragraph":{De+=this.renderer.paragraph(this.parseInline(ln.tokens));continue}case"text":{for(vn=ln.tokens?this.parseInline(ln.tokens):ln.text;ue+1An error occurred:
"+et(at.message+"",!0)+"
";throw at}}dt.options=dt.setOptions=function(He){return an(dt.defaults,He),Ct(dt.defaults),dt},dt.getDefaults=Ze,dt.defaults=At,dt.use=function(He){var Ne=an({},He);if(He.renderer&&function(){var ge=dt.defaults.renderer||new Ye,Ee=function(Fe){var at=ge[Fe];ge[Fe]=function(){for(var xt=arguments.length,Gt=new Array(xt),$t=0;$t`,triples:"",explode:"[]{}"},B=te.Pos;te.defineOption("autoCloseBrackets",!1,function(d,s,i){i&&i!=te.Init&&(d.removeKeyMap(K),d.state.closeBrackets=null),s&&(N(J(s,"pairs")),d.state.closeBrackets=s,d.addKeyMap(K))});function J(d,s){return s=="pairs"&&typeof d=="string"?d:typeof d=="object"&&d[s]!=null?d[s]:Q[s]}var K={Backspace:r,Enter:D};function N(d){for(var s=0;s=0;u--){var R=t[u].head;d.replaceRange("",B(R.line,R.ch-1),B(R.line,R.ch+1),"+delete")}}function D(d){var s=z(d),i=s&&J(s,"explode");if(!i||d.getOption("disableInput"))return te.Pass;for(var t=d.listSelections(),u=0;u0;return{anchor:new B(d.anchor.line,d.anchor.ch+(s?-1:1)),head:new B(d.head.line,d.head.ch+(s?1:-1))}}function g(d,s){var i=z(d);if(!i||d.getOption("disableInput"))return te.Pass;var t=J(i,"pairs"),u=t.indexOf(s);if(u==-1)return te.Pass;for(var o=J(i,"closeBefore"),R=J(i,"triples"),T=t.charAt(u+1)==s,S=d.listSelections(),A=u%2==0,P,E=0;E=0&&d.getRange(h,B(h.line,h.ch+3))==s+s+s?f="skipThree":f="skip";else if(T&&h.ch>1&&R.indexOf(s)>=0&&d.getRange(B(h.line,h.ch-2),h)==s+s){if(h.ch>2&&/\bstring/.test(d.getTokenTypeAt(B(h.line,h.ch-2))))return te.Pass;f="addFour"}else if(T){var x=h.ch==0?" ":d.getRange(B(h.line,h.ch-1),h);if(!te.isWordChar(C)&&x!=s&&!te.isWordChar(x))f="both";else return te.Pass}else if(A&&(C.length===0||/\s/.test(C)||o.indexOf(C)>-1))f="both";else return te.Pass;if(!P)P=f;else if(P!=f)return te.Pass}var _=u%2?t.charAt(u-1):s,j=u%2?s:t.charAt(u+1);d.operation(function(){if(P=="skip")d.execCommand("goCharRight");else if(P=="skipThree")for(var W=0;W<3;W++)d.execCommand("goCharRight");else if(P=="surround"){for(var w=d.getSelections(),W=0;W0&&(ie.percent=ie.loaded/ie.total*100),F.onProgress(ie)});var v=new FormData;F.data&&Object.keys(F.data).forEach(function(Y){var ie=F.data[Y];if(Array.isArray(ie)){ie.forEach(function(le){v.append(Y+"[]",le)});return}v.append(Y,F.data[Y])}),F.file instanceof Blob?v.append(F.filename,F.file,F.file.name):v.append(F.filename,F.file),I.onerror=function(ie){F.onError(ie)},I.onload=function(){return I.status<200||I.status>=300?F.onError(K(F,I),N(I)):F.onSuccess(N(I),I)},I.open(F.method,F.action,!0),F.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var H=F.headers||{};return H["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function(Y){H[Y]!==null&&I.setRequestHeader(Y,H[Y])}),I.send(v),{abort:function(){I.abort()}}}var z=+new Date,r=0;function D(){return"rc-upload-"+z+"-"+ ++r}function p(F,I){return F.indexOf(I,F.length-I.length)!==-1}var g=function(F,I){if(F&&I){var v=Array.isArray(I)?I:I.split(","),H=F.name||"",Y=F.type||"",ie=Y.replace(/\/.*$/,"");return v.some(function(le){var he=le.trim();return he.charAt(0)==="."?p(H.toLowerCase(),he.toLowerCase()):/\/\*$/.test(he)?ie===he.replace(/\/.*$/,""):Y===he})}return!0};function m(F,I){var v=F.createReader(),H=[];function Y(){v.readEntries(function(ie){var le=Array.prototype.slice.apply(ie);H=H.concat(le);var he=!le.length;he?I(H):Y()})}Y()}var a=function(I,v,H){var Y=function ie(le,he){he=he||"",le.isFile?le.file(function(we){H(we)&&(le.fullPath&&!we.webkitRelativePath&&(Object.defineProperties(we,{webkitRelativePath:{writable:!0}}),we.webkitRelativePath=le.fullPath.replace(/^\//,""),Object.defineProperties(we,{webkitRelativePath:{writable:!1}})),v([we]))}):le.isDirectory&&m(le,function(we){we.forEach(function(Pe){ie(Pe,""+he+le.name+"/")})})};I.forEach(function(ie){Y(ie.webkitGetAsEntry())})},d=a,s=Object.assign||function(F){for(var I=1;I=0)continue;if(!Object.prototype.hasOwnProperty.call(F,H))continue;v[H]=F[H]}return v}function R(F,I){if(!(F instanceof I))throw new TypeError("Cannot call a class as a function")}function T(F,I){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:F}function S(F,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);F.prototype=Object.create(I&&I.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(F,I):F.__proto__=I)}var A=function(I){return Object.keys(I).reduce(function(v,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(v[H]=I[H]),v},{})},P=function(F){S(I,F);function I(){var v,H,Y,ie;R(this,I);for(var le=arguments.length,he=Array(le),we=0;weo.length&&(T=o.length);RS===A){const S=o[Symbol.iterator](),A=R[Symbol.iterator]();for(;;){const P=S.next(),E=A.next();if(P.done!==E.done)return!1;if(P.done)return!0;if(!T(P.value,E.value))return!1}}Q.equals=u})(te||(te={}))},LYsE:function(kt,Ae,U){"use strict";var te=U("9og8"),Q=U("giR+"),B=U("fyUT"),J=U("2qtc"),K=U("kLXV"),N=U("/zsF"),$=U("PArb"),z=U("14J3"),r=U("BMrR"),D=U("+L6B"),p=U("2/Rp"),g=U("k1fw"),m=U("0Owb"),a=U("tJVT"),d=U("WmNS"),s=U.n(d),i=U("q1tI"),t=U.n(i),u=U("5Dmo"),o=U("3S7+"),R=U("5NDa"),T=U("5rEg"),S=U("jCWc"),A=U("kPKH"),P=U("BoS7"),E=U("Sdc0"),b=U("7Kak"),h=U("9yH6"),f=U("sRBo"),C=U("kaz8"),x=U("miYZ"),_=U("tsqr"),j=U("oBTY"),W=U("PpiC"),w=U("Ty5D"),F=U("9kvl"),I=U("V0Rq"),v=U("Ot1p"),H=U("kqOp"),Y=U("7qnI"),ie=U("1vsH"),le=U("YJx+"),he=U.n(le),we=U("9Bee"),Pe=U("u2Z1"),xe=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Oe="\u2581",pe=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.globalSetting,ve=Ge.exercise,or=Ge.loading,en=Ge.dispatch,Ie=Ge.editData,gt=Ge.editKey,Ce=Ge.setEditKey,cn=Ce===void 0?function(){}:Ce,hr=Ge.cancelAdd,mr=hr===void 0?function(){}:hr,q=Ge.addCallback,O=q===void 0?function(){}:q,M=Ge.reload,X=M===void 0?function(){}:M,se=Ge.setIsClaer,Z=se===void 0?function(){}:se,Le=Object(W.a)(Ge,["problemset","globalSetting","exercise","loading","dispatch","editData","editKey","setEditKey","cancelAdd","addCallback","reload","setIsClaer"]),ot=Object(i.useState)(""),wt=Object(a.a)(ot,2),Lt=wt[0],ct=wt[1],Et=Object(i.useState)(""),Mt=Object(a.a)(Et,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)([]),fn=Object(a.a)(Hn,2),Wt=fn[0],sn=fn[1],qt=Object(i.useState)(""),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(!1),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)(),Kn=Object(a.a)(Ln,2),rn=Kn[0],_n=Kn[1],In=Object(i.useState)(0),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)(!1),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useState)(!1),Dn=Object(a.a)(Mn,2),dn=Dn[0],Ut=Dn[1],zt=Object(i.useState)([]),Vt=Object(a.a)(zt,2),jt=Vt[0],nn=Vt[1],bn=Object(i.useState)(1),gn=Object(a.a)(bn,2),bt=gn[0],lt=gn[1],Je=Object(i.useState)(!1),nt=Object(a.a)(Je,2),ze=nt[0],pt=nt[1],rt=Object(i.useRef)(!1),Tt=Object(w.i)(),Nt=Object(i.useState)([]),St=Object(a.a)(Nt,2),Kt=St[0],Rt=St[1],It=function(lr){Rt([].concat(Object(j.a)(Kt),[Object(g.a)({},lr)]))};Object(i.useEffect)(function(){if(rt.current)return;if(!(Ie!=null&&Ie.question_title)){Pn(!0),ct(""),Sn(!1),_n(2),sn([]),Bn(""),nr(!1);return}ct(Ie==null?void 0:Ie.question_title),Sn(Ie==null?void 0:Ie.is_ordered),lt(Ie==null?void 0:Ie.difficulty),pt(!(Ie!=null&&Ie.repeat_answer)),_n(Ie==null?void 0:Ie.question_score);var xr=Ie==null?void 0:Ie.standard_answer.map(function(lr){return lr.answer_text});sn(Object(j.a)(xr)),nn(Ie.tag_discipline_ids),Yn(Ie==null?void 0:Ie.analysis)},[Ie,kn]),Object(i.useEffect)(function(){nr(!1),kn&&xr();function xr(){return lr.apply(this,arguments)}function lr(){return lr=Object(te.a)(s.a.mark(function wr(){var Er,Cr,Ur;return s.a.wrap(function(Fr){for(;;)switch(Fr.prev=Fr.next){case 0:return Fr.next=2,Object(I.I)({sub_discipline_id:(Er=ve.editData)===null||Er===void 0||((Cr=Er.exercise)===null||Cr===void 0)?void 0:Cr.sub_discipline_id});case 2:Ur=Fr.sent,Rt(Ur.tag_disciplines);case 4:case"end":return Fr.stop()}},wr)})),lr.apply(this,arguments)}},[kn]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:on,isEdit:kn}}),Object(i.useEffect)(function(){var xr,lr=ve!=null&&(xr=ve.tagDisciplineData)!==null&&xr!==void 0&&xr.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Rt(lr)},[ve.tagDisciplineData]);var En=function(lr){(lr==null?void 0:lr.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),cn(-1),rt.current=!1,X())},on=function(){var xr=Object(te.a)(s.a.mark(function lr(){var wr,Er,Cr,Ur,Vr,Fr,kr;return s.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:if(wr=[],Er=!1,Ut(!0),Wt.forEach(function(Si,Zr){wr.push({choice_id:Zr+1,answer_text:[]}),Si.forEach(function(ei,yi){wr[Zr].answer_text.push(ei),(!ei||!Object(ie.db)(ei,1e4))&&(Bn("".concat(Zr,"-").concat(yi)),_.b.info(ei?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Er=!0)})}),!Er){Kr.next=7;break}return Ut(!1),Kr.abrupt("return",!1);case 7:if(rt.current=!0,!Ie.question_id){Kr.next=19;break}if(!((Ie==null?void 0:Ie.is_my)===1)){Kr.next=13;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Si=Object(te.a)(s.a.mark(function ei(){var yi,Ri;return s.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return fi.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Lt,question_type:3,question_score:rn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:bt,is_cover:1,repeat_answer:!ze,analysis:Cn}});case 2:Cr=fi.sent,En(Cr);case 4:case"end":return fi.stop()}},ei)}));function Zr(){return Si.apply(this,arguments)}return Zr}(),onCancel:function(){var Si=Object(te.a)(s.a.mark(function ei(){var yi,Ri;return s.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return fi.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Lt,question_type:3,question_score:rn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:bt,repeat_answer:!ze,analysis:Cn}});case 2:Cr=fi.sent,En(Cr);case 4:case"end":return fi.stop()}},ei)}));function Zr(){return Si.apply(this,arguments)}return Zr}()}),Kr.next=17;break;case 13:return Kr.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Lt,question_type:3,question_score:rn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(Ur=ve.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,difficulty:bt,repeat_answer:!ze,analysis:Cn}});case 15:Cr=Kr.sent,En(Cr);case 17:Kr.next=23;break;case 19:return Kr.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ie==null?void 0:Ie.insert_id,categoryId:Tt.categoryId,question_title:Lt,question_type:3,question_score:rn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(Fr=ve.editData)===null||Fr===void 0||((kr=Fr.exercise)===null||kr===void 0)?void 0:kr.sub_discipline_id,difficulty:bt,repeat_answer:!ze,analysis:Cn}});case 21:Cr=Kr.sent,En(Cr);case 23:return Ut(!1),Kr.abrupt("return",{name:Lt,analysis:Cn,standard_answers:wr,is_ordered:pn});case 25:case"end":return Kr.stop()}},lr)}));return function(){return xr.apply(this,arguments)}}(),gr=function(lr,wr,Er){var Cr=Wt.slice();if(wr&&Cr.splice(lr,wr),Er&&Xn||!Ie.question_id)for(var Ur=0;Ur1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:pn,onChange:function(kr){return Sn(kr.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Cn,onChange:function(kr){return Yn(kr)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:rn,max:1e4,min:0,onChange:function(kr){_n(kr)}})," ","\u5206 \xA0"," ",!!rn&&!!Zn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(rn/Zn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:bt,onChange:function(kr){lt(kr.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:jt,selectvalues:Ie==null?void 0:Ie.tag_discipline_ids,onChange:nn,subId:(Ur=ve.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,knowledgeOptions:Kt,onAddKnowledgeFinish:It})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:ze,onChange:function(kr){pt(kr)}}))),t.a.createElement("aside",{className:"tr"},(gt!==-1||Ie.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){mr(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){on()}},"\u4FDD\u5B58")))},On=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(xr){var lr,wr;return(ve==null||((lr=ve.editData)===null||lr===void 0||((wr=lr.exercise)===null||wr===void 0))?void 0:wr.exercise_status)===1?xr:xr.id!=="del"&&xr.id!=="add"}),Ir=function(){var xr=Object(te.a)(s.a.mark(function lr(wr){return s.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:if(!(gt!==-1)){Cr.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Cr.abrupt("return");case 3:Cr.t0=wr.id,Cr.next=Cr.t0==="del"?6:Cr.t0==="up"||Cr.t0==="down"?8:Cr.t0==="edit"?12:Cr.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Vr(){return s.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return kr.next=2,Object(I.n)({id:Ie.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Tt)});case 3:case"end":return kr.stop()}},Vr)}))()}}),Cr.abrupt("break",17);case 8:return Cr.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ie.question_id,opr:wr.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Tt)}),Cr.abrupt("break",17);case 12:return cn(Ie.dragKey),Pn(!0),Cr.abrupt("break",17);case 15:return O({key:Ie.key,insert_id:Ie==null?void 0:Ie.question_id,question_type:3}),Cr.abrupt("break",17);case 17:case"end":return Cr.stop()}},lr)}));return function(wr){return xr.apply(this,arguments)}}(),jr=function(){var lr;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ie!=null&&Ie.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09")),Ie!=null&&Ie.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ie.key,"."),t.a.createElement(we.a,{value:Ie.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ie.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ie.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ie==null||((lr=Ie.standard_answer)===null||lr===void 0)?void 0:lr.map(function(wr,Er){return t.a.createElement(r.a,{key:Er,align:"middle"},t.a.createElement(A.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",wr.choice_id,"\uFF09\uFF1A"),t.a.createElement(A.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},wr.answer_text.map(function(Cr,Ur){return t.a.createElement(A.a,{span:24,key:Ur},t.a.createElement(T.a,{key:Er,checked:Ie.standard_answer.includes(Er),disabled:!0,value:Cr}))}))))})),t.a.createElement("div",{className:he.a.action},!Ie.hideAction&&On.map(function(wr,Er){return wr.id==="up"&&Ie.key===1||wr.id==="down"&&Ie.key===Ie.len?null:t.a.createElement(o.a,{key:Er,placement:"bottom",title:wr.name},t.a.createElement("span",{onClick:function(){return Ir(wr)},className:wr.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!kn&&jr(),kn&&rr())},be=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ge,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(pe)),ne=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],fe=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.globalSetting,ve=Ge.exercise,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.editKey,hr=Ge.setEditKey,mr=hr===void 0?function(){}:hr,q=Ge.cancelAdd,O=q===void 0?function(){}:q,M=Ge.reload,X=M===void 0?function(){}:M,se=Ge.addCallback,Z=se===void 0?function(){}:se,Le=Ge.setIsClaer,ot=Le===void 0?function(){}:Le,wt=Object(W.a)(Ge,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","editKey","setEditKey","cancelAdd","reload","addCallback","setIsClaer"]),Lt=Object(i.useState)(),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)([]),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)(""),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],dn=Object(i.useRef)(!1),Ut=function(Je){Kn([].concat(Object(j.a)(Ln),[Object(g.a)({},Je)]))},zt=Object(w.i)();Object(i.useEffect)(function(){if(dn.current)return;if(!(Ce!=null&&Ce.question_choices)){Ft(!0),fn(""),Jn(2),Mt("");return}qn(!(Ce!=null&&Ce.repeat_answer)),fn(Ce==null?void 0:Ce.question_title),Jn(Ce==null?void 0:Ce.question_score),wn(Ce==null?void 0:Ce.difficulty),Mt(Ce.standard_answer[0]+""),Un(Ce.tag_discipline_ids),Dn(Ce==null?void 0:Ce.analysis)},[Ce,qt]),Object(i.useEffect)(function(){qt&<();function lt(){return Je.apply(this,arguments)}function Je(){return Je=Object(te.a)(s.a.mark(function nt(){var ze,pt,rt;return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(I.I)({sub_discipline_id:(ze=ve.editData)===null||ze===void 0||((pt=ze.exercise)===null||pt===void 0)?void 0:pt.sub_discipline_id});case 2:rt=Nt.sent,Kn(rt.tag_disciplines);case 4:case"end":return Nt.stop()}},nt)})),Je.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:jt,isEdit:qt}}),Object(i.useEffect)(function(){var lt,Je=ve!=null&&(lt=ve.tagDisciplineData)!==null&<!==void 0&<.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Kn(Je)},[ve.tagDisciplineData]);var Vt=function(Je){(Je==null?void 0:Je.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ft(!1),mr(-1),dn.current=!1,X())},jt=function(){var lt=Object(te.a)(s.a.mark(function Je(){var nt,ze,pt,rt,Tt,Nt;return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:if(Hn){Kt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Kt.abrupt("return",!1);case 3:if(Et){Kt.next=6;break}return _.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Kt.abrupt("return",!1);case 6:if(nt=[{choice_text:"\u6B63\u786E",is_answer:Et==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Et==="2"?2:0}],dn.current=!0,!Ce.question_id){Kt.next=19;break}if(!((Ce==null?void 0:Ce.is_my)===1)){Kt.next=13;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Rt=Object(te.a)(s.a.mark(function En(){var on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Qt){return Qt.choice_text}),standard_answers:nt.filter(function(Qt){return Qt.is_answer}).map(function(Qt){return Qt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(on=ve.editData)===null||on===void 0||((gr=on.exercise)===null||gr===void 0)?void 0:gr.sub_discipline_id,difficulty:In,is_cover:1,repeat_answer:!Vn,analysis:Mn}});case 2:ze=tr.sent,Vt(ze);case 4:case"end":return tr.stop()}},En)}));function It(){return Rt.apply(this,arguments)}return It}(),onCancel:function(){var Rt=Object(te.a)(s.a.mark(function En(){var on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Qt){return Qt.choice_text}),standard_answers:nt.filter(function(Qt){return Qt.is_answer}).map(function(Qt){return Qt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(on=ve.editData)===null||on===void 0||((gr=on.exercise)===null||gr===void 0)?void 0:gr.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 2:ze=tr.sent,Vt(ze);case 4:case"end":return tr.stop()}},En)}));function It(){return Rt.apply(this,arguments)}return It}()}),Kt.next=17;break;case 13:return Kt.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Rt){return Rt.choice_text}),standard_answers:nt.filter(function(Rt){return Rt.is_answer}).map(function(Rt){return Rt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(pt=ve.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 15:ze=Kt.sent,Vt(ze);case 17:Kt.next=23;break;case 19:return Kt.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:zt.categoryId,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Rt){return Rt.choice_text}),standard_answers:nt.filter(function(Rt){return Rt.is_answer}).map(function(Rt){return Rt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(Tt=ve.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 21:ze=Kt.sent,Vt(ze);case 23:return Kt.abrupt("return",{name:Hn,choices:nt});case 24:case"end":return Kt.stop()}},Je)}));return function(){return lt.apply(this,arguments)}}(),nn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(lt){var Je,nt;return(ve==null||((Je=ve.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0))?void 0:nt.exercise_status)===1?lt:lt.id!=="del"&<.id!=="add"}),bn=function(){var lt=Object(te.a)(s.a.mark(function Je(nt){return s.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(!(cn!==-1)){pt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),pt.abrupt("return");case 3:pt.t0=nt.id,pt.next=pt.t0==="del"?6:pt.t0==="up"||pt.t0==="down"?8:pt.t0==="edit"?12:pt.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Tt(){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},zt)});case 3:case"end":return St.stop()}},Tt)}))()}}),pt.abrupt("break",17);case 8:return pt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:nt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},zt)}),pt.abrupt("break",17);case 12:return mr(Ce.dragKey),Ft(!0),pt.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:2}),pt.abrupt("break",17);case 17:case"end":return pt.stop()}},Je)}));return function(nt){return lt.apply(this,arguments)}}(),gn=function(){var Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ce==null||((Je=Ce.question_choices)===null||Je===void 0)?void 0:Je.map(function(nt,ze){return t.a.createElement(h.a,{key:ze,checked:Ce.standard_answer.includes(ze+1),disabled:!0},ne[ze],"."," ",t.a.createElement("span",{className:"c-black font14"},nt.choice_text))})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&nn.map(function(nt,ze){return nt.id==="up"&&Ce.key===1||nt.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:ze,placement:"bottom",title:nt.name},t.a.createElement("span",{onClick:function(){return bn(nt)},className:nt.icon}))})))},bt=function(){var Je,nt;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Hn,onChange:function(pt){return fn(pt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(h.a.Group,{buttonStyle:"solid",value:Et,onChange:function(pt){return Mt(pt.target.value)}},t.a.createElement(h.a.Button,{value:"1",className:"".concat(he.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(h.a.Button,{value:"2",className:he.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Mn,onChange:function(pt){return Dn(pt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:xn,max:1e4,min:0,onChange:function(pt){Jn(pt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:In,onChange:function(pt){wn(pt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:un,selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,onChange:Un,subId:(Je=ve.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,knowledgeOptions:Ln,onAddKnowledgeFinish:Ut})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Vn,onChange:function(pt){qn(pt)}}))),t.a.createElement("aside",{className:"tr"},(cn!==-1||Ce.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){O(),Ft(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){jt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!qt&&gn(),qt&&bt())},_e=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ge,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(fe)),ke=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],qe=Object(i.forwardRef)(function(mt,Ge){var Ot=mt.problemset,Me=mt.globalSetting,ye=mt.exercise,ve=mt.loading,or=mt.dispatch,en=mt.onRef,Ie=en===void 0?function(){}:en,gt=mt.editData,Ce=mt.cancelAdd,cn=Ce===void 0?function(){}:Ce,hr=mt.editKey,mr=mt.setEditKey,q=mr===void 0?function(){}:mr,O=mt.setIsClaer,M=O===void 0?function(){}:O,X=mt.addCallback,se=X===void 0?function(Nt){}:X,Z=mt.reload,Le=Z===void 0?function(){}:Z,ot=Object(W.a)(mt,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),wt=Object(i.useState)([]),Lt=Object(a.a)(wt,2),ct=Lt[0],Et=Lt[1],Mt=Object(i.useState)(),Cn=Object(a.a)(Mt,2),Yn=Cn[0],Hn=Cn[1],fn=Object(i.useState)([]),Wt=Object(a.a)(fn,2),sn=Wt[0],qt=Wt[1],Ft=Object(i.useState)(""),Qn=Object(a.a)(Ft,2),Bn=Qn[0],xn=Qn[1],Jn=Object(i.useState)(),pn=Object(a.a)(Jn,2),Sn=pn[0],un=pn[1],Un=Object(i.useState)(!1),Xn=Object(a.a)(Un,2),nr=Xn[0],Ln=Xn[1],Kn=Object(i.useState)([]),rn=Object(a.a)(Kn,2),_n=rn[0],In=rn[1],wn=Object(i.useState)(1),Zn=Object(a.a)(wn,2),yn=Zn[0],Vn=Zn[1],qn=Object(i.useState)(!1),kn=Object(a.a)(qn,2),Pn=kn[0],Mn=kn[1],Dn=Object(i.useState)(""),dn=Object(a.a)(Dn,2),Ut=dn[0],zt=dn[1],Vt=Object(i.useState)([]),jt=Object(a.a)(Vt,2),nn=jt[0],bn=jt[1],gn=Object(i.useRef)(!1),bt=function(St){bn([].concat(Object(j.a)(nn),[Object(g.a)({},St)]))},lt=Object(w.i)();Object(i.useEffect)(function(){Et(["","","",""])},[]),Object(i.useEffect)(function(){if(gn.current)return;if(!(gt!=null&>.question_choices)){Ln(!0),xn(""),un(5),Et(["","","",""]),qt([]);return}xn(gt==null?void 0:gt.question_title),un(gt==null?void 0:gt.question_score),Mn(!(gt!=null&>.repeat_answer)),Vn(gt==null?void 0:gt.difficulty),Et(gt==null?void 0:gt.question_choices.map(function(St){return St.choice_text}));var Nt=[];gt==null||gt.standard_answer.map(function(St,Kt){Nt.push(St-1)}),qt(Nt),In(gt.tag_discipline_ids),zt(gt==null?void 0:gt.analysis)},[gt,nr]),Object(i.useEffect)(function(){nr&&Nt();function Nt(){return St.apply(this,arguments)}function St(){return St=Object(te.a)(s.a.mark(function Kt(){var Rt,It,En;return s.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return gr.next=2,Object(I.I)({sub_discipline_id:(Rt=ye.editData)===null||Rt===void 0||((It=Rt.exercise)===null||It===void 0)?void 0:It.sub_discipline_id});case 2:En=gr.sent,bn(En.tag_disciplines);case 4:case"end":return gr.stop()}},Kt)})),St.apply(this,arguments)}},[nr]),Object(i.useImperativeHandle)(Ge,function(){return{onSave:nt,isEdit:nr}}),Object(i.useEffect)(function(){var Nt,St=ye!=null&&(Nt=ye.tagDisciplineData)!==null&&Nt!==void 0&&Nt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];bn(St)},[ye.tagDisciplineData]);var Je=function(St){(St==null?void 0:St.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ln(!1),q(-1),gn.current=!1,Le())},nt=function(){var Nt=Object(te.a)(s.a.mark(function St(){var Kt,Rt,It,En,on,gr,er;return s.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:if(Bn){Qt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Qt.abrupt("return",!1);case 3:if(Kt=ct.findIndex(function(Rn){return!Rn}),!(Kt>-1)){Qt.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ke[Kt]," \u9009\u9879\u7684\u5185\u5BB9")),Qt.abrupt("return",!1);case 7:if(sn.length){Qt.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Qt.abrupt("return",!1);case 10:if(!(sn.length<1)){Qt.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Qt.abrupt("return",!1);case 13:if(Rt=ct.map(function(Rn,zn){return{choice_text:Rn,is_answer:sn.includes(zn)?zn+1:0}}),gn.current=!0,!gt.question_id){Qt.next=26;break}if(!((gt==null?void 0:gt.is_my)===1)){Qt.next=20;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Rn=Object(te.a)(s.a.mark(function rr(){var On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(lr){return lr.choice_text}),standard_answers:Rt.filter(function(lr){return lr.is_answer}).map(function(lr){return lr.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(On=ye.editData)===null||On===void 0||((Ir=On.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:yn,is_cover:1,repeat_answer:!Pn,analysis:Ut}});case 2:It=xr.sent,Je(It);case 4:case"end":return xr.stop()}},rr)}));function zn(){return Rn.apply(this,arguments)}return zn}(),onCancel:function(){var Rn=Object(te.a)(s.a.mark(function rr(){var On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(lr){return lr.choice_text}),standard_answers:Rt.filter(function(lr){return lr.is_answer}).map(function(lr){return lr.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(On=ye.editData)===null||On===void 0||((Ir=On.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 2:It=xr.sent,Je(It);case 4:case"end":return xr.stop()}},rr)}));function zn(){return Rn.apply(this,arguments)}return zn}()}),Qt.next=24;break;case 20:return Qt.next=22,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(Rn){return Rn.choice_text}),standard_answers:Rt.filter(function(Rn){return Rn.is_answer}).map(function(Rn){return Rn.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 22:It=Qt.sent,Je(It);case 24:Qt.next=30;break;case 26:return Qt.next=28,or({type:"exercise/addExerciseQuestion",payload:{insert_id:gt==null?void 0:gt.insert_id,categoryId:lt.categoryId,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(Rn){return Rn.choice_text}),standard_answers:Rt.filter(function(Rn){return Rn.is_answer}).map(function(Rn){return Rn.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 28:It=Qt.sent,Je(It);case 30:case"end":return Qt.stop()}},St)}));return function(){return Nt.apply(this,arguments)}}(),ze=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Nt){var St,Kt;return(ye==null||((St=ye.editData)===null||St===void 0||((Kt=St.exercise)===null||Kt===void 0))?void 0:Kt.exercise_status)===1?Nt:Nt.id!=="del"&&Nt.id!=="add"}),pt=function(){var Nt=Object(te.a)(s.a.mark(function St(Kt){return s.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:if(!(hr!==-1)){It.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),It.abrupt("return");case 3:It.t0=Kt.id,It.next=It.t0==="del"?6:It.t0==="up"||It.t0==="down"?8:It.t0==="edit"?12:It.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function on(){return s.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:return er.next=2,Object(I.n)({id:gt.question_id});case 2:or({type:"exercise/editExercise",payload:Object(g.a)({},lt)});case 3:case"end":return er.stop()}},on)}))()}}),It.abrupt("break",17);case 8:return It.next=10,or({type:"exercise/exeriseMoveUpDown",payload:{id:gt.question_id,opr:Kt.id}});case 10:return or({type:"exercise/editExercise",payload:Object(g.a)({},lt)}),It.abrupt("break",17);case 12:return q(gt.dragKey),Ln(!0),It.abrupt("break",17);case 15:return se({key:gt.key,insert_id:gt==null?void 0:gt.question_id,question_type:1}),It.abrupt("break",17);case 17:case"end":return It.stop()}},St)}));return function(Kt){return Nt.apply(this,arguments)}}(),rt=function(){var St;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(gt!=null&>.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},gt.key,"\u3001\u591A\u9009\u9898"),"\uFF08",gt.question_score,"\u5206\uFF09")),gt!=null&>.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},gt.key,"."),t.a.createElement(we.a,{value:gt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",gt.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:gt.question_title})),t.a.createElement("div",{className:he.a.questionChoices},gt==null||((St=gt.question_choices)===null||St===void 0)?void 0:St.map(function(Kt,Rt){return t.a.createElement(r.a,{key:Rt},t.a.createElement(A.a,null,t.a.createElement(C.a,{key:Rt,checked:gt.standard_answer.includes(Rt+1),disabled:!0},ke[Rt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:Kt.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!gt.hideAction&&ze.map(function(Kt,Rt){return Kt.id==="up"&>.key===1||Kt.id==="down"&>.key===gt.len?null:t.a.createElement(o.a,{key:Rt,placement:"bottom",title:Kt.name},t.a.createElement("span",{onClick:function(){return pt(Kt)},className:Kt.icon}))})))},Tt=function(){var St,Kt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Bn,onChange:function(It){return xn(It)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ct.map(function(Rt,It){var En,on;return t.a.createElement("div",{className:he.a.choiceWrap,key:It},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(sn.includes(It)?he.a.activeAnswer:""),onClick:function(){sn.includes(It)?qt(sn.filter(function(er){return er!==It})):qt([].concat(Object(j.a)(sn),[It]))}},ke[It])),t.a.createElement("div",{className:he.a.editorWrap},Yn===It?t.a.createElement(v.a,{id:"single-question-option-".concat(It),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Rt,onChange:function(er){ct[It]=er,Et(ct)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return Hn(It)}},t.a.createElement(we.a,{value:Rt}))),((En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,It>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Et(ct.filter(function(er,tr){return tr!==It}))}})),It<7&&It===ct.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Et([].concat(Object(j.a)(ct),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ut,onChange:function(It){return zt(It)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Sn,max:1e4,min:0,onChange:function(It){un(It)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:yn,onChange:function(It){Vn(It.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:_n,selectvalues:gt==null?void 0:gt.tag_discipline_ids,onChange:In,subId:(St=ye.editData)===null||St===void 0||((Kt=St.exercise)===null||Kt===void 0)?void 0:Kt.sub_discipline_id,knowledgeOptions:nn,onAddKnowledgeFinish:bt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Pn,onChange:function(It){Mn(It)}}))),t.a.createElement("aside",{className:"tr"},(hr!==-1||gt.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){cn(),Ln(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){nt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!nr&&rt(),nr&&Tt())}),je=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ge,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(qe),st=U("55Ip"),vt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Re=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.globalSetting,ve=Ge.exercise,or=Ge.loading,en=Ge.dispatch,Ie=Ge.editData,gt=Ge.cancelAdd,Ce=gt===void 0?function(){}:gt,cn=Ge.editKey,hr=Ge.setEditKey,mr=hr===void 0?function(){}:hr,q=Ge.addCallback,O=q===void 0?function(){}:q,M=Ge.reload,X=M===void 0?function(){}:M,se=Ge.setIsClaer,Z=se===void 0?function(){}:se,Le=Object(W.a)(Ge,["problemset","globalSetting","exercise","loading","dispatch","editData","cancelAdd","editKey","setEditKey","addCallback","reload","setIsClaer"]),ot=Object(i.useState)(""),wt=Object(a.a)(ot,2),Lt=wt[0],ct=wt[1],Et=Object(i.useState)(""),Mt=Object(a.a)(Et,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)(""),fn=Object(a.a)(Hn,2),Wt=fn[0],sn=fn[1],qt=Object(i.useState)([]),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(""),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)(!1),Kn=Object(a.a)(Ln,2),rn=Kn[0],_n=Kn[1],In=Object(i.useState)([]),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)(!1),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useState)(!1),Dn=Object(a.a)(Mn,2),dn=Dn[0],Ut=Dn[1],zt=Object(w.i)(),Vt=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Je;if(Vt.current)return;Ie.edit&&(Pn(!0),Yn(""),ct(""),yn([])),ct(Ie.shixun_name),Yn(Ie.question_title);var nt=[];(Je=Ie.shixun)===null||Je===void 0||Je.map(function(ze){nt.push(ze.challenge_score)}),yn(nt)},[Ie]),Object(i.useEffect)(function(){_n(!1)},[kn]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:nn,isEdit:kn}});var jt=function(nt){(nt==null?void 0:nt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),mr(-1),Vt.current=!1,X())},nn=function(){var Je=Object(te.a)(s.a.mark(function nt(){var ze,pt,rt;return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:if(ze=[],pt=!1,!pt){Nt.next=4;break}return Nt.abrupt("return",!1);case 4:if(Vt.current=!0,Ut(!0),!Ie.question_id){Nt.next=12;break}return Nt.next=9,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Cn,shixun_name:Lt,shixun_id:Ie.shixun_id,question_type:5,question_scores:Zn}});case 9:rt=Nt.sent,Nt.next=15;break;case 12:return Nt.next=14,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ie==null?void 0:Ie.insert_id,categoryId:zt.categoryId,question_title:Cn,shixun_name:Lt,shixun_id:Ie.shixun_id,question_type:5,question_scores:Zn,is_copy:Ie.is_copy}});case 14:rt=Nt.sent;case 15:return jt(rt),Ut(!1),Nt.abrupt("return",{name:Cn,analysis:Wt,standard_answers:ze,is_ordered:Xn});case 18:case"end":return Nt.stop()}},nt)}));return function(){return Je.apply(this,arguments)}}(),bn=function(){var nt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(T.a,{defaultValue:Lt,onChange:function(pt){ct(pt.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(v.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:Cn,onChange:function(pt){Yn(pt)}})),t.a.createElement("div",{className:"mt20"},(nt=Ie.shixun)===null||nt===void 0?void 0:nt.map(function(ze,pt){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(A.a,{flex:"1"},pt+1,".",ze.challenge_name),t.a.createElement(A.a,null,t.a.createElement(B.a,{defaultValue:Zn[pt],onChange:function(Tt){Zn[pt]=Tt,yn(Zn),console.log("srore:L",Zn[pt])}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Qn.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:Xn,onChange:function(pt){return nr(pt.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(cn!==-1||!(Ie!=null&&Ie.edit))&&t.a.createElement(p.a,{type:"default",onClick:function(){Ce(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{loading:dn,className:"ml20",type:"primary",onClick:function(){nn()}},"\u4FDD\u5B58")))},gn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Je){var nt,ze;return(ve==null||((nt=ve.editData)===null||nt===void 0||((ze=nt.exercise)===null||ze===void 0))?void 0:ze.exercise_status)===1?Je:Je.id!=="del"&&Je.id!=="add"}),bt=function(){var Je=Object(te.a)(s.a.mark(function nt(ze){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(!(cn!==-1)){rt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),rt.abrupt("return");case 3:rt.t0=ze.id,rt.next=rt.t0==="del"?6:rt.t0==="up"||rt.t0==="down"?8:rt.t0==="edit"?12:rt.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Nt(){return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(I.n)({id:Ie.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},zt)});case 3:case"end":return Kt.stop()}},Nt)}))()}}),rt.abrupt("break",17);case 8:return rt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ie.question_id,opr:ze.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},zt)}),rt.abrupt("break",17);case 12:return mr(Ie.dragKey),Pn(!0),rt.abrupt("break",17);case 15:return en({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:Ie.key,insert_id:Ie==null?void 0:Ie.question_id,question_type:5}}}),rt.abrupt("break",17);case 17:case"end":return rt.stop()}},nt)}));return function(ze){return Je.apply(this,arguments)}}(),lt=function(){var nt,ze;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ie!=null&&Ie.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09")),Ie!=null&&Ie.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ie.key,"."),t.a.createElement(we.a,{value:Ie.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ie.question_score,"\u5206\uFF09"),!!((nt=Ie.schools)!==null&&nt!==void 0&&nt.length)&&t.a.createElement(o.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ie.shixun_name})),t.a.createElement("div",{className:"mt30"}),(ze=Ie.shixun)===null||ze===void 0?void 0:ze.map(function(pt,rt){return t.a.createElement("div",{key:rt},"\u7B2C",rt+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},pt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},pt.challenge_score," \u5206"))}),t.a.createElement("div",{className:he.a.action},t.a.createElement(st.a,{target:"_blank",to:"/shixuns/".concat(Ie.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!Ie.hideAction&&gn.map(function(pt,rt){return pt.id==="up"&&Ie.key===1||pt.id==="down"&&Ie.key===Ie.len?null:t.a.createElement(o.a,{key:rt,placement:"bottom",title:pt.name},t.a.createElement("span",{onClick:function(){return bt(pt)},className:pt.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!kn&<(),kn&&bn())},Be=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ge,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Re)),Ye=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ke=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.exercise,ve=Ge.globalSetting,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.cancelAdd,hr=cn===void 0?function(){}:cn,mr=Ge.editKey,q=Ge.setEditKey,O=q===void 0?function(){}:q,M=Ge.setIsClaer,X=M===void 0?function(){}:M,se=Ge.reload,Z=se===void 0?function(){}:se,Le=Ge.addCallback,ot=Le===void 0?function(Kt){}:Le,wt=Object(W.a)(Ge,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","reload","addCallback"]),Lt=Object(i.useState)([]),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)([]),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(""),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(!1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)(!1),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],dn=Object(i.useState)(""),Ut=Object(a.a)(dn,2),zt=Ut[0],Vt=Ut[1],jt=Object(w.i)(),nn=Object(i.useRef)(null),bn=Object(i.useRef)(!1),gn=Object(i.useState)([]),bt=Object(a.a)(gn,2),lt=bt[0],Je=bt[1],nt=function(Rt){Je([].concat(Object(j.a)(lt),[Object(g.a)({},Rt)]))};Object(i.useEffect)(function(){Mt(["","","",""])},[]),Object(i.useEffect)(function(){if(bn.current)return;if(!(Ce!=null&&Ce.question_choices)){wn(!0),Jn(""),Un(5),Mt(["","","",""]),Ft([]);return}Jn(Ce==null?void 0:Ce.question_title),Un(Ce==null?void 0:Ce.question_score),Dn(!(Ce!=null&&Ce.repeat_answer)),Vt(Ce==null?void 0:Ce.analysis),qn(Ce==null?void 0:Ce.difficulty),Mt(Ce==null?void 0:Ce.question_choices.map(function(Rt){return Rt.choice_text}));var Kt=[];Ce==null||Ce.standard_answer.map(function(Rt,It){Kt.push(Rt-1)}),Kn(Ce.tag_discipline_ids),Ft(Kt)},[Ce,In]),Object(i.useEffect)(function(){In&&Kt();function Kt(){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(te.a)(s.a.mark(function It(){var En,on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,Object(I.I)({sub_discipline_id:(En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.sub_discipline_id});case 2:gr=tr.sent,Je(gr.tag_disciplines);case 4:case"end":return tr.stop()}},It)})),Rt.apply(this,arguments)}},[In]),Object(i.useEffect)(function(){var Kt,Rt=ye!=null&&(Kt=ye.tagDisciplineData)!==null&&Kt!==void 0&&Kt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];Je(Rt)},[ye.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:pt,isEdit:In}});var ze=function(Rt){(Rt==null?void 0:Rt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),O(-1),bn.current=!1,Z())},pt=function(){var Kt=Object(te.a)(s.a.mark(function Rt(){var It,En,on,gr,er,tr,Qt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(xn){zn.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),zn.abrupt("return",!1);case 3:if(It=Et.findIndex(function(rr){return!rr}),!(It>-1)){zn.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Ye[It]," \u9009\u9879\u7684\u5185\u5BB9")),zn.abrupt("return",!1);case 7:if(qt.length){zn.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),zn.abrupt("return",!1);case 10:if(!(qt.length<1)){zn.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),zn.abrupt("return",!1);case 13:if(En=Et.map(function(rr,On){return{choice_text:rr,is_answer:qt.includes(On)?On+1:0}}),bn.current=!0,!Ce.question_id){zn.next=26;break}if(!((Ce==null?void 0:Ce.is_my)===1)){zn.next=20;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var rr=Object(te.a)(s.a.mark(function Ir(){var jr,xr;return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(Er){return Er.choice_text}),standard_answers:En.filter(function(Er){return Er.is_answer}).map(function(Er){return Er.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(jr=ye.editData)===null||jr===void 0||((xr=jr.exercise)===null||xr===void 0)?void 0:xr.sub_discipline_id,difficulty:Vn,is_cover:1,repeat_answer:!Mn,analysis:zt}});case 2:on=wr.sent,ze(on);case 4:case"end":return wr.stop()}},Ir)}));function On(){return rr.apply(this,arguments)}return On}(),onCancel:function(){var rr=Object(te.a)(s.a.mark(function Ir(){var jr,xr;return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(Er){return Er.choice_text}),standard_answers:En.filter(function(Er){return Er.is_answer}).map(function(Er){return Er.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(jr=ye.editData)===null||jr===void 0||((xr=jr.exercise)===null||xr===void 0)?void 0:xr.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:zt}});case 2:on=wr.sent,ze(on);case 4:case"end":return wr.stop()}},Ir)}));function On(){return rr.apply(this,arguments)}return On}()}),zn.next=24;break;case 20:return zn.next=22,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(rr){return rr.choice_text}),standard_answers:En.filter(function(rr){return rr.is_answer}).map(function(rr){return rr.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:zt}});case 22:on=zn.sent,ze(on);case 24:zn.next=30;break;case 26:return zn.next=28,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:jt.categoryId,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(rr){return rr.choice_text}),standard_answers:En.filter(function(rr){return rr.is_answer}).map(function(rr){return rr.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(tr=ye.editData)===null||tr===void 0||((Qt=tr.exercise)===null||Qt===void 0)?void 0:Qt.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:zt}});case 28:on=zn.sent,ze(on);case 30:case"end":return zn.stop()}},Rt)}));return function(){return Kt.apply(this,arguments)}}(),rt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Kt){var Rt,It;return(ye==null||((Rt=ye.editData)===null||Rt===void 0||((It=Rt.exercise)===null||It===void 0))?void 0:It.exercise_status)===1?Kt:Kt.id!=="del"&&Kt.id!=="add"}),Tt=function(){var Kt=Object(te.a)(s.a.mark(function Rt(It){return s.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(!(mr!==-1)){on.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),on.abrupt("return");case 3:on.t0=It.id,on.next=on.t0==="del"?6:on.t0==="up"||on.t0==="down"?8:on.t0==="edit"?12:on.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function er(){return s.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},jt)});case 3:case"end":return Qt.stop()}},er)}))()}}),on.abrupt("break",17);case 8:return on.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:It.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},jt)}),on.abrupt("break",17);case 12:return O(Ce.dragKey),wn(!0),on.abrupt("break",17);case 15:return ot({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:0}),on.abrupt("break",17);case 17:case"end":return on.stop()}},Rt)}));return function(It){return Kt.apply(this,arguments)}}(),Nt=function(){var Rt;return t.a.createElement("aside",{ref:nn},t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u5355\u9009\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ce==null||((Rt=Ce.question_choices)===null||Rt===void 0)?void 0:Rt.map(function(It,En){return t.a.createElement(r.a,{key:En},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:En,checked:Ce.standard_answer.includes(En+1),disabled:!0},Ye[En],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:It.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&rt.map(function(It,En){return It.id==="up"&&Ce.key===1||It.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:En,placement:"bottom",title:It.name},t.a.createElement("span",{onClick:function(){return Tt(It)},className:It.icon}))})))},St=function(){var Rt,It;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:xn,onChange:function(on){return Jn(on)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Et.map(function(En,on){var gr,er;return t.a.createElement("div",{className:he.a.choiceWrap,key:on},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(qt.includes(on)?he.a.activeAnswer:""),onClick:function(){qt.includes(on)?Ft(qt.filter(function(Qt){return Qt!==on})):Ft([].concat(Object(j.a)(qt),[on]))}},Ye[on])),t.a.createElement("div",{className:he.a.editorWrap},Hn===on?t.a.createElement(v.a,{id:"single-question-option-".concat(on),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:En,onChange:function(Qt){Et[on]=Qt,Mt(Et)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return fn(on)}},t.a.createElement(we.a,{value:En}))),((gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,on>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Mt(Et.filter(function(Qt,Rn){return Rn!==on}))}})),on<7&&on===Et.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Mt([].concat(Object(j.a)(Et),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:zt,onChange:function(on){return Vt(on)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:un,max:1e4,min:0,onChange:function(on){Un(on)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Vn,onChange:function(on){qn(on.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,value:Ln,onChange:Kn,subId:(Rt=ye.editData)===null||Rt===void 0||((It=Rt.exercise)===null||It===void 0)?void 0:It.sub_discipline_id,knowledgeOptions:lt,onAddKnowledgeFinish:nt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Mn,onChange:function(on){Dn(on)}}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){hr(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){pt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!In&&Nt(),In&&St())},yt=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ge,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ke)),Pt=U("Z9P2"),Ht=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Xt=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.exercise,ve=Ge.globalSetting,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.cancelAdd,hr=cn===void 0?function(){}:cn,mr=Ge.editKey,q=Ge.setEditKey,O=q===void 0?function(){}:q,M=Ge.reload,X=M===void 0?function(){}:M,se=Ge.addCallback,Z=se===void 0?function(){}:se,Le=Ge.setIsClaer,ot=Le===void 0?function(){}:Le,wt=Object(W.a)(Ge,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","reload","addCallback","setIsClaer"]),Lt=Object(i.useState)(""),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(""),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)([[],[]]),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],dn=Object(i.useRef)(!1),Ut=Object(w.i)(),zt=Object(i.useState)([]),Vt=Object(a.a)(zt,2),jt=Vt[0],nn=Vt[1],bn=function(rt){nn([].concat(Object(j.a)(jt),[Object(g.a)({},rt)]))};Object(i.useEffect)(function(){var pt;if(dn.current)return;if(!(Ce!=null&&Ce.question_title)){Un(!0),Mt(""),Ft(""),Jn(10);return}qn(!(Ce!=null&&Ce.repeat_answer)),Mt(Ce==null?void 0:Ce.question_title),Ft(Ce==null||((pt=Ce.standard_answer)===null||pt===void 0)?void 0:pt[0]),Jn(Ce==null?void 0:Ce.question_score),Kn(Ce.tag_discipline_ids),wn(Ce==null?void 0:Ce.difficulty),fn(Ce==null?void 0:Ce.analysis),Dn([Ce==null?void 0:Ce.normal_keywords,Ce==null?void 0:Ce.main_keywords])},[Me.editData,un]),Object(i.useEffect)(function(){var pt,rt=ye!=null&&(pt=ye.tagDisciplineData)!==null&&pt!==void 0&&pt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];nn(rt)},[ye.tagDisciplineData]),Object(i.useEffect)(function(){un&&pt();function pt(){return rt.apply(this,arguments)}function rt(){return rt=Object(te.a)(s.a.mark(function Tt(){var Nt,St,Kt;return s.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(I.I)({sub_discipline_id:(Nt=ye.editData)===null||Nt===void 0||((St=Nt.exercise)===null||St===void 0)?void 0:St.sub_discipline_id});case 2:Kt=It.sent,nn(Kt.tag_disciplines);case 4:case"end":return It.stop()}},Tt)})),rt.apply(this,arguments)}},[un]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:bt,isEdit:un}});var gn=function(rt){(rt==null?void 0:rt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Un(!1),O(-1),dn.current=!1,X())},bt=function(){var pt=Object(te.a)(s.a.mark(function rt(){var Tt,Nt,St,Kt,Rt,It,En;return s.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:if(Et){gr.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),gr.abrupt("return",!1);case 3:if(Tt=Mn[0],Nt=Mn[1],dn.current=!0,!Ce.question_id){gr.next=17;break}if(!((Ce==null?void 0:Ce.is_my)===1)){gr.next=11;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var er=Object(te.a)(s.a.mark(function Qt(){var Rn,zn;return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Et,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Rn=ye.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,difficulty:In,is_cover:1,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 2:St=On.sent,gn(St);case 4:case"end":return On.stop()}},Qt)}));function tr(){return er.apply(this,arguments)}return tr}(),onCancel:function(){var er=Object(te.a)(s.a.mark(function Qt(){var Rn,zn;return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Et,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Rn=ye.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 2:St=On.sent,gn(St);case 4:case"end":return On.stop()}},Qt)}));function tr(){return er.apply(this,arguments)}return tr}()}),gr.next=15;break;case 11:return gr.next=13,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Et,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Kt=ye.editData)===null||Kt===void 0||((Rt=Kt.exercise)===null||Rt===void 0)?void 0:Rt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 13:St=gr.sent,gn(St);case 15:gr.next=21;break;case 17:return gr.next=19,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:Ut.categoryId,exercise_bank_id:Ut.categoryId,question_title:Et,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(It=ye.editData)===null||It===void 0||((En=It.exercise)===null||En===void 0)?void 0:En.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 19:St=gr.sent,gn(St);case 21:return gr.abrupt("return",{name:Et,answer_texts:[qt],analysis:Hn,normal_keywords:Tt,main_keywords:Nt});case 22:case"end":return gr.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),lt=function(){var rt,Tt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Et,onChange:function(St){return Mt(St)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(v.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:qt,onChange:function(St){return Ft(St)}}),t.a.createElement(Pt.a,{value:Mn,onChange:Dn}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Hn,onChange:function(St){return fn(St)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:xn,max:1e4,min:0,onChange:function(St){Jn(St)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:In,onChange:function(St){wn(St.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Ln,selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,onChange:Kn,subId:(rt=ye.editData)===null||rt===void 0||((Tt=rt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,knowledgeOptions:jt,onAddKnowledgeFinish:bn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Vn,onChange:function(St){qn(St)}}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){hr(),Un(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){bt()}},"\u4FDD\u5B58")))},Je=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(pt){var rt,Tt;return(ye==null||((rt=ye.editData)===null||rt===void 0||((Tt=rt.exercise)===null||Tt===void 0))?void 0:Tt.exercise_status)===1?pt:pt.id!=="del"&&pt.id!=="add"}),nt=function(){var pt=Object(te.a)(s.a.mark(function rt(Tt){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(!(mr!==-1)){St.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),St.abrupt("return");case 3:St.t0=Tt.id,St.next=St.t0==="del"?6:St.t0==="up"||St.t0==="down"?8:St.t0==="edit"?12:St.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Rt(){return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return En.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Ut)});case 3:case"end":return En.stop()}},Rt)}))()}}),St.abrupt("break",17);case 8:return St.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:Tt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Ut)}),St.abrupt("break",17);case 12:return O(Ce.dragKey),Un(!0),St.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:4}),St.abrupt("break",17);case 17:case"end":return St.stop()}},rt)}));return function(Tt){return pt.apply(this,arguments)}}(),ze=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(we.a,{value:qt||""})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&Je.map(function(rt,Tt){return rt.id==="up"&&Ce.key===1||rt.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:Tt,placement:"bottom",title:rt.name},t.a.createElement("span",{onClick:function(){return nt(rt)},className:rt.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!un&&ze(),un&<())},an=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ge,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Xt)),tn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],et=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.exercise,ve=Ge.globalSetting,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.cancelAdd,hr=cn===void 0?function(){}:cn,mr=Ge.editKey,q=Ge.setEditKey,O=q===void 0?function(){}:q,M=Ge.addCallback,X=M===void 0?function(){}:M,se=Ge.setIsClaer,Z=se===void 0?function(){}:se,Le=Object(W.a)(Ge,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","addCallback","setIsClaer"]),ot=Object(i.useState)([]),wt=Object(a.a)(ot,2),Lt=wt[0],ct=wt[1],Et=Object(i.useState)(),Mt=Object(a.a)(Et,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)([]),fn=Object(a.a)(Hn,2),Wt=fn[0],sn=fn[1],qt=Object(i.useState)(""),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(5),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(!1),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(w.g)(),Kn=Object(w.i)();Object(i.useEffect)(function(){ct(["","","",""])},[]),Object(i.useEffect)(function(){if(!(Ce!=null&&Ce.question_choices)){nr(!0),Bn(""),Sn(5),ct(["","","",""]),sn([]);return}Bn(Ce==null?void 0:Ce.question_title),Sn(Ce==null?void 0:Ce.question_score),ct(Ce==null?void 0:Ce.question_choices.map(function(Vn){return Vn.choice_text}));var yn=[];Ce==null||Ce.standard_answer.map(function(Vn,qn){yn.push(Vn-1)}),sn(yn)},[Ce]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:rn,isEdit:Xn}});var rn=function(){var yn=Object(te.a)(s.a.mark(function Vn(){var qn,kn,Pn;return s.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:if(Qn){Dn.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Dn.abrupt("return",!1);case 3:if(qn=Lt.findIndex(function(dn){return!dn}),!(qn>-1)){Dn.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(tn[qn]," \u9009\u9879\u7684\u5185\u5BB9")),Dn.abrupt("return",!1);case 7:if(Wt.length){Dn.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Dn.abrupt("return",!1);case 10:if(!(Wt.length<1)){Dn.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Dn.abrupt("return",!1);case 13:if(kn=Lt.map(function(dn,Ut){return{choice_text:dn,is_answer:Wt.includes(Ut)?Ut+1:0}}),!Ce.question_id){Dn.next=20;break}return Dn.next=17,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Qn,question_type:1,question_score:pn,question_choices:kn.map(function(dn){return dn.choice_text}),standard_answers:kn.filter(function(dn){return dn.is_answer}).map(function(dn){return dn.is_answer})}});case 17:Pn=Dn.sent,Dn.next=23;break;case 20:return Dn.next=22,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:Kn.categoryId,question_title:Qn,question_type:1,question_score:"5.0",question_choices:kn.map(function(dn){return dn.choice_text}),standard_answers:kn.filter(function(dn){return dn.is_answer}).map(function(dn){return dn.is_answer})}});case 22:Pn=Dn.sent;case 23:Pn.status===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),nr(!1),en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)}));case 24:case"end":return Dn.stop()}},Vn)}));return function(){return yn.apply(this,arguments)}}(),_n=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(yn){var Vn,qn;return(ye==null||((Vn=ye.editData)===null||Vn===void 0||((qn=Vn.exercise)===null||qn===void 0))?void 0:qn.exercise_status)===1?yn:yn.id!=="del"&&yn.id!=="add"}),In=function(){var yn=Object(te.a)(s.a.mark(function Vn(qn){return s.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(!(mr!==-1)){Pn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Pn.abrupt("return");case 3:Pn.t0=qn.id,Pn.next=Pn.t0==="del"?6:Pn.t0==="up"||Pn.t0==="down"?8:Pn.t0==="edit"?12:Pn.t0==="add"?14:16;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Dn(){return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)});case 3:case"end":return Ut.stop()}},Dn)}))()}}),Pn.abrupt("break",16);case 8:return Pn.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:qn.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)}),Pn.abrupt("break",16);case 12:return Ln.push("/problems/".concat(Ce==null?void 0:Ce.hack_identifier,"/edit?type=exercises&express_id=").concat(Kn.categoryId,"&question_id=").concat(Ce==null?void 0:Ce.question_id,"&score=").concat(Ce==null?void 0:Ce.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Pn.abrupt("break",16);case 14:return X({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:6}),Pn.abrupt("break",16);case 16:case"end":return Pn.stop()}},Vn)}));return function(qn){return yn.apply(this,arguments)}}(),wn=function(){var yn=Object(te.a)(s.a.mark(function Vn(qn){var kn;return s.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return qn.preventDefault(),Mn.next=3,Object(I.Y)({id:Ce==null?void 0:Ce.hack_identifier});case 3:kn=Mn.sent,kn.status===0&&Object(ie.S)("/myproblems/".concat(kn==null?void 0:kn.identifier));case 5:case"end":return Mn.stop()}},Vn)}));return function(qn){return yn.apply(this,arguments)}}(),Zn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement(we.a,{value:Ce.description||""})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&_n.map(function(Vn,qn){return Vn.id==="up"&&Ce.key===1||Vn.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:qn,placement:"bottom",title:Vn.name},t.a.createElement("span",{onClick:function(){return In(Vn)},className:Vn.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},Zn())},Ze=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ge,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(et)),Ct=U("LvDl"),At=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],dt=function(Ge,Ot){var Me=Ge.problemset,ye=Ge.exercise,ve=Ge.globalSetting,or=Ge.loading,en=Ge.dispatch,Ie=Ge.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ge.editData,cn=Ge.cancelAdd,hr=cn===void 0?function(){}:cn,mr=Ge.editKey,q=Ge.setEditKey,O=q===void 0?function(){}:q,M=Ge.setIsClaer,X=M===void 0?function(){}:M,se=Ge.addCallback,Z=se===void 0?function(bt){}:se,Le=Ge.reload,ot=Le===void 0?function(){}:Le,wt=Object(W.a)(Ge,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),Lt=Object(i.useState)([]),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(!1),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!0),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(1),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(w.i)(),_n=Object(i.useRef)(null),In=Object(i.useState)(""),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)([]),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useRef)(!1),Dn=function(lt){Kn([].concat(Object(j.a)(Ln),[Object(g.a)({},lt)]))};Object(i.useEffect)(function(){var bt;if(Mn.current)return;if(!(Ce!=null&&Ce.question_title)){fn(!0),yn("");return}yn(Ce==null?void 0:Ce.question_title),Un(!(Ce!=null&&Ce.repeat_answer)),Jn(Ce==null?void 0:Ce.difficulty),Mt(Ce.tag_discipline_ids);var lt=Ce==null||((bt=Ce.sub_exercise_questions)===null||bt===void 0)?void 0:bt.map(function(Je){var nt,ze,pt;return Object(g.a)(Object(g.a)({},Je),{},{id:Je.question_id,name:Je.question_title,open:!1,score:Je.question_score,qusList:Je==null||((nt=Je.question_choices)===null||nt===void 0)?void 0:nt.map(function(rt){return rt.choice_text}),activeQusEditor:null,qusAnswer:(ze=[Je==null||((pt=Je.question_choices)===null||pt===void 0)?void 0:pt.findIndex(function(rt){return rt.standard_boolean})])===null||ze===void 0?void 0:ze.filter(function(rt){return rt!==-1})})});Pn(lt)},[Ce,Hn]),Object(i.useEffect)(function(){Hn&&bt();function bt(){return lt.apply(this,arguments)}function lt(){return lt=Object(te.a)(s.a.mark(function Je(){var nt,ze,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(I.I)({sub_discipline_id:(nt=ye.editData)===null||nt===void 0||((ze=nt.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id});case 2:pt=Tt.sent,Kn(pt.tag_disciplines);case 4:case"end":return Tt.stop()}},Je)})),lt.apply(this,arguments)}},[Hn]),Object(i.useEffect)(function(){var bt,lt=ye!=null&&(bt=ye.tagDisciplineData)!==null&&bt!==void 0&&bt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];Kn(lt)},[ye.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Ut,isEdit:Hn}});var dn=function(lt){(lt==null?void 0:lt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),fn(!1),O(-1),Mn.current=!1,ot())},Ut=function(){var bt=Object(te.a)(s.a.mark(function lt(){var Je,nt,ze,pt,rt,Tt,Nt,St;return s.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:if(Zn){Rt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Rt.abrupt("return",!1);case 3:if(!(kn.length===0)){Rt.next=6;break}return _.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),Rt.abrupt("return",!1);case 6:Je=0;case 7:if(!(Je-1)){Rt.next=19;break}return _.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Je+1,"\u5C0F\u9898").concat(At[pt],"\u9009\u9879\u7684\u5185\u5BB9")),Rt.abrupt("return",!1);case 19:if(ze!=null&&ze.qusAnswer.length){Rt.next=22;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Je+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),Rt.abrupt("return",!1);case 22:Je++,Rt.next=7;break;case 25:if(rt=kn.map(function(It){var En;return{id:It.id>1?It.id:null,question_title:It.name,question_type:1,question_choices:It.qusList,question_score:It.score,standard_answers:[((En=It.qusAnswer)===null||En===void 0?void 0:En[0])+1]}}),Mn.current=!0,!Ce.question_id){Rt.next=36;break}if(!((Ce==null?void 0:Ce.is_my)===1)){Rt.next=32;break}K.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var It=Object(te.a)(s.a.mark(function on(){var gr,er;return s.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:Et,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:xn,is_cover:1,repeat_answer:!un}});case 2:Tt=Qt.sent,dn(Tt);case 4:case"end":return Qt.stop()}},on)}));function En(){return It.apply(this,arguments)}return En}(),onCancel:function(){var It=Object(te.a)(s.a.mark(function on(){var gr,er;return s.a.wrap(function(Qt){for(;;)switch(Qt.prev=Qt.next){case 0:return Qt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:Et,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:xn,repeat_answer:!un}});case 2:Tt=Qt.sent,dn(Tt);case 4:case"end":return Qt.stop()}},on)}));function En(){return It.apply(this,arguments)}return En}()}),Rt.next=36;break;case 32:return Rt.next=34,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:Et,sub_discipline_id:(Nt=ye.editData)===null||Nt===void 0||((St=Nt.exercise)===null||St===void 0)?void 0:St.sub_discipline_id,difficulty:xn,repeat_answer:!un}});case 34:Tt=Rt.sent,dn(Tt);case 36:case"end":return Rt.stop()}},lt)}));return function(){return bt.apply(this,arguments)}}(),zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(bt){var lt,Je;return(ye==null||((lt=ye.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0))?void 0:Je.exercise_status)===1?bt:bt.id!=="del"&&bt.id!=="add"}),Vt=function(){var bt=Object(te.a)(s.a.mark(function lt(Je){return s.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(!(mr!==-1)){ze.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),ze.abrupt("return");case 3:ze.t0=Je.id,ze.next=ze.t0==="del"?6:ze.t0==="up"||ze.t0==="down"?8:ze.t0==="edit"?12:ze.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function rt(){return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(I.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},rn)});case 3:case"end":return Nt.stop()}},rt)}))()}}),ze.abrupt("break",17);case 8:return ze.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:Je.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},rn)}),ze.abrupt("break",17);case 12:return O(Ce.dragKey),fn(!0),ze.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:0}),ze.abrupt("break",17);case 17:case"end":return ze.stop()}},lt)}));return function(Je){return bt.apply(this,arguments)}}(),jt=function(){var lt;return t.a.createElement("aside",{ref:_n},t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(we.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",Ce==null?void 0:Ce.sub_q_count,"\u5C0F\u9898\uFF0C",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:Ce.question_title})),t.a.createElement("div",{style:{display:qt?"block":"none"},className:he.a.questionChoices},Ce==null||((lt=Ce.sub_exercise_questions)===null||lt===void 0)?void 0:lt.map(function(Je,nt){var ze;return t.a.createElement("div",{key:nt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,".",nt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(we.a,{value:Je.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Je.question_score,"\u5206\uFF09")),Je==null||((ze=Je.question_choices)===null||ze===void 0)?void 0:ze.map(function(pt,rt){return t.a.createElement(r.a,{key:rt},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:rt,checked:Je.standard_answer.includes(rt+1),disabled:!0},At[rt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:pt.choice_text}))))}))})),t.a.createElement("div",{className:he.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Ft(!qt)},style:{}},qt?"\u6536\u8D77":"\u5C55\u5F00"),!Ce.hideAction&&zt.map(function(Je,nt){return Je.id==="up"&&Ce.key===1||Je.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:nt,placement:"bottom",title:Je.name},t.a.createElement("span",{onClick:function(){return Vt(Je)},className:Je.icon}))})))},nn=function(){var lt,Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:he.a.wrap,style:{padding:0}},t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Zn,onChange:function(ze){return yn(ze)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",kn==null?void 0:kn.length),kn==null?void 0:kn.map(function(nt,ze){var pt;return t.a.createElement("div",{className:he.a.fold,key:nt.id},t.a.createElement("div",{onClick:function(){return gn("open",ze)},className:he.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:nt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",ze+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(Tt){Tt.stopPropagation(),gn("delete",ze)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:nt.open?"block":"none"}},t.a.createElement(v.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nt==null?void 0:nt.name,onChange:function(Tt){return gn("value",ze,Tt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),nt==null||((pt=nt.qusList)===null||pt===void 0)?void 0:pt.map(function(rt,Tt){var Nt,St;return t.a.createElement("div",{className:he.a.choiceWrap,key:Tt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(nt!=null&&(Nt=nt.qusAnswer)!==null&&Nt!==void 0&&Nt.includes(Tt)?he.a.activeAnswer:""),onClick:function(){return gn("answer",ze,Tt)}},At[Tt])),t.a.createElement("div",{className:he.a.editorWrap},(nt==null?void 0:nt.activeQusEditor)===Tt?t.a.createElement(v.a,{id:"single-question-option-".concat(Tt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:rt,onChange:function(Rt){return gn("details",ze,Rt)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return gn("edit",ze,Tt)}},t.a.createElement(we.a,{value:rt}))),Tt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return gn("deleteQus",ze,Tt)}})),Tt<7&&Tt===(nt==null||((St=nt.qusList)===null||St===void 0)?void 0:St.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return gn("addQus",ze)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:nt.score,max:1e4,min:0,onChange:function(Tt){return gn("score",ze,Tt)}})," ","\u5206")))}),kn.length<20&&t.a.createElement(p.a,{type:"primary",onClick:bn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:xn,onChange:function(ze){Jn(ze.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,value:Et,onChange:Mt,subId:(lt=ye.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0)?void 0:Je.sub_discipline_id,knowledgeOptions:Ln,onAddKnowledgeFinish:Dn}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){hr(),fn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){Ut()}},"\u4FDD\u5B58")))},bn=function(){var lt={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Pn(kn.concat(lt))},gn=function(lt,Je,nt){var ze=Object(Ct.cloneDeep)(kn);if(lt==="open"&&(ze[Je].open=!ze[Je].open),lt==="delete"&&ze.splice(Je,1),lt==="value"&&(ze[Je].name=nt),lt==="answer"&&(ze[Je].qusAnswer=[nt]),lt==="edit"&&(ze[Je].activeQusEditor=nt),lt==="details"&&(ze[Je].qusList[ze[Je].activeQusEditor]=nt),lt==="addQus"&&(ze[Je].qusList=ze[Je].qusList.concat("")),lt==="deleteQus"){var pt;ze[Je].qusList=ze[Je].qusList.filter(function(rt,Tt){return Tt!==nt}),ze[Je].qusAnswer=(pt=ze[Je].qusAnswer)===null||pt===void 0?void 0:pt.filter(function(rt){return rt!==nt})}lt==="analysis"&&(ze[Je].analysis=nt),lt==="score"&&(ze[Je].score=nt),Pn(ze)};return t.a.createElement("section",{className:he.a.wrap},!Hn&&jt(),Hn&&nn())},ft=Object(F.a)(function(mt){var Ge=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ge,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(dt)),He=U("ngQI"),Ne=U("loLm"),Ue=U.n(Ne),ge=U("ErOA"),Ee=U("vCeJ"),De=U("Nog9"),ue=U.n(De),Fe=U("hQp1"),at=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],xt=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.cancelAdd,en=or===void 0?function(){}:or,Ie=Ge.editKey,gt=Ge.setEditKey,Ce=gt===void 0?function(){}:gt,cn=Ge.reload,hr=cn===void 0?function(){}:cn,mr=Ge.addCallback,q=mr===void 0?function(Je){}:mr,O=Object(i.useState)([]),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)([]),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(!1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(""),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(w.i)(),Pn=Object(i.useRef)(null),Mn=Object(i.useRef)(!1),Dn=Object(i.useState)([]),dn=Object(a.a)(Dn,2),Ut=dn[0],zt=dn[1],Vt=function(nt){zt([].concat(Object(j.a)(Ut),[Object(g.a)({},nt)]))};Object(i.useEffect)(function(){se(["","","",""])},[]),Object(i.useEffect)(function(){if(Mn.current)return;if(!(ve!=null&&ve.question_choices)){Un(!0),fn(""),Ft(5),se(["","","",""]),Mt([]);return}fn(ve==null?void 0:ve.question_title),Ft(ve==null?void 0:ve.question_score),wn(!(ve!=null&&ve.repeat_answer)),qn(ve==null?void 0:ve.analysis),Kn(ve==null?void 0:ve.difficulty),se(ve==null?void 0:ve.question_choices.map(function(nt){return nt.choice_text}));var Je=[];ve==null||ve.standard_answer.map(function(nt,ze){Je.push(nt-1)}),Jn(ve.tag_discipline_ids),Mt(Je)},[ve,un]),Object(i.useEffect)(function(){un&&Je();function Je(){return nt.apply(this,arguments)}function nt(){return nt=Object(te.a)(s.a.mark(function ze(){var pt,rt,Tt;return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(I.I)({sub_discipline_id:(pt=Me.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id});case 2:Tt=St.sent,zt(Tt.tag_disciplines);case 4:case"end":return St.stop()}},ze)})),nt.apply(this,arguments)}},[un]),Object(i.useEffect)(function(){var Je,nt=Me!=null&&(Je=Me.tagDisciplineData)!==null&&Je!==void 0&&Je.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];zt(nt)},[Me.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:nn,isEdit:un}});var jt=function(nt){(nt==null?void 0:nt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Un(!1),Ce(-1),Mn.current=!1,hr())},nn=function(){var Je=Object(te.a)(s.a.mark(function nt(){var ze,pt,rt,Tt,Nt,St,Kt;return s.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:if(Hn){It.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),It.abrupt("return",!1);case 3:if(ze=X.findIndex(function(En){return!En}),!(ze>-1)){It.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(at[ze]," \u9009\u9879\u7684\u5185\u5BB9")),It.abrupt("return",!1);case 7:if(Et.length){It.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),It.abrupt("return",!1);case 10:if(!(Et.length<1)){It.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),It.abrupt("return",!1);case 13:if(pt=X.map(function(En,on){return{choice_text:En,is_answer:Et.includes(on)?1:0}}),Mn.current=!0,!ve.question_id){It.next=22;break}return It.next=18,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:kn.id,question_id:ve.question_id,name:Hn,item_type:Et.length>1?Fe.a.Multiple:Fe.a.Single,question_score:qt,choices:pt,tag_discipline_ids:xn,sub_discipline_id:(Tt=Me.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:Ln,repeat_answer:!In,analysis:Vn}});case 18:rt=It.sent,jt(rt),It.next=26;break;case 22:return It.next=24,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:kn.id,name:Hn,item_type:Et.length>1?Fe.a.Multiple:Fe.a.Single,question_score:qt,choices:pt,tag_discipline_ids:xn,sub_discipline_id:(St=Me.editData)===null||St===void 0||((Kt=St.exercise)===null||Kt===void 0)?void 0:Kt.sub_discipline_id,difficulty:Ln,repeat_answer:!In,analysis:Vn}});case 24:rt=It.sent,jt(rt);case 26:case"end":return It.stop()}},nt)}));return function(){return Je.apply(this,arguments)}}(),bn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],gn=function(){var Je=Object(te.a)(s.a.mark(function nt(ze){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(!(Ie!==-1)){rt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),rt.abrupt("return");case 3:rt.t0=ze.id,rt.next=rt.t0==="del"?6:rt.t0==="edit"?8:rt.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Nt(){return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:return Kt.next=2,Object(Ee.g)({exam_id:kn.id,question_id:ve.question_id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},kn)});case 3:case"end":return Kt.stop()}},Nt)}))()}}),rt.abrupt("break",13);case 8:return Ce(ve.dragKey),Un(!0),rt.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:0}),rt.abrupt("break",13);case 13:case"end":return rt.stop()}},nt)}));return function(ze){return Je.apply(this,arguments)}}(),bt=function(){var nt;return t.a.createElement("aside",{ref:Pn},t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5355\u9009\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((nt=ve.question_choices)===null||nt===void 0)?void 0:nt.map(function(ze,pt){return t.a.createElement(r.a,{key:pt},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:pt,checked:ve.standard_answer.includes(pt+1),disabled:!0},at[pt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:ze.choice_text}))))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&bn.map(function(ze,pt){return t.a.createElement(o.a,{key:pt,placement:"bottom",title:ze.name},t.a.createElement("span",{onClick:function(){return gn(ze)},className:ze.icon}))})))},lt=function(){var nt,ze;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Hn,onChange:function(rt){return fn(rt)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),X.map(function(pt,rt){return t.a.createElement("div",{className:ue.a.choiceWrap,key:rt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(Et.includes(rt)?ue.a.activeAnswer:""),onClick:function(){Et.includes(rt)?Mt(function(Nt){return Nt.filter(function(St){return St!==rt})}):Mt(function(Nt){return[].concat(Object(j.a)(Nt),[rt])})}},at[rt])),t.a.createElement("div",{className:ue.a.editorWrap},ot===rt?t.a.createElement(v.a,{id:"single-question-option-".concat(rt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:pt,onChange:function(Nt){X[rt]=Nt,se(X)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return wt(rt)}},t.a.createElement(we.a,{value:pt}))),t.a.createElement(t.a.Fragment,null,rt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return se(X.filter(function(Nt,St){return St!==rt}))}})),rt<7&&rt===X.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return se([].concat(Object(j.a)(X),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Vn,onChange:function(rt){return qn(rt)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:qt,max:1e4,min:0,onChange:function(rt){Ft(rt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Ln,onChange:function(rt){Kn(rt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:xn,onChange:Jn,subId:(nt=Me.editData)===null||nt===void 0||((ze=nt.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id,knowledgeOptions:Ut,onAddKnowledgeFinish:Vt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:In,onChange:function(rt){wn(rt)}}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){en(),Un(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){nn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!un&&bt(),un&<())},Gt=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(xt)),$t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Yt=Object(i.forwardRef)(function(mt,Ge){var Ot=mt.newExercisePaper,Me=mt.dispatch,ye=mt.editData,ve=mt.cancelAdd,or=ve===void 0?function(){}:ve,en=mt.editKey,Ie=mt.setEditKey,gt=Ie===void 0?function(){}:Ie,Ce=mt.addCallback,cn=Ce===void 0?function(bt){}:Ce,hr=mt.reload,mr=hr===void 0?function(){}:hr,q=Object(i.useState)([]),O=Object(a.a)(q,2),M=O[0],X=O[1],se=Object(i.useState)(),Z=Object(a.a)(se,2),Le=Z[0],ot=Z[1],wt=Object(i.useState)([]),Lt=Object(a.a)(wt,2),ct=Lt[0],Et=Lt[1],Mt=Object(i.useState)(""),Cn=Object(a.a)(Mt,2),Yn=Cn[0],Hn=Cn[1],fn=Object(i.useState)(),Wt=Object(a.a)(fn,2),sn=Wt[0],qt=Wt[1],Ft=Object(i.useState)(!1),Qn=Object(a.a)(Ft,2),Bn=Qn[0],xn=Qn[1],Jn=Object(i.useState)([]),pn=Object(a.a)(Jn,2),Sn=pn[0],un=pn[1],Un=Object(i.useState)(1),Xn=Object(a.a)(Un,2),nr=Xn[0],Ln=Xn[1],Kn=Object(i.useState)(!1),rn=Object(a.a)(Kn,2),_n=rn[0],In=rn[1],wn=Object(i.useState)(""),Zn=Object(a.a)(wn,2),yn=Zn[0],Vn=Zn[1],qn=Object(i.useState)([]),kn=Object(a.a)(qn,2),Pn=kn[0],Mn=kn[1],Dn=Object(i.useRef)(!1),dn=function(lt){Mn([].concat(Object(j.a)(Pn),[Object(g.a)({},lt)]))},Ut=Object(w.i)();Object(i.useEffect)(function(){X(["","","",""])},[]),Object(i.useEffect)(function(){if(Dn.current)return;if(!(ye!=null&&ye.question_choices)){xn(!0),Hn(""),qt(5),X(["","","",""]),Et([]);return}Hn(ye==null?void 0:ye.question_title),qt(ye==null?void 0:ye.question_score),In(!(ye!=null&&ye.repeat_answer)),Ln(ye==null?void 0:ye.difficulty),X(ye==null?void 0:ye.question_choices.map(function(lt){return lt.choice_text}));var bt=[];ye==null||ye.standard_answer.map(function(lt,Je){bt.push(lt-1)}),Et(bt),un(ye.tag_discipline_ids),Vn(ye==null?void 0:ye.analysis)},[ye,Bn]),Object(i.useEffect)(function(){Bn&&bt();function bt(){return lt.apply(this,arguments)}function lt(){return lt=Object(te.a)(s.a.mark(function Je(){var nt,ze,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(I.I)({sub_discipline_id:(nt=Ot.editData)===null||nt===void 0||((ze=nt.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id});case 2:pt=Tt.sent,Mn(pt.tag_disciplines);case 4:case"end":return Tt.stop()}},Je)})),lt.apply(this,arguments)}},[Bn]),Object(i.useImperativeHandle)(Ge,function(){return{onSave:Vt,isEdit:Bn}}),Object(i.useEffect)(function(){var bt,lt=Ot!=null&&(bt=Ot.tagDisciplineData)!==null&&bt!==void 0&&bt.tag_disciplines&&Array.isArray(Ot.tagDisciplineData.tag_disciplines)?Ot.tagDisciplineData.tag_disciplines:[];Mn(lt)},[Ot.tagDisciplineData]);var zt=function(lt){(lt==null?void 0:lt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),xn(!1),gt(-1),Dn.current=!1,mr())},Vt=function(){var bt=Object(te.a)(s.a.mark(function lt(){var Je,nt,ze,pt,rt,Tt,Nt;return s.a.wrap(function(Kt){for(;;)switch(Kt.prev=Kt.next){case 0:if(Yn){Kt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Kt.abrupt("return",!1);case 3:if(Je=M.findIndex(function(Rt){return!Rt}),!(Je>-1)){Kt.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat($t[Je]," \u9009\u9879\u7684\u5185\u5BB9")),Kt.abrupt("return",!1);case 7:if(ct.length){Kt.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Kt.abrupt("return",!1);case 10:if(!(ct.length<1)){Kt.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Kt.abrupt("return",!1);case 13:if(nt=M.map(function(Rt,It){return{choice_text:Rt,is_answer:ct.includes(It)?1:0}}),Dn.current=!0,!ye.question_id){Kt.next=22;break}return Kt.next=18,Me({type:"newExercisePaper/editExerciseQuestion",payload:{id:Ut.id,question_id:ye.question_id,name:Yn,item_type:ct.length>1?Fe.a.Multiple:Fe.a.Single,question_score:sn,choices:nt,tag_discipline_ids:Sn,sub_discipline_id:(pt=Ot.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id,difficulty:nr,repeat_answer:!_n,analysis:yn}});case 18:ze=Kt.sent,zt(ze),Kt.next=26;break;case 22:return Kt.next=24,Me({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ye==null?void 0:ye.insert_id,id:Ut.id,name:Yn,item_type:ct.length>1?Fe.a.Multiple:Fe.a.Single,question_score:sn,choices:nt,tag_discipline_ids:Sn,sub_discipline_id:(Tt=Ot.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:nr,repeat_answer:!_n,analysis:yn}});case 24:ze=Kt.sent,zt(ze);case 26:case"end":return Kt.stop()}},lt)}));return function(){return bt.apply(this,arguments)}}(),jt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u591A\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],nn=function(){var bt=Object(te.a)(s.a.mark(function lt(Je){return s.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:if(!(en!==-1)){ze.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),ze.abrupt("return");case 3:ze.t0=Je.id,ze.next=ze.t0==="del"?6:ze.t0==="edit"?8:ze.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function rt(){return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(Ee.g)({question_id:ye.question_id,exam_id:Ut.id});case 2:Me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Ut)});case 3:case"end":return Nt.stop()}},rt)}))()}}),ze.abrupt("break",13);case 8:return gt(ye.dragKey),xn(!0),ze.abrupt("break",13);case 11:return cn({key:ye.key,insert_id:ye==null?void 0:ye.question_id,question_type:1}),ze.abrupt("break",13);case 13:case"end":return ze.stop()}},lt)}));return function(Je){return bt.apply(this,arguments)}}(),bn=function(){var lt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ye!=null&&ye.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ye.key,"\u3001\u591A\u9009\u9898"),"\uFF08",ye.question_score,"\u5206\uFF09")),ye!=null&&ye.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ye.key,"."),t.a.createElement(we.a,{value:ye.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ye.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ye.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ye==null||((lt=ye.question_choices)===null||lt===void 0)?void 0:lt.map(function(Je,nt){return t.a.createElement(r.a,{key:nt},t.a.createElement(A.a,null,t.a.createElement(C.a,{key:nt,checked:ye.standard_answer.includes(nt+1),disabled:!0},$t[nt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:Je.choice_text}))))})),t.a.createElement("div",{className:ue.a.action},!ye.hideAction&&jt.map(function(Je,nt){return t.a.createElement(o.a,{key:nt,placement:"bottom",title:Je.name},t.a.createElement("span",{onClick:function(){return nn(Je)},className:Je.icon}))})))},gn=function(){var lt,Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Yn,onChange:function(ze){return Hn(ze)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),M.map(function(nt,ze){var pt,rt;return t.a.createElement("div",{className:ue.a.choiceWrap,key:ze},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(ct.includes(ze)?ue.a.activeAnswer:""),onClick:function(){ct.includes(ze)?Et(ct.filter(function(Nt){return Nt!==ze})):Et([].concat(Object(j.a)(ct),[ze]))}},$t[ze])),t.a.createElement("div",{className:ue.a.editorWrap},Le===ze?t.a.createElement(v.a,{id:"single-question-option-".concat(ze),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:nt,onChange:function(Nt){M[ze]=Nt,X(M)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return ot(ze)}},t.a.createElement(we.a,{value:nt}))),((pt=Ot.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,ze>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return X(M.filter(function(Nt,St){return St!==ze}))}})),ze<7&&ze===M.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return X([].concat(Object(j.a)(M),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:yn,onChange:function(ze){return Vn(ze)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:sn,max:1e4,min:0,onChange:function(ze){qt(ze)}}),"\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:nr,onChange:function(ze){Ln(ze.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Sn,selectvalues:ye==null?void 0:ye.tag_discipline_ids,onChange:un,subId:(lt=Ot.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0)?void 0:Je.sub_discipline_id,knowledgeOptions:Pn,onAddKnowledgeFinish:dn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:_n,onChange:function(ze){In(ze)}}))),t.a.createElement("aside",{className:"tr"},(en!==-1||ye.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){or(),xn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){Vt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!Bn&&bn(),Bn&&gn())}),$n=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Yt),vn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ln=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.editKey,en=Ge.setEditKey,Ie=en===void 0?function(){}:en,gt=Ge.cancelAdd,Ce=gt===void 0?function(){}:gt,cn=Ge.reload,hr=cn===void 0?function(){}:cn,mr=Ge.addCallback,q=mr===void 0?function(){}:mr,O=Object(i.useState)(),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)(!1),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)([]),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(!1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(""),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useRef)(!1),yn=function(zt){Jn([].concat(Object(j.a)(xn),[Object(g.a)({},zt)]))},Vn=Object(w.i)();Object(i.useEffect)(function(){if(Zn.current)return;if(!(ve!=null&&ve.question_choices)){Mt(!0),wt(""),fn(2),se("");return}Kn(!(ve!=null&&ve.repeat_answer)),wt(ve==null?void 0:ve.question_title),fn(ve==null?void 0:ve.question_score),Un(ve==null?void 0:ve.difficulty),se(ve.standard_answer[0]+""),Ft(ve.tag_discipline_ids),wn(ve==null?void 0:ve.analysis)},[ve,Et]),Object(i.useEffect)(function(){Et&&Ut();function Ut(){return zt.apply(this,arguments)}function zt(){return zt=Object(te.a)(s.a.mark(function Vt(){var jt,nn,bn;return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(I.I)({sub_discipline_id:(jt=Me.editData)===null||jt===void 0||((nn=jt.exercise)===null||nn===void 0)?void 0:nn.sub_discipline_id});case 2:bn=bt.sent,Jn(bn.tag_disciplines);case 4:case"end":return bt.stop()}},Vt)})),zt.apply(this,arguments)}},[Et]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:kn,isEdit:Et}}),Object(i.useEffect)(function(){var Ut,zt=Me!=null&&(Ut=Me.tagDisciplineData)!==null&&Ut!==void 0&&Ut.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Jn(zt)},[Me.tagDisciplineData]);var qn=function(zt){(zt==null?void 0:zt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Mt(!1),Ie(-1),Zn.current=!1,hr())},kn=function(){var Ut=Object(te.a)(s.a.mark(function zt(){var Vt,jt,nn,bn,gn,bt;return s.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:if(ot){Je.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Je.abrupt("return",!1);case 3:if(X){Je.next=6;break}return _.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Je.abrupt("return",!1);case 6:if(Vt=[{choice_text:"\u6B63\u786E",is_answer:X==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:X==="2"?1:0}],Zn.current=!0,!ve.question_id){Je.next=15;break}return Je.next=11,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:Vn.id,question_id:ve.question_id,name:ot,item_type:Fe.a.Judge,question_score:Hn,choices:Vt,tag_discipline_ids:qt,sub_discipline_id:(nn=Me.editData)===null||nn===void 0||((bn=nn.exercise)===null||bn===void 0)?void 0:bn.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:In}});case 11:jt=Je.sent,qn(jt),Je.next=19;break;case 15:return Je.next=17,ye({type:"newExercisePaper/addExerciseQuestion",payload:{id:Vn.id,insert_id:ve==null?void 0:ve.insert_id,name:ot,item_type:Fe.a.Judge,question_score:Hn,choices:Vt,tag_discipline_ids:qt,sub_discipline_id:(gn=Me.editData)===null||gn===void 0||((bt=gn.exercise)===null||bt===void 0)?void 0:bt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:In}});case 17:jt=Je.sent,qn(jt);case 19:return Je.abrupt("return",{name:ot,choices:Vt});case 20:case"end":return Je.stop()}},zt)}));return function(){return Ut.apply(this,arguments)}}(),Pn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5224\u65AD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Mn=function(){var Ut=Object(te.a)(s.a.mark(function zt(Vt){return s.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:if(!(or!==-1)){nn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),nn.abrupt("return");case 3:nn.t0=Vt.id,nn.next=nn.t0==="del"?6:nn.t0==="edit"?8:nn.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function gn(){return s.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return lt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:Vn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Vn)});case 3:case"end":return lt.stop()}},gn)}))()}}),nn.abrupt("break",13);case 8:return Ie(ve.dragKey),Mt(!0),nn.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:2}),nn.abrupt("break",13);case 13:case"end":return nn.stop()}},zt)}));return function(Vt){return Ut.apply(this,arguments)}}(),Dn=function(){var zt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((zt=ve.question_choices)===null||zt===void 0)?void 0:zt.map(function(Vt,jt){return t.a.createElement(h.a,{key:jt,checked:ve.standard_answer.includes(jt+1),disabled:!0},vn[jt],"."," ",t.a.createElement("span",{className:"c-black font14"},Vt.choice_text))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&Pn.map(function(Vt,jt){return t.a.createElement(o.a,{key:jt,placement:"bottom",title:Vt.name},t.a.createElement("span",{onClick:function(){return Mn(Vt)},className:Vt.icon}))})))},dn=function(){var zt,Vt;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ot,onChange:function(nn){return wt(nn)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(h.a.Group,{buttonStyle:"solid",value:X,onChange:function(nn){return se(nn.target.value)}},t.a.createElement(h.a.Button,{value:"1",className:"".concat(ue.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(h.a.Button,{value:"2",className:ue.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:In,onChange:function(nn){return wn(nn)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Hn,max:1e4,min:0,onChange:function(nn){fn(nn)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:un,onChange:function(nn){Un(nn.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:qt,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Ft,subId:(zt=Me.editData)===null||zt===void 0||((Vt=zt.exercise)===null||Vt===void 0)?void 0:Vt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:yn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Ln,onChange:function(nn){Kn(nn)}}))),t.a.createElement("aside",{className:"tr"},(or!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){Ce(),Mt(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){kn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!Et&&Dn(),Et&&dn())},hn=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(ln)),Gn=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.editKey,en=Ge.setEditKey,Ie=en===void 0?function(){}:en,gt=Ge.cancelAdd,Ce=gt===void 0?function(){}:gt,cn=Ge.addCallback,hr=cn===void 0?function(){}:cn,mr=Ge.reload,q=mr===void 0?function(){}:mr,O=Object(i.useState)(""),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)([]),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)(!1),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(0),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)(!1),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)([]),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],dn=Object(i.useState)(1),Ut=Object(a.a)(dn,2),zt=Ut[0],Vt=Ut[1],jt=Object(i.useState)(!1),nn=Object(a.a)(jt,2),bn=nn[0],gn=nn[1],bt=Object(i.useRef)(!1),lt=Object(w.i)(),Je=Object(i.useState)([]),nt=Object(a.a)(Je,2),ze=nt[0],pt=nt[1],rt=function(Rn){pt([].concat(Object(j.a)(ze),[Object(g.a)({},Rn)]))};Object(i.useEffect)(function(){if(bt.current)return;if(!(ve!=null&&ve.question_title)){wn(!0),se(""),Ft(!1),Un(2),Mt([]),fn(""),Jn(!1);return}se(ve==null?void 0:ve.question_title),Ft(ve==null?void 0:ve.is_ordered),Vt(ve==null?void 0:ve.difficulty),gn(!(ve!=null&&ve.repeat_answer)),Un(ve==null?void 0:ve.question_score);var Qt=ve==null?void 0:ve.standard_answer.map(function(Rn){return Rn.answer_text});Mt(Object(j.a)(Qt)),Dn(ve.tag_discipline_ids),wt(ve==null?void 0:ve.analysis)},[ve,In]),Object(i.useEffect)(function(){Jn(!1),In&&Qt();function Qt(){return Rn.apply(this,arguments)}function Rn(){return Rn=Object(te.a)(s.a.mark(function zn(){var rr,On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,Object(I.I)({sub_discipline_id:(rr=Me.editData)===null||rr===void 0||((On=rr.exercise)===null||On===void 0)?void 0:On.sub_discipline_id});case 2:Ir=xr.sent,pt(Ir.tag_disciplines);case 4:case"end":return xr.stop()}},zn)})),Rn.apply(this,arguments)}},[In]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Nt,isEdit:In}}),Object(i.useEffect)(function(){var Qt,Rn=Me!=null&&(Qt=Me.tagDisciplineData)!==null&&Qt!==void 0&&Qt.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];pt(Rn)},[Me.tagDisciplineData]);var Tt=function(Rn){(Rn==null?void 0:Rn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),Ie(-1),bt.current=!1,q())},Nt=function(){var Qt=Object(te.a)(s.a.mark(function Rn(){var zn,rr,On,Ir,jr,xr,lr;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:if(zn=[],rr=!1,qn(!0),Et.forEach(function(Cr,Ur){zn.push({position:Ur+1,answer_text:[]}),Cr.forEach(function(Vr,Fr){zn[Ur].answer_text.push(Vr),(!Vr||!Object(ie.db)(Vr,1e4))&&(fn("".concat(Ur,"-").concat(Fr)),_.b.info(Vr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),rr=!0)})}),!rr){Er.next=7;break}return qn(!1),Er.abrupt("return",!1);case 7:if(bt.current=!0,!ve.question_id){Er.next=15;break}return Er.next=11,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:lt.id,question_id:ve.question_id,name:X,item_type:3,question_score:un,is_ordered:qt,standard_answers:zn,tag_discipline_ids:Mn,sub_discipline_id:(Ir=Me.editData)===null||Ir===void 0||((jr=Ir.exercise)===null||jr===void 0)?void 0:jr.sub_discipline_id,difficulty:zt,repeat_answer:!bn,analysis:ot}});case 11:On=Er.sent,Tt(On),Er.next=19;break;case 15:return Er.next=17,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:lt.id,name:X,item_type:3,question_score:un,is_ordered:qt,standard_answers:zn,tag_discipline_ids:Mn,sub_discipline_id:(xr=Me.editData)===null||xr===void 0||((lr=xr.exercise)===null||lr===void 0)?void 0:lr.sub_discipline_id,difficulty:zt,repeat_answer:!bn,analysis:ot}});case 17:On=Er.sent,Tt(On);case 19:return qn(!1),Er.abrupt("return",{name:X,analysis:ot,standard_answers:zn,is_ordered:qt});case 21:case"end":return Er.stop()}},Rn)}));return function(){return Qt.apply(this,arguments)}}(),St=function(Rn,zn,rr){var On=Et.slice();if(zn&&On.splice(Rn,zn),rr&&xn||!ve.question_id)for(var Ir=0;Ir1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:qt,onChange:function(On){return Ft(On.target.checked)},className:"".concat(ue.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ue.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ot,onChange:function(On){return wt(On)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:un,max:1e4,min:0,onChange:function(On){Un(On)}})," ","\u5206 \xA0"," ",!!un&&!!Ln&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(un/Ln).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:zt,onChange:function(On){Vt(On.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Mn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Dn,subId:(Rn=Me.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,knowledgeOptions:ze,onAddKnowledgeFinish:rt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:bn,onChange:function(On){gn(On)}}))),t.a.createElement("aside",{className:"tr"},(or!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){Ce(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){Nt()}},"\u4FDD\u5B58")))},gr=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u586B\u7A7A\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],er=function(){var Qt=Object(te.a)(s.a.mark(function Rn(zn){return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(!(or!==-1)){On.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),On.abrupt("return");case 3:On.t0=zn.id,On.next=On.t0==="del"?6:On.t0==="edit"?8:On.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function jr(){return s.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return lr.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:lt.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},lt)});case 3:case"end":return lr.stop()}},jr)}))()}}),On.abrupt("break",13);case 8:return Ie(ve.dragKey),wn(!0),On.abrupt("break",13);case 11:return hr({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:3}),On.abrupt("break",13);case 13:case"end":return On.stop()}},Rn)}));return function(zn){return Qt.apply(this,arguments)}}(),tr=function(){var Rn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((Rn=ve.standard_answer)===null||Rn===void 0)?void 0:Rn.map(function(zn,rr){return t.a.createElement(r.a,{key:rr,align:"middle"},t.a.createElement(A.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",zn.choice_id,"\uFF09\uFF1A"),t.a.createElement(A.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},zn.answer_text.map(function(On,Ir){return t.a.createElement(A.a,{span:24,key:Ir},t.a.createElement(T.a,{key:rr,checked:ve.standard_answer.includes(rr),disabled:!0,value:On}))}))))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&gr.map(function(zn,rr){return zn.id==="up"&&ve.key===1||zn.id==="down"&&ve.key===ve.len?null:t.a.createElement(o.a,{key:rr,placement:"bottom",title:zn.name},t.a.createElement("span",{onClick:function(){return er(zn)},className:zn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!In&&tr(),In&&on())},fr=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Gn)),vr=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.cancelAdd,en=or===void 0?function(){}:or,Ie=Ge.editKey,gt=Ge.setEditKey,Ce=gt===void 0?function(){}:gt,cn=Ge.reload,hr=cn===void 0?function(){}:cn,mr=Ge.addCallback,q=mr===void 0?function(){}:mr,O=Object(i.useState)(""),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)(""),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(!1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(i.useState)([[],[]]),_n=Object(a.a)(rn,2),In=_n[0],wn=_n[1],Zn=Object(i.useRef)(!1),yn=Object(w.i)(),Vn=Object(i.useState)([]),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=function(bn){Pn([].concat(Object(j.a)(kn),[Object(g.a)({},bn)]))};Object(i.useEffect)(function(){var nn;if(Zn.current)return;if(!(ve!=null&&ve.question_title)){Ft(!0),se(""),Mt(""),fn(10);return}Kn(!(ve!=null&&ve.repeat_answer)),se(ve==null?void 0:ve.question_title),Mt(ve==null||((nn=ve.standard_answer)===null||nn===void 0)?void 0:nn[0]),fn(ve==null?void 0:ve.question_score),Jn(ve.tag_discipline_ids),Un(ve==null?void 0:ve.difficulty),wt(ve==null?void 0:ve.analysis),wn([ve==null?void 0:ve.normal_keywords,ve==null?void 0:ve.main_keywords])},[Me.editData,qt]),Object(i.useEffect)(function(){var nn,bn=Me!=null&&(nn=Me.tagDisciplineData)!==null&&nn!==void 0&&nn.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Pn(bn)},[Me.tagDisciplineData]),Object(i.useEffect)(function(){qt&&nn();function nn(){return bn.apply(this,arguments)}function bn(){return bn=Object(te.a)(s.a.mark(function gn(){var bt,lt,Je;return s.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return ze.next=2,Object(I.I)({sub_discipline_id:(bt=Me.editData)===null||bt===void 0||((lt=bt.exercise)===null||lt===void 0)?void 0:lt.sub_discipline_id});case 2:Je=ze.sent,Pn(Je.tag_disciplines);case 4:case"end":return ze.stop()}},gn)})),bn.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:dn,isEdit:qt}});var Dn=function(bn){(bn==null?void 0:bn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ft(!1),Ce(-1),Zn.current=!1,hr())},dn=function(){var nn=Object(te.a)(s.a.mark(function bn(){var gn,bt,lt,Je,nt,ze,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(X){Tt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Tt.abrupt("return",!1);case 3:if(gn=In[0],bt=In[1],Zn.current=!0,!ve.question_id){Tt.next=13;break}return Tt.next=9,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:yn.id,question_id:ve.question_id,name:X,item_type:4,question_score:Hn,answer_texts:[Et],tag_discipline_ids:xn,sub_discipline_id:(Je=Me.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:ot,normal_keywords:gn,main_keywords:bt}});case 9:lt=Tt.sent,Dn(lt),Tt.next=17;break;case 13:return Tt.next=15,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:yn.id,name:X,item_type:4,question_score:Hn,answer_texts:[Et],tag_discipline_ids:xn,sub_discipline_id:(ze=Me.editData)===null||ze===void 0||((pt=ze.exercise)===null||pt===void 0)?void 0:pt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:ot,normal_keywords:gn,main_keywords:bt}});case 15:lt=Tt.sent,Dn(lt);case 17:return Tt.abrupt("return",{name:X,answer_texts:[Et],analysis:ot,normal_keywords:gn,main_keywords:bt});case 18:case"end":return Tt.stop()}},bn)}));return function(){return nn.apply(this,arguments)}}(),Ut=function(){var bn,gn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:X,onChange:function(lt){return se(lt)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(v.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Et,onChange:function(lt){return Mt(lt)}}),t.a.createElement(Pt.a,{value:In,onChange:wn}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ot,onChange:function(lt){return wt(lt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Hn,max:1e4,min:0,onChange:function(lt){fn(lt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:un,onChange:function(lt){Un(lt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:xn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Jn,subId:(bn=Me.editData)===null||bn===void 0||((gn=bn.exercise)===null||gn===void 0)?void 0:gn.sub_discipline_id,knowledgeOptions:kn,onAddKnowledgeFinish:Mn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(E.a,{checked:Ln,onChange:function(lt){Kn(lt)}}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){en(),Ft(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){dn()}},"\u4FDD\u5B58")))},zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7B80\u7B54\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Vt=function(){var nn=Object(te.a)(s.a.mark(function bn(gn){return s.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(!(Ie!==-1)){lt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),lt.abrupt("return");case 3:lt.t0=gn.id,lt.next=lt.t0==="del"?6:lt.t0==="up"||lt.t0==="down"?8:lt.t0==="edit"?12:lt.t0==="add"?15:17;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function nt(){return s.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:yn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},yn)});case 3:case"end":return pt.stop()}},nt)}))()}}),lt.abrupt("break",17);case 8:return lt.next=10,ye({type:"newExercisePaper/exeriseMoveUpDown",payload:{id:ve.question_id,opr:gn.id}});case 10:return ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},yn)}),lt.abrupt("break",17);case 12:return Ce(ve.dragKey),Ft(!0),lt.abrupt("break",17);case 15:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:4}),lt.abrupt("break",17);case 17:case"end":return lt.stop()}},bn)}));return function(gn){return nn.apply(this,arguments)}}(),jt=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(we.a,{value:Et||""})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&zt.map(function(bn,gn){return t.a.createElement(o.a,{key:gn,placement:"bottom",title:bn.name},t.a.createElement("span",{onClick:function(){return Vt(bn)},className:bn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!qt&&jt(),qt&&Ut())},ir=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(vr)),br=function(Ge,Ot){var Me=Ge.dispatch,ye=Ge.editData,ve=Ge.cancelAdd,or=ve===void 0?function(){}:ve,en=Ge.editKey,Ie=Ge.setEditKey,gt=Ie===void 0?function(){}:Ie,Ce=Ge.reload,cn=Ce===void 0?function(){}:Ce,hr=Object(i.useState)(""),mr=Object(a.a)(hr,2),q=mr[0],O=mr[1],M=Object(i.useState)(""),X=Object(a.a)(M,2),se=X[0],Z=X[1],Le=Object(i.useState)(""),ot=Object(a.a)(Le,2),wt=ot[0],Lt=ot[1],ct=Object(i.useState)([]),Et=Object(a.a)(ct,2),Mt=Et[0],Cn=Et[1],Yn=Object(i.useState)(),Hn=Object(a.a)(Yn,2),fn=Hn[0],Wt=Hn[1],sn=Object(i.useState)(!1),qt=Object(a.a)(sn,2),Ft=qt[0],Qn=qt[1],Bn=Object(i.useState)([]),xn=Object(a.a)(Bn,2),Jn=xn[0],pn=xn[1],Sn=Object(i.useState)(!1),un=Object(a.a)(Sn,2),Un=un[0],Xn=un[1],nr=Object(i.useState)(!1),Ln=Object(a.a)(nr,2),Kn=Ln[0],rn=Ln[1],_n=Object(w.i)(),In=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Pn;if(In.current)return;ye.edit&&(Xn(!0),Z(""),O(""),pn([])),O(ye.shixun_name),Z(ye.question_title);var Mn=[];(Pn=ye.shixun)===null||Pn===void 0||Pn.map(function(Dn){Mn.push(Dn.challenge_score)}),pn(Mn)},[ye]),Object(i.useEffect)(function(){Qn(!1)},[Un]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Zn,isEdit:Un}});var wn=function(Mn){(Mn==null?void 0:Mn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Xn(!1),gt(-1),In.current=!1,cn())},Zn=function(){var Pn=Object(te.a)(s.a.mark(function Mn(){var Dn,dn,Ut;return s.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(Dn=[],dn=!1,!dn){Vt.next=4;break}return Vt.abrupt("return",!1);case 4:if(In.current=!0,rn(!0),!ye.question_id){Vt.next=12;break}return Vt.next=9,Me({type:"newExercisePaper/editExerciseQuestion",payload:{id:_n.id,question_id:ye.question_id,name:se,shixun_name:q,shixun_id:ye.shixun_id,item_type:5,question_scores:Jn}});case 9:Ut=Vt.sent,Vt.next=15;break;case 12:return Vt.next=14,Me({type:"newExercisePaper/addExerciseQuestion",payload:{id:_n.id,insert_id:ye==null?void 0:ye.insert_id,name:se,shixun_name:q,shixun_id:ye.shixun_id,item_type:5,question_scores:Jn,is_copy:ye.is_copy}});case 14:Ut=Vt.sent;case 15:return wn(Ut),rn(!1),Vt.abrupt("return",{name:se,analysis:wt,standard_answers:Dn,is_ordered:fn});case 18:case"end":return Vt.stop()}},Mn)}));return function(){return Pn.apply(this,arguments)}}(),yn=function(){var Mn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(T.a,{defaultValue:q,onChange:function(dn){O(dn.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(v.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:se,onChange:function(dn){Z(dn)}})),t.a.createElement("div",{className:"mt20"},(Mn=ye.shixun)===null||Mn===void 0?void 0:Mn.map(function(Dn,dn){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(A.a,{flex:"1"},dn+1,".",Dn.challenge_name),t.a.createElement(A.a,null,t.a.createElement(B.a,{defaultValue:Jn[dn],onChange:function(zt){Jn[dn]=zt,pn(Jn)}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Mt.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:fn,onChange:function(dn){return Wt(dn.target.checked)},className:"".concat(ue.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ue.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(en!==-1||!(ye!=null&&ye.edit))&&t.a.createElement(p.a,{type:"default",onClick:function(){or(),Xn(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{loading:Kn,className:"ml20",type:"primary",onClick:function(){Zn()}},"\u4FDD\u5B58")))},Vn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var Pn=Object(te.a)(s.a.mark(function Mn(Dn){return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(!(en!==-1)){Ut.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ut.abrupt("return");case 3:Ut.t0=Dn.id,Ut.next=Ut.t0==="del"?6:Ut.t0==="edit"?8:Ut.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Vt(){return s.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Object(Ee.g)({question_id:ye.question_id,exam_id:_n.id});case 2:Me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},_n)});case 3:case"end":return nn.stop()}},Vt)}))()}}),Ut.abrupt("break",13);case 8:return gt(ye.dragKey),Xn(!0),Ut.abrupt("break",13);case 11:return Me({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:ye.key,insert_id:ye==null?void 0:ye.question_id,question_type:5}}}),Ut.abrupt("break",13);case 13:case"end":return Ut.stop()}},Mn)}));return function(Dn){return Pn.apply(this,arguments)}}(),kn=function(){var Mn,Dn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ye!=null&&ye.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ye.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",ye.question_score,"\u5206\uFF09")),ye!=null&&ye.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ye.key,"."),t.a.createElement(we.a,{value:ye.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ye.question_score,"\u5206\uFF09"),!!((Mn=ye.schools)!==null&&Mn!==void 0&&Mn.length)&&t.a.createElement(o.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ye.shixun_name})),t.a.createElement("div",{className:"mt30"}),(Dn=ye.shixun)===null||Dn===void 0?void 0:Dn.map(function(dn,Ut){return t.a.createElement("div",{key:Ut},"\u7B2C",Ut+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},dn.challenge_name)," ",t.a.createElement("span",{className:"ml10"},dn.challenge_score," \u5206"))}),t.a.createElement("div",{className:ue.a.action},t.a.createElement(st.a,{target:"_blank",to:"/shixuns/".concat(ye.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!ye.hideAction&&Vn.map(function(dn,Ut){return t.a.createElement(o.a,{key:Ut,placement:"bottom",title:dn.name},t.a.createElement("span",{onClick:function(){return qn(dn)},className:dn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!Un&&kn(),Un&&yn())},Rr=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(br)),Jt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ar=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.editKey,en=Ge.addCallback,Ie=en===void 0?function(){}:en,gt=Object(i.useState)([]),Ce=Object(a.a)(gt,2),cn=Ce[0],hr=Ce[1],mr=Object(i.useState)(),q=Object(a.a)(mr,2),O=q[0],M=q[1],X=Object(i.useState)([]),se=Object(a.a)(X,2),Z=se[0],Le=se[1],ot=Object(i.useState)(""),wt=Object(a.a)(ot,2),Lt=wt[0],ct=wt[1],Et=Object(i.useState)(5),Mt=Object(a.a)(Et,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)(!1),fn=Object(a.a)(Hn,2),Wt=fn[0],sn=fn[1],qt=Object(w.i)();Object(i.useEffect)(function(){hr(["","","",""])},[]),Object(i.useEffect)(function(){if(!(ve!=null&&ve.question_choices)){sn(!0),ct(""),Yn(5),hr(["","","",""]),Le([]);return}ct(ve==null?void 0:ve.question_title),Yn(ve==null?void 0:ve.question_score),hr(ve==null?void 0:ve.question_choices.map(function(Sn){return Sn.choice_text}));var pn=[];ve==null||ve.standard_answer.map(function(Sn,un){pn.push(Sn-1)}),Le(pn)},[ve]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Ft,isEdit:Wt}});var Ft=function(){var pn=Object(te.a)(s.a.mark(function Sn(){var un,Un,Xn;return s.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(Lt){Ln.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ln.abrupt("return",!1);case 3:if(un=cn.findIndex(function(Kn){return!Kn}),!(un>-1)){Ln.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Jt[un]," \u9009\u9879\u7684\u5185\u5BB9")),Ln.abrupt("return",!1);case 7:if(Z.length){Ln.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ln.abrupt("return",!1);case 10:if(!(Z.length<1)){Ln.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ln.abrupt("return",!1);case 13:if(Un=cn.map(function(Kn,rn){return{choice_text:Kn,is_answer:Z.includes(rn)?rn+1:0}}),!ve.question_id){Ln.next=20;break}return Ln.next=17,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:ve.question_id,question_title:Lt,question_type:1,question_score:Cn,question_choices:Un.map(function(Kn){return Kn.choice_text}),standard_answers:Un.filter(function(Kn){return Kn.is_answer}).map(function(Kn){return Kn.is_answer})}});case 17:Xn=Ln.sent,Ln.next=23;break;case 20:return Ln.next=22,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,categoryId:qt.categoryId,question_title:Lt,question_type:1,question_score:"5.0",question_choices:Un.map(function(Kn){return Kn.choice_text}),standard_answers:Un.filter(function(Kn){return Kn.is_answer}).map(function(Kn){return Kn.is_answer})}});case 22:Xn=Ln.sent;case 23:Xn.status===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),sn(!1),ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},qt)}));case 24:case"end":return Ln.stop()}},Sn)}));return function(){return pn.apply(this,arguments)}}(),Qn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7F16\u7A0B\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Bn=function(){var pn=Object(te.a)(s.a.mark(function Sn(un){return s.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:if(!(or!==-1)){Xn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Xn.abrupt("return");case 3:Xn.t0=un.id,Xn.next=Xn.t0==="del"?6:Xn.t0==="edit"?8:Xn.t0==="add"?10:12;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function Ln(){return s.a.wrap(function(rn){for(;;)switch(rn.prev=rn.next){case 0:return rn.next=2,Object(Ee.g)({exam_id:qt.id,question_id:ve.question_id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},qt)});case 3:case"end":return rn.stop()}},Ln)}))()}}),Xn.abrupt("break",12);case 8:return F.d.push("/problems/".concat(ve==null?void 0:ve.hack_identifier,"/edit?type=exercises&express_id=").concat(qt.id,"&question_id=").concat(ve==null?void 0:ve.question_id,"&score=").concat(ve==null?void 0:ve.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Xn.abrupt("break",12);case 10:return Ie({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:6}),Xn.abrupt("break",12);case 12:case"end":return Xn.stop()}},Sn)}));return function(un){return pn.apply(this,arguments)}}(),xn=function(){var pn=Object(te.a)(s.a.mark(function Sn(un){var Un;return s.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:return un.preventDefault(),nr.next=3,Object(I.Y)({id:ve==null?void 0:ve.hack_identifier});case 3:Un=nr.sent,Un.status===0&&Object(ie.S)("/myproblems/".concat(Un==null?void 0:Un.identifier));case 5:case"end":return nr.stop()}},Sn)}));return function(un){return pn.apply(this,arguments)}}(),Jn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},t.a.createElement(we.a,{value:ve.description||""})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&Qn.map(function(Sn,un){return t.a.createElement(o.a,{key:un,placement:"bottom",title:Sn.name},t.a.createElement("span",{onClick:function(){return Bn(Sn)},className:Sn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},Jn())},Nn=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ar)),Tn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],pr=function(Ge,Ot){var Me=Ge.newExercisePaper,ye=Ge.dispatch,ve=Ge.editData,or=Ge.cancelAdd,en=or===void 0?function(){}:or,Ie=Ge.editKey,gt=Ge.setEditKey,Ce=gt===void 0?function(){}:gt,cn=Ge.addCallback,hr=cn===void 0?function(dn){}:cn,mr=Ge.reload,q=mr===void 0?function(){}:mr,O=Object(i.useState)([]),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(!1),Le=Object(a.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(i.useState)(!0),ct=Object(a.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(i.useState)(1),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),sn=Object(a.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(w.i)(),Sn=Object(i.useRef)(null),un=Object(i.useState)(""),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)([]),Kn=Object(a.a)(Ln,2),rn=Kn[0],_n=Kn[1],In=Object(i.useRef)(!1),wn=function(Ut){Jn([].concat(Object(j.a)(xn),[Object(g.a)({},Ut)]))};Object(i.useEffect)(function(){var dn;if(In.current)return;if(!(ve!=null&&ve.question_title)){wt(!0),nr("");return}nr(ve==null?void 0:ve.question_title),Ft(!(ve!=null&&ve.repeat_answer)),fn(ve==null?void 0:ve.difficulty),se(ve.tag_discipline_ids);var Ut=ve==null||((dn=ve.sub_exercise_questions)===null||dn===void 0)?void 0:dn.map(function(zt){return Object(g.a)(Object(g.a)({},zt),{},{id:zt.question_id,name:zt.question_title,open:!1,question_score:zt.question_score,choices:zt==null?void 0:zt.question_choices.map(function(Vt){return{choice_text:Vt.choice_text,is_answer:Vt.standard_boolean?1:0}}),activeQusEditor:null})});_n(Ut)},[ve,ot]),Object(i.useEffect)(function(){ot&&dn();function dn(){return Ut.apply(this,arguments)}function Ut(){return Ut=Object(te.a)(s.a.mark(function zt(){var Vt,jt,nn;return s.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.next=2,Object(I.I)({sub_discipline_id:(Vt=Me.editData)===null||Vt===void 0||((jt=Vt.exercise)===null||jt===void 0)?void 0:jt.sub_discipline_id});case 2:nn=gn.sent,Jn(nn.tag_disciplines);case 4:case"end":return gn.stop()}},zt)})),Ut.apply(this,arguments)}},[ot]),Object(i.useEffect)(function(){var dn,Ut=Me!=null&&(dn=Me.tagDisciplineData)!==null&&dn!==void 0&&dn.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Jn(Ut)},[Me.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:yn,isEdit:ot}});var Zn=function(Ut){(Ut==null?void 0:Ut.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wt(!1),Ce(-1),In.current=!1,q())},yn=function(){var dn=Object(te.a)(s.a.mark(function Ut(){var zt,Vt,jt,nn,bn,gn,bt,lt,Je,nt,ze;return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(Xn){rt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),rt.abrupt("return",!1);case 3:if(!(rn.length===0)){rt.next=6;break}return _.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),rt.abrupt("return",!1);case 6:zt=0;case 7:if(!(zt-1)){rt.next=19;break}return _.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(zt+1,"\u5C0F\u9898").concat(Tn[nn],"\u9009\u9879\u7684\u5185\u5BB9")),rt.abrupt("return",!1);case 19:if(!(jt.choices.findIndex(function(Tt){return Tt.is_answer===1})===-1)){rt.next=22;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(zt+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),rt.abrupt("return",!1);case 22:zt++,rt.next=7;break;case 25:if(bn=rn.map(function(Tt){return{id:Tt.id>1?Tt.id:null,name:Tt.name,item_type:Fe.a.Single,choices:Tt.choices,question_score:Tt.question_score}}),In.current=!0,!ve.question_id){rt.next=34;break}return rt.next=30,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:pn.id,question_id:ve.question_id,name:Xn,item_type:Fe.a.Combine,sub_item_banks:bn,tag_discipline_ids:X,sub_discipline_id:(bt=Me.editData)===null||bt===void 0||((lt=bt.exercise)===null||lt===void 0)?void 0:lt.sub_discipline_id,difficulty:Hn,repeat_answer:!qt}});case 30:gn=rt.sent,Zn(gn),rt.next=38;break;case 34:return rt.next=36,ye({type:"newExercisePaper/addExerciseQuestion",payload:{id:pn.id,insert_id:ve==null?void 0:ve.insert_id,name:Xn,item_type:Fe.a.Combine,tag_discipline_ids:X,sub_discipline_id:(Je=Me.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,difficulty:Hn,repeat_answer:!qt,sub_item_banks:bn}});case 36:gn=rt.sent,((ze=gn)===null||ze===void 0?void 0:ze.status)===0&&(Ce(-1),_.b.success("\u4FDD\u5B58\u6210\u529F"),wt(!1),ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},pn)}));case 38:case"end":return rt.stop()}},Ut)}));return function(){return dn.apply(this,arguments)}}(),Vn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var dn=Object(te.a)(s.a.mark(function Ut(zt){return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:if(!(Ie!==-1)){jt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),jt.abrupt("return");case 3:jt.t0=zt.id,jt.next=jt.t0==="del"?6:jt.t0==="edit"?8:jt.t0==="add"?11:13;break;case 6:return K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(te.a)(s.a.mark(function bn(){return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:pn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},pn)});case 3:case"end":return bt.stop()}},bn)}))()}}),jt.abrupt("break",13);case 8:return Ce(ve.dragKey),wt(!0),jt.abrupt("break",13);case 11:return hr({key:ve.key,insert_id:ve==null?void 0:ve.question_id,item_type:Fe.a.Single}),jt.abrupt("break",13);case 13:case"end":return jt.stop()}},Ut)}));return function(zt){return dn.apply(this,arguments)}}(),kn=function(){var Ut;return t.a.createElement("aside",{ref:Sn},t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(we.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",ve==null?void 0:ve.sub_q_count,"\u5C0F\u9898\uFF0C",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(we.a,{value:ve.question_title})),t.a.createElement("div",{style:{display:Et?"block":"none"},className:ue.a.questionChoices},ve==null||((Ut=ve.sub_exercise_questions)===null||Ut===void 0)?void 0:Ut.map(function(zt,Vt){var jt;return t.a.createElement("div",{key:Vt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,".",Vt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(we.a,{value:zt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",zt.question_score,"\u5206\uFF09")),zt==null||((jt=zt.question_choices)===null||jt===void 0)?void 0:jt.map(function(nn,bn){return t.a.createElement(r.a,{key:bn},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:bn,checked:nn.standard_boolean,disabled:!0},Tn[bn],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(we.a,{value:nn.choice_text}))))}))})),t.a.createElement("div",{className:ue.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Mt(!Et)},style:{}},Et?"\u6536\u8D77":"\u5C55\u5F00"),!ve.hideAction&&Vn.map(function(zt,Vt){return t.a.createElement(o.a,{key:Vt,placement:"bottom",title:zt.name},t.a.createElement("span",{onClick:function(){return qn(zt)},className:zt.icon}))})))},Pn=function(){var Ut,zt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:ue.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xn,onChange:function(jt){return nr(jt)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",rn==null?void 0:rn.length),rn==null?void 0:rn.map(function(Vt,jt){var nn;return t.a.createElement("div",{className:ue.a.fold,key:Vt.id},t.a.createElement("div",{onClick:function(){return Dn("open",jt)},className:ue.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Vt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",jt+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(gn){gn.stopPropagation(),Dn("delete",jt)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:Vt.open?"block":"none"}},t.a.createElement(v.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vt==null?void 0:Vt.name,onChange:function(gn){return Dn("value",jt,gn)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Vt==null||((nn=Vt.choices)===null||nn===void 0)?void 0:nn.map(function(bn,gn){var bt;return t.a.createElement("div",{className:ue.a.choiceWrap,key:gn},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(bn.is_answer===1?ue.a.activeAnswer:""),onClick:function(){return Dn("answer",jt,gn)}},Tn[gn])),t.a.createElement("div",{className:ue.a.editorWrap},(Vt==null?void 0:Vt.activeQusEditor)===gn?t.a.createElement(v.a,{id:"single-question-option-".concat(gn),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:bn.choice_text,onChange:function(Je){return Dn("details",jt,Je)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return Dn("edit",jt,gn)}},t.a.createElement(we.a,{value:bn.choice_text}))),gn>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Dn("deleteQus",jt,gn)}})),gn<7&&gn===(Vt==null||((bt=Vt.choices)===null||bt===void 0)?void 0:bt.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Dn("addQus",jt)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Vt.question_score,max:1e4,min:0,onChange:function(gn){return Dn("score",jt,gn)}}),"\u5206")))}),rn.length<20&&t.a.createElement(p.a,{type:"primary",onClick:Mn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Hn,onChange:function(jt){fn(jt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:X,onChange:se,subId:(Ut=Me.editData)===null||Ut===void 0||((zt=Ut.exercise)===null||zt===void 0)?void 0:zt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:wn}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(p.a,{type:"default",onClick:function(){en(),wt(!1)}},"\u53D6\u6D88"),t.a.createElement(p.a,{className:"ml20",type:"primary",onClick:function(){yn()}},"\u4FDD\u5B58")))},Mn=function(){var Ut={id:Math.random(),item_type:"SINGLE",open:!1,name:"",choices:Array.from({length:4},function(){return{choice_text:"",is_answer:0}}),activeQusEditor:null,analysis:""};_n(rn.concat(Ut))},Dn=function(Ut,zt,Vt){var jt=Object(Ct.cloneDeep)(rn);Ut==="open"&&(jt[zt].open=!jt[zt].open),Ut==="delete"&&jt.splice(zt,1),Ut==="value"&&(jt[zt].name=Vt),Ut==="answer"&&jt[zt].choices.forEach(function(nn,bn){nn.is_answer=Vt===bn?1:0}),Ut==="edit"&&(jt[zt].activeQusEditor=Vt),Ut==="details"&&(jt[zt].choices[jt[zt].activeQusEditor].choice_text=Vt),Ut==="addQus"&&(jt[zt].choices=jt[zt].choices.concat({choice_text:"",is_answer:0})),Ut==="deleteQus"&&(jt[zt].choices=jt[zt].choices.filter(function(nn,bn){return bn!==Vt})),Ut==="analysis"&&(jt[zt].analysis=Vt),Ut==="score"&&(jt[zt].question_score=Vt),_n(jt)};return t.a.createElement("section",{className:ue.a.wrap},!ot&&kn(),ot&&Pn())},_r=Object(F.a)(function(mt){var Ge=mt.newExercisePaper;return{newExercisePaper:Ge}},null,null,{forwardRef:!0})(Object(i.forwardRef)(pr)),Pr=function(Ge){var Ot=Ge.data,Me=Ge.isDragDisabled,ye=Me===void 0?!1:Me,ve=Ge.editorProps,or=ve===void 0?{}:ve,en=Ge.onDragEnd,Ie=en===void 0?function(){}:en,gt=Ge.dispatch,Ce=Ge.markBtnVisible,cn=Ce===void 0?!1:Ce,hr=Ge.batchScore,mr=hr===void 0?[]:hr,q=Ge.reload,O=q===void 0?function(){}:q,M=Ge.inNewPaperLibrary,X=M===void 0?!1:M,se=Object(i.useRef)(),Z=Object(w.i)(),Le=function(){var Wt,sn,qt,Ft,Qn,Bn,xn,Jn,pn,Sn,un,Un,Xn,nr,Ln,Kn,rn=[{name:"\u5355\u9009\u9898",type:0,count:Ot==null||((Wt=Ot.exercise_types)===null||Wt===void 0)?void 0:Wt.q_singles,score:Ot==null||((sn=Ot.exercise_types)===null||sn===void 0)?void 0:sn.q_singles_scores,items:[]},{name:"\u591A\u9009\u9898",type:1,count:Ot==null||((qt=Ot.exercise_types)===null||qt===void 0)?void 0:qt.q_doubles,score:Ot==null||((Ft=Ot.exercise_types)===null||Ft===void 0)?void 0:Ft.q_doubles_scores,items:[]},{name:"\u5224\u65AD\u9898",type:2,count:Ot==null||((Qn=Ot.exercise_types)===null||Qn===void 0)?void 0:Qn.q_judges,score:Ot==null||((Bn=Ot.exercise_types)===null||Bn===void 0)?void 0:Bn.q_judges_scores,items:[]},{name:"\u586B\u7A7A\u9898",type:3,count:Ot==null||((xn=Ot.exercise_types)===null||xn===void 0)?void 0:xn.q_nulls,score:Ot==null||((Jn=Ot.exercise_types)===null||Jn===void 0)?void 0:Jn.q_nulls_scores,items:[]},{name:"\u7B80\u7B54\u9898",type:4,count:Ot==null||((pn=Ot.exercise_types)===null||pn===void 0)?void 0:pn.q_mains,score:Ot==null||((Sn=Ot.exercise_types)===null||Sn===void 0)?void 0:Sn.q_mains_scores,items:[]},{name:"\u5B9E\u8BAD\u9898",type:5,count:Ot==null||((un=Ot.exercise_types)===null||un===void 0)?void 0:un.q_shixuns,score:Ot==null||((Un=Ot.exercise_types)===null||Un===void 0)?void 0:Un.q_shixuns_scores,items:[]},{name:"\u7F16\u7A0B\u9898",type:6,count:Ot==null||((Xn=Ot.exercise_types)===null||Xn===void 0)?void 0:Xn.q_pros,score:Ot==null||((nr=Ot.exercise_types)===null||nr===void 0)?void 0:nr.q_pros_scores,items:[]},{name:"\u7EC4\u5408\u9898",type:7,count:Ot==null||((Ln=Ot.exercise_types)===null||Ln===void 0)?void 0:Ln.q_combinations,score:Ot==null||((Kn=Ot.exercise_types)===null||Kn===void 0)?void 0:Kn.q_combination_scores,items:[]}];return rn},ot=function(Wt,sn,qt){var Ft=Array.from(Wt),Qn=Ft.splice(sn,1),Bn=Object(a.a)(Qn,1),xn=Bn[0];return Ft.splice(qt,0,xn),Ft},wt=function(Wt,sn,qt){if(!Wt.destination)return;var Ft=ot(sn,Wt.source.index,Wt.destination.index);X?Ie(Wt,Ft,qt):Ie(Ft,qt)},Lt=function(Wt){gt({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:Wt}})},ct=function(Wt,sn){if(sn===0)return X?t.a.createElement(Gt,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(yt,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===1)return X?t.a.createElement($n,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(je,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===2)return X?t.a.createElement(hn,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(_e,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===3)return X?t.a.createElement(fr,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(be,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===4)return X?t.a.createElement(ir,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(an,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===5)return X?t.a.createElement(Rr,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(Be,Object(m.a)({reload:O,editData:Wt},Wt));if(sn===6)return X?t.a.createElement(Nn,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(Ze,Object(m.a)({editData:Wt},Wt));if(sn===7)return X?t.a.createElement(_r,Object(m.a)({reload:O,editData:Wt},Wt)):t.a.createElement(ft,Object(m.a)({reload:O,editData:Wt},Wt))},Et=function(Wt,sn,qt){return t.a.createElement(He.a,{onDragEnd:function(Qn){return wt(Qn,Wt,sn)}},t.a.createElement(He.c,{droppableId:"droppable"},function(Ft,Qn){return t.a.createElement("div",Object(m.a)({ref:Ft.innerRef},Ft.droppableProps,{style:{width:"100%"}}),Wt==null?void 0:Wt.map(function(Bn,xn){var Jn,pn=Object(g.a)(Object(g.a)({},Bn),{},{key:xn+1,hideAction:!0,isPreview:!0,dragKey:sn+"-"+xn},or);return t.a.createElement(He.b,{key:pn==null?void 0:pn.question_id,draggableId:pn==null||((Jn=pn.question_id)===null||Jn===void 0)?void 0:Jn.toString(),index:xn,isDragDisabled:ye},function(Sn,un){return t.a.createElement("aside",Object(m.a)({ref:Sn.innerRef},Sn.draggableProps,Sn.dragHandleProps),t.a.createElement("div",{className:Ue.a.posWarp,id:pn.dragKey},ct(pn,sn),cn&&t.a.createElement(r.a,{className:Ue.a.markWrongBtnWrapper},t.a.createElement(p.a,{onClick:function(){return Lt({value:pn,type:sn})}},pn!=null&&pn.is_wrong?"\u53D6\u6D88\u6807\u8BB0\u9519\u9898":"\u6807\u8BB0\u9519\u9898")),t.a.createElement($.a,null),!ye&&t.a.createElement("div",{className:Ue.a.pos},t.a.createElement("div",{className:Ue.a.tips},"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u8BD5\u9898\u663E\u793A\u987A\u5E8F"))))})}))}))},Mt=function(Wt){var sn=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],qt=["","\u5341","\u767E","\u5343","\u4E07"];Wt=parseInt(Wt);var Ft=function(Jn){for(var pn=Jn.toString().split("").reverse(),Sn="",un=0;un0&&pn[un]==0&&pn[un-1]==0?"":sn[pn[un]]+(pn[un]==0?qt[0]:qt[un]))+Sn;return Sn},Qn=Math.floor(Wt/1e4),Bn=Wt%1e4;return Bn.toString().length<4&&(Bn="0"+Bn),Qn?Ft(Qn)+"\u4E07"+Ft(Bn):Ft(Wt)},Cn=function(Wt){var sn={\u5355\u9009\u9898:2,\u591A\u9009\u9898:5,\u586B\u7A7A\u9898:2,\u5224\u65AD\u9898:2,\u7B80\u7B54\u9898:10,\u7F16\u7A0B\u9898:10,\u5B9E\u8BAD\u9898:5,\u7EC4\u5408\u9898:10};return sn[Wt]||0},Yn=function(Wt,sn){se.current=Cn(sn),K.a.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:t.a.createElement("div",{className:""},t.a.createElement("span",null,sn==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":sn,"\uFF1A"),t.a.createElement(B.a,{min:1,defaultValue:se.current,onChange:function(Ft){se.current=Ft}}),t.a.createElement("span",{className:"ml5"},"\u5206/\u9898"),t.a.createElement("br",null),sn==="\u586B\u7A7A\u9898"&&t.a.createElement("div",{style:{color:"rgb(255, 0, 0)"}},"\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qt=Object(te.a)(s.a.mark(function Qn(){var Bn,xn;return s.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:if(!X){pn.next=6;break}return pn.next=3,Object(Ee.t)(Z.id,{question_type:Wt,score:se.current});case 3:return Bn=pn.sent,Bn.status===0&&O(),pn.abrupt("return");case 6:return pn.next=8,Object(ge.a)("/api/exercises/".concat(Z.categoryId,"/batch_set_score.json"),{method:"post",body:{question_type:Wt,score:se.current}});case 8:xn=pn.sent,xn.status!==-1&&O();case 10:case"end":return pn.stop()}},Qn)}));function Ft(){return qt.apply(this,arguments)}return Ft}()})},Hn=function(){var Wt,sn=Le();Ot==null||((Wt=Ot.exercise_questions)===null||Wt===void 0)||Wt.forEach(function(Ft,Qn){if(Ft.question_type===0){var Bn,xn;(Bn=sn[Ft.question_type])===null||Bn===void 0||((xn=Bn.items)===null||xn===void 0)||xn.push(Ft)}if(Ft.question_type===1){var Jn,pn;(Jn=sn[Ft.question_type])===null||Jn===void 0||((pn=Jn.items)===null||pn===void 0)||pn.push(Ft)}if(Ft.question_type===2){var Sn,un;(Sn=sn[Ft.question_type])===null||Sn===void 0||((un=Sn.items)===null||un===void 0)||un.push(Ft)}if(Ft.question_type===3){var Un,Xn;(Un=sn[Ft.question_type])===null||Un===void 0||((Xn=Un.items)===null||Xn===void 0)||Xn.push(Ft)}if(Ft.question_type===4){var nr,Ln;(nr=sn[Ft.question_type])===null||nr===void 0||((Ln=nr.items)===null||Ln===void 0)||Ln.push(Ft)}if(Ft.question_type===5){var Kn,rn;(Kn=sn[Ft.question_type])===null||Kn===void 0||((rn=Kn.items)===null||rn===void 0)||rn.push(Ft)}if(Ft.question_type===6){var _n,In;(_n=sn[Ft.question_type])===null||_n===void 0||((In=_n.items)===null||In===void 0)||In.push(Ft)}if(Ft.question_type===7){var wn,Zn;(wn=sn[Ft.question_type])===null||wn===void 0||((Zn=wn.items)===null||Zn===void 0)||Zn.push(Ft)}});var qt=Ot==null?void 0:Ot.map(function(Ft,Qn){return t.a.createElement(t.a.Fragment,{key:Qn},t.a.createElement("div",{className:"pl20"},t.a.createElement("span",{className:"font16 c-light-primary"},Mt(Qn+1),"\u3001",Ft.name),t.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",Ft.count,"\u9898",(Ft==null?void 0:Ft.question_type)===7?"\uFF0C\u5305\u542B".concat(Ft.sub_count,"\u5C0F\u9898"):"","\uFF1B\u5171",Ft.score,"\u5206\uFF09"),(mr==null?void 0:mr.includes(Ft==null?void 0:Ft.name))&&t.a.createElement(p.a,{onClick:function(){return Yn(Ft==null?void 0:Ft.question_type,Ft==null?void 0:Ft.name)},style:{float:"right"},type:"primary",ghost:!0},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206")),Et(Ft.items,Ft==null?void 0:Ft.question_type,Ft==null?void 0:Ft.name))});return qt};return t.a.createElement("div",null," ",Hn()," ")},yr=Ae.a=Object(F.a)()(Pr)},LdHM:function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return o}),U.d(Ae,"a",function(){return T});var te=U("1OyB"),Q=U("vuIU"),B=U("Ji7U"),J=U("LK+K"),K=U("q1tI"),N=U("rePB"),$=U("Ff2n"),z=U("ODXe"),r=U("4IlW"),D=U("bX4T"),p=U("YrtM"),g=U("TSYQ"),m=U.n(g),a=U("+nKL"),d=U("8OUc"),s=function(H,Y){var ie=H.prefixCls,le=H.id,he=H.flattenOptions,we=H.childrenAsData,Pe=H.values,xe=H.searchValue,Oe=H.multiple,pe=H.defaultActiveFirstOption,be=H.height,ne=H.itemHeight,fe=H.notFoundContent,_e=H.open,ke=H.menuItemSelectedIcon,qe=H.virtual,je=H.onSelect,st=H.onToggleOpen,vt=H.onActiveValue,Re=H.onScroll,Be=H.onMouseEnter,Ye="".concat(ie,"-item"),Ke=Object(p.a)(function(){return he},[_e,he],function(ft,He){return He[0]&&ft[1]!==He[1]}),yt=K.useRef(null),Pt=function(He){He.preventDefault()},Ht=function(He){yt.current&&yt.current.scrollTo({index:He})},Xt=function(He){for(var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ue=Ke.length,ge=0;ge1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(v).map(function(Y,ie){if(!K.isValidElement(Y)||!Y.type)return null;var le=Y.type.isSelectOptGroup,he=Y.key,we=Y.props,Pe=we.children,xe=Object($.a)(we,["children"]);return H||!le?P(Y):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(he===null?ie:he,"__"),label:he},xe),{},{options:E(Pe)})}).filter(function(Y){return Y})}var b=U("2Qr1"),h=U("qNPg"),f=U("U8pU"),C=U("Kwbf"),x=U("WKfj");function _(v){var H=v.mode,Y=v.options,ie=v.children,le=v.backfill,he=v.allowClear,we=v.placeholder,Pe=v.getInputElement,xe=v.showSearch,Oe=v.onSearch,pe=v.defaultOpen,be=v.autoFocus,ne=v.labelInValue,fe=v.value,_e=v.inputValue,ke=v.optionLabelProp,qe=H==="multiple"||H==="tags",je=xe!==void 0?xe:qe||H==="combobox",st=Y||E(ie);if(Object(C.a)(H!=="tags"||st.every(function(Ye){return!Ye.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var vt=st.some(function(Ye){return Ye.options?Ye.options.some(function(Ke){return typeof("value"in Ke?Ke.value:Ke.key)=="number"}):typeof("value"in Ye?Ye.value:Ye.key)=="number"});Object(C.a)(!vt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(H!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(H==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(C.a)(H==="combobox"||!Pe,"`getInputElement` only work with `combobox` mode."),Object(C.b)(H!=="combobox"||!Pe||!he||!we,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!je&&H!=="combobox"&&H!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!pe||be,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var Re=Object(x.d)(fe);Object(C.a)(!ne||Re.every(function(Ye){return Object(f.a)(Ye)==="object"&&("key"in Ye||"value"in Ye)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!qe||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Be=null;Object(A.a)(ie).some(function(Ye){if(!K.isValidElement(Ye)||!Ye.type)return!1;var Ke=Ye.type;if(Ke.isSelectOption)return!1;if(Ke.isSelectOptGroup){var yt=Object(A.a)(Ye.props.children).every(function(Pt){return!K.isValidElement(Pt)||!Ye.type||Pt.type.isSelectOption?!0:(Be=Pt.type,!1)});return!yt}return Be=Ke,!0}),Be&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Be.displayName||Be.name||Be,"`.")),Object(C.a)(_e===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var j=_,W=Object(h.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:E,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:j,fillOptionsWithMissingValue:b.a}),w=function(v){Object(B.a)(Y,v);var H=Object(J.a)(Y);function Y(){var ie;return Object(te.a)(this,Y),ie=H.apply(this,arguments),ie.selectRef=K.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(Q.a)(Y,[{key:"render",value:function(){return K.createElement(W,Object.assign({ref:this.selectRef},this.props))}}]),Y}(K.Component);w.Option=o,w.OptGroup=T;var F=w,I=Ae.c=F},M8RZ:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return r});var te=U("fWQN"),Q=U("mtLc"),B=U("yKVA"),J=U("879j"),K=U("q1tI"),N=U.n(K),$=U("i8i4"),z=U.n($),r=function(D){Object(B.a)(g,D);var p=Object(J.a)(g);function g(m){var a;Object(te.a)(this,g),a=p.call(this,m);var d=window.document;return a.node=d.createElement("div"),d.body.appendChild(a.node),a}return Object(Q.a)(g,[{key:"render",value:function(){var a=this.props.children;return Object($.createPortal)(a,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(N.a.Component)},MI8n:function(kt,Ae,U){"use strict";U.d(Ae,"c",function(){return K}),U.d(Ae,"b",function(){return r}),U.d(Ae,"e",function(){return D}),U.d(Ae,"a",function(){return p}),U.d(Ae,"d",function(){return g}),U.d(Ae,"f",function(){return m});var te=U("/cxE"),Q=U("pmY6"),B=U("24hK"),J=U("5Y4S"),K;(function(a){a.None=()=>Q.a.None;function d(_){return(j,W=null,w)=>{let F=!1,I;return I=_(v=>F?void 0:(I?I.dispose():F=!0,j.call(W,v)),null,w),F&&I.dispose(),I}}a.once=d;function s(_,j){return T((W,w=null,F)=>_(I=>W.call(w,j(I)),null,F))}a.map=s;function i(_,j){return T((W,w=null,F)=>_(I=>{j(I),W.call(w,I)},null,F))}a.forEach=i;function t(_,j){return T((W,w=null,F)=>_(I=>j(I)&&W.call(w,I),null,F))}a.filter=t;function u(_){return _}a.signal=u;function o(..._){return(j,W=null,w)=>Object(Q.e)(..._.map(F=>F(I=>j.call(W,I),null,w)))}a.any=o;function R(_,j,W){let w=W;return s(_,F=>(w=j(w,F),w))}a.reduce=R;function T(_){let j;const W=new r({onFirstListenerAdd(){j=_(W.fire,W)},onLastListenerRemove(){j.dispose()}});return W.event}function S(_,j,W=100,w=!1,F){let I,v,H,Y=0;const ie=new r({leakWarningThreshold:F,onFirstListenerAdd(){I=_(le=>{Y++,v=j(v,le),w&&!H&&(ie.fire(v),v=void 0),clearTimeout(H),H=setTimeout(()=>{const he=v;v=void 0,H=void 0,(!w||Y>1)&&ie.fire(he),Y=0},W)})},onLastListenerRemove(){I.dispose()}});return ie.event}a.debounce=S;function A(_,j=(W,w)=>W===w){let W=!0,w;return t(_,F=>{const I=W||!j(F,w);return W=!1,w=F,I})}a.latch=A;function P(_,j){return[a.filter(_,j),a.filter(_,W=>!j(W))]}a.split=P;function E(_,j=!1,W=[]){let w=W.slice(),F=_(H=>{w?w.push(H):v.fire(H)});const I=()=>{w&&w.forEach(H=>v.fire(H)),w=null},v=new r({onFirstListenerAdd(){F||(F=_(H=>v.fire(H)))},onFirstListenerDidAdd(){w&&(j?setTimeout(I):I())},onLastListenerRemove(){F&&F.dispose(),F=null}});return v.event}a.buffer=E;class b{constructor(_){this.event=_}map(_){return new b(s(this.event,_))}forEach(_){return new b(i(this.event,_))}filter(_){return new b(t(this.event,_))}reduce(_,j){return new b(R(this.event,_,j))}latch(){return new b(A(this.event))}debounce(_,j=100,W=!1,w){return new b(S(this.event,_,j,W,w))}on(_,j,W){return this.event(_,j,W)}once(_,j,W){return d(this.event)(_,j,W)}}function h(_){return new b(_)}a.chain=h;function f(_,j,W=w=>w){const w=(...H)=>v.fire(W(...H)),F=()=>_.on(j,w),I=()=>_.removeListener(j,w),v=new r({onFirstListenerAdd:F,onLastListenerRemove:I});return v.event}a.fromNodeEventEmitter=f;function C(_,j,W=w=>w){const w=(...H)=>v.fire(W(...H)),F=()=>_.addEventListener(j,w),I=()=>_.removeEventListener(j,w),v=new r({onFirstListenerAdd:F,onLastListenerRemove:I});return v.event}a.fromDOMEventEmitter=C;function x(_){return new Promise(j=>d(_)(j))}a.toPromise=x})(K||(K={}));class N{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${N._idPool++}`}start(a){this._stopWatch=new J.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}N._idPool=0;let $=-1;class z{constructor(a,d=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=d,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let d=$;if(typeof this.customThreshold=="number"&&(d=this.customThreshold),d<=0||a{const t=this._stacks.get(s)||0;this._stacks.set(s,t-1)}}}class r{constructor(a){var d;this._disposed=!1,this._options=a,this._leakageMon=$>0?new z(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((d=this._options)===null||d===void 0?void 0:d._profName)?new N(this._options._profName):void 0}get event(){return this._event||(this._event=(a,d,s)=>{var i;this._listeners||(this._listeners=new B.a);const t=this._listeners.isEmpty();t&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const u=this._listeners.push(d?[a,d]:a);t&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,d);const o=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),R=Object(Q.i)(()=>{if(o&&o(),!this._disposed&&(u(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return s instanceof Q.b?s.add(R):Array.isArray(s)&&s.push(R),R}),this._event}fire(a){var d,s;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new B.a);for(let i of this._listeners)this._deliveryQueue.push([i,a]);for((d=this._perfMon)===null||d===void 0||d.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,t]=this._deliveryQueue.shift();try{typeof i=="function"?i.call(void 0,t):i[0].call(i[1],t)}catch(u){Object(te.f)(u)}}(s=this._perfMon)===null||s===void 0||s.stop()}}dispose(){var a,d,s,i,t;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(d=this._deliveryQueue)===null||d===void 0||d.clear(),(i=(s=this._options)===null||s===void 0?void 0:s.onLastListenerRemove)===null||i===void 0||i.call(s),(t=this._leakageMon)===null||t===void 0||t.dispose())}}class D extends r{constructor(a){super(a);this._isPaused=0,this._eventQueue=new B.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class p extends D{constructor(a){var d;super(a);this._delay=(d=a.delay)!==null&&d!==void 0?d:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class g{constructor(){this.buffers=[]}wrapEvent(a){return(d,s,i)=>a(t=>{const u=this.buffers[this.buffers.length-1];u?u.push(()=>d.call(s,t)):d.call(s,t)},void 0,i)}bufferEvents(a){const d=[];this.buffers.push(d);const s=a();return this.buffers.pop(),d.forEach(i=>i()),s}}class m{constructor(){this.listening=!1,this.inputEvent=K.None,this.inputEventListener=Q.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(kt,Ae,U){"use strict";(function(te,Q){U.d(Ae,"b",function(){return s}),U.d(Ae,"i",function(){return o}),U.d(Ae,"f",function(){return R}),U.d(Ae,"d",function(){return T}),U.d(Ae,"g",function(){return S}),U.d(Ae,"h",function(){return A}),U.d(Ae,"c",function(){return P}),U.d(Ae,"k",function(){return E}),U.d(Ae,"j",function(){return b}),U.d(Ae,"a",function(){return h}),U.d(Ae,"e",function(){return x});var B;const J="en";let K=!1,N=!1,$=!1,z=!1,r=!1,D=!1,p=!1,g,m=J,a,d;const s=typeof self=="object"?self:typeof te=="object"?te:{};let i;typeof s.vscode!="undefined"&&typeof s.vscode.process!="undefined"?i=s.vscode.process:typeof Q!="undefined"&&(i=Q);const t=typeof((B=i==null?void 0:i.versions)===null||B===void 0?void 0:B.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!t)d=navigator.userAgent,K=d.indexOf("Windows")>=0,N=d.indexOf("Macintosh")>=0,p=(d.indexOf("Macintosh")>=0||d.indexOf("iPad")>=0||d.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,$=d.indexOf("Linux")>=0,D=!0,g=navigator.language,m=g;else if(typeof i=="object"){K=i.platform==="win32",N=i.platform==="darwin",$=i.platform==="linux",z=$&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,g=J,m=J;const _=i.env.VSCODE_NLS_CONFIG;if(_)try{const j=JSON.parse(_),W=j.availableLanguages["*"];g=j.locale,m=W||J,a=j._translationsConfigFile}catch(j){}r=!0}else console.error("Unable to resolve platform.");let u=0;N?u=1:K?u=3:$&&(u=2);const o=K,R=N,T=$,S=r,A=D,P=p,E=d,b=function(){if(s.setImmediate)return s.setImmediate.bind(s);if(typeof s.postMessage=="function"&&!s.importScripts){let W=[];s.addEventListener("message",F=>{if(F.data&&F.data.vscodeSetImmediateId)for(let I=0,v=W.length;I{const I=++w;W.push({id:I,callback:F}),s.postMessage({vscodeSetImmediateId:I},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const j=Promise.resolve();return W=>j.then(W)}(),h=N||p?2:K?1:3;let f=!0,C=!1;function x(){if(!C){C=!0;const _=new Uint8Array(2);_[0]=1,_[1]=2;const j=new Uint16Array(_.buffer);f=j[0]===(2<<8)+1}return f}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(kt,Ae,U){"use strict";U.d(Ae,"C",function(){return te}),U.d(Ae,"v",function(){return B}),U.d(Ae,"s",function(){return J}),U.d(Ae,"t",function(){return K}),U.d(Ae,"U",function(){return N}),U.d(Ae,"J",function(){return $}),U.d(Ae,"O",function(){return z}),U.d(Ae,"p",function(){return r}),U.d(Ae,"T",function(){return D}),U.d(Ae,"q",function(){return p}),U.d(Ae,"N",function(){return g}),U.d(Ae,"M",function(){return m}),U.d(Ae,"Q",function(){return a}),U.d(Ae,"u",function(){return d}),U.d(Ae,"x",function(){return s}),U.d(Ae,"I",function(){return i}),U.d(Ae,"f",function(){return t}),U.d(Ae,"h",function(){return u}),U.d(Ae,"g",function(){return o}),U.d(Ae,"i",function(){return R}),U.d(Ae,"G",function(){return T}),U.d(Ae,"H",function(){return S}),U.d(Ae,"r",function(){return A}),U.d(Ae,"R",function(){return P}),U.d(Ae,"d",function(){return E}),U.d(Ae,"e",function(){return b}),U.d(Ae,"E",function(){return h}),U.d(Ae,"F",function(){return f}),U.d(Ae,"j",function(){return C}),U.d(Ae,"z",function(){return x}),U.d(Ae,"K",function(){return j}),U.d(Ae,"L",function(){return W}),U.d(Ae,"m",function(){return F}),U.d(Ae,"k",function(){return v}),U.d(Ae,"A",function(){return Y}),U.d(Ae,"a",function(){return ie}),U.d(Ae,"n",function(){return le}),U.d(Ae,"l",function(){return he}),U.d(Ae,"D",function(){return we}),U.d(Ae,"B",function(){return Pe}),U.d(Ae,"b",function(){return xe}),U.d(Ae,"S",function(){return Oe}),U.d(Ae,"o",function(){return pe}),U.d(Ae,"P",function(){return be}),U.d(Ae,"w",function(){return ne}),U.d(Ae,"c",function(){return fe}),U.d(Ae,"y",function(){return qe});function te(Re){return!Re||typeof Re!="string"?!0:Re.trim().length===0}const Q=/{(\d+)}/g;function B(Re,...Be){return Be.length===0?Re:Re.replace(Q,function(Ye,Ke){const yt=parseInt(Ke,10);return isNaN(yt)||yt<0||yt>=Be.length?Ye:Be[yt]})}function J(Re){return Re.replace(/[<>&]/g,function(Be){switch(Be){case"<":return"<";case">":return">";case"&":return"&";default:return Be}})}function K(Re){return Re.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function N(Re,Be=" "){const Ye=$(Re,Be);return z(Ye,Be)}function $(Re,Be){if(!Re||!Be)return Re;const Ye=Be.length;if(Ye===0||Re.length===0)return Re;let Ke=0;for(;Re.indexOf(Be,Ke)===Ke;)Ke=Ke+Ye;return Re.substring(Ke)}function z(Re,Be){if(!Re||!Be)return Re;const Ye=Be.length,Ke=Re.length;if(Ye===0||Ke===0)return Re;let yt=Ke,Pt=-1;for(;!(Pt=Re.lastIndexOf(Be,yt-1),Pt===-1||Pt+Ye!==yt);){if(Pt===0)return"";yt=Pt}return Re.substring(0,yt)}function r(Re){return Re.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(Re){return Re.replace(/\*/g,"")}function p(Re,Be,Ye={}){if(!Re)throw new Error("Cannot create regex from empty string");Be||(Re=K(Re)),Ye.wholeWord&&(/\B/.test(Re.charAt(0))||(Re="\\b"+Re),/\B/.test(Re.charAt(Re.length-1))||(Re=Re+"\\b"));let Ke="";return Ye.global&&(Ke+="g"),Ye.matchCase||(Ke+="i"),Ye.multiline&&(Ke+="m"),Ye.unicode&&(Ke+="u"),new RegExp(Re,Ke)}function g(Re){if(Re.source==="^"||Re.source==="^$"||Re.source==="$"||Re.source==="^\\s*$")return!1;const Be=Re.exec("");return!!(Be&&Re.lastIndex===0)}function m(Re){return(Re.global?"g":"")+(Re.ignoreCase?"i":"")+(Re.multiline?"m":"")+(Re.unicode?"u":"")}function a(Re){return Re.split(/\r\n|\r|\n/)}function d(Re){for(let Be=0,Ye=Re.length;Be=0;Ye--){const Ke=Re.charCodeAt(Ye);if(Ke!==32&&Ke!==9)return Ye}return-1}function t(Re,Be){return ReBe?1:0}function u(Re,Be,Ye=0,Ke=Re.length,yt=0,Pt=Be.length){for(;Yetn)return 1}const Ht=Ke-Ye,Xt=Pt-yt;return HtXt?1:0}function o(Re,Be){return R(Re,Be,0,Re.length,0,Be.length)}function R(Re,Be,Ye=0,Ke=Re.length,yt=0,Pt=Be.length){for(;Ye=128||tn>=128)return u(Re.toLowerCase(),Be.toLowerCase(),Ye,Ke,yt,Pt);T(an)&&(an-=32),T(tn)&&(tn-=32);const et=an-tn;if(et===0)continue;return et}const Ht=Ke-Ye,Xt=Pt-yt;return HtXt?1:0}function T(Re){return Re>=97&&Re<=122}function S(Re){return Re>=65&&Re<=90}function A(Re,Be){return Re.length===Be.length&&R(Re,Be)===0}function P(Re,Be){const Ye=Be.length;return Be.length>Re.length?!1:R(Re,Be,0,Ye)===0}function E(Re,Be){let Ye,Ke=Math.min(Re.length,Be.length);for(Ye=0;Ye1){const Ke=Re.charCodeAt(Be-2);if(h(Ke))return C(Ke,Ye)}return Ye}function j(Re,Be){const Ye=_e.getInstance(),Ke=Be,yt=Re.length,Pt=x(Re,yt,Be);Be+=Pt>=65536?2:1;let Ht=Ye.getGraphemeBreakType(Pt);for(;Be=65536?2:1,Ht=an}return Be-Ke}function W(Re,Be){const Ye=_e.getInstance(),Ke=Be,yt=_(Re,Be);Be-=yt>=65536?2:1;let Pt=Ye.getGraphemeBreakType(yt);for(;Be>0;){const Ht=_(Re,Be),Xt=Ye.getGraphemeBreakType(Ht);if(fe(Xt,Pt))break;Be-=Ht>=65536?2:1,Pt=Xt}return Ke-Be}const w=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function F(Re){return w.test(Re)}const I=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function v(Re){return I.test(Re)}const H=/^[\t\n\r\x20-\x7E]*$/;function Y(Re){return H.test(Re)}const ie=/[\u2028\u2029]/;function le(Re){return ie.test(Re)}function he(Re){for(let Be=0,Ye=Re.length;Be=11904&&Re<=55215||Re>=63744&&Re<=64255||Re>=65281&&Re<=65374}function Pe(Re){return Re>=127462&&Re<=127487||Re===8986||Re===8987||Re===9200||Re===9203||Re>=9728&&Re<=10175||Re===11088||Re===11093||Re>=127744&&Re<=128591||Re>=128640&&Re<=128764||Re>=128992&&Re<=129003||Re>=129280&&Re<=129535||Re>=129648&&Re<=129750}const xe=String.fromCharCode(65279);function Oe(Re){return!!(Re&&Re.length>0&&Re.charCodeAt(0)===65279)}function pe(Re,Be=!1){return Re?(Be&&(Re=Re.replace(/\\./g,"")),Re.toLowerCase()!==Re):!1}function be(Re){const Be=90-65+1;return Re=Re%(2*Be),ReBe[3*Ke+1])Ke=2*Ke+1;else return Be[3*Ke+2];return 0}}_e._INSTANCE=null;function ke(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function qe(Re,Be){if(Re===0)return 0;const Ye=je(Re,Be);if(Ye!==void 0)return Ye;const Ke=_(Be,Re);return Re-=st(Ke),Re}function je(Re,Be){let Ye=_(Be,Re);for(Re-=st(Ye);vt(Ye)||Ye===65039||Ye===8419;){if(Re===0)return;Ye=_(Be,Re),Re-=st(Ye)}if(!Pe(Ye))return;if(Re>=0){const Ke=_(Be,Re);Ke===8205&&(Re-=st(Ke))}return Re}function st(Re){return Re>=65536?2:1}function vt(Re){return 127995<=Re&&Re<=127999}},NLgs:function(kt,Ae,U){"use strict";U.d(Ae,"e",function(){return i}),U.d(Ae,"f",function(){return t}),U.d(Ae,"d",function(){return o}),U.d(Ae,"c",function(){return R}),U.d(Ae,"a",function(){return T}),U.d(Ae,"b",function(){return S});var te=U("miYZ"),Q=U("tsqr"),B=U("9og8"),J=U("2qtc"),K=U("kLXV"),N=U("WmNS"),$=U.n(N),z=U("q1tI"),r=U.n(z),D=U("9kvl"),p=U("xKgJ"),g=U("1vsH"),m=U("RCxd"),a=U("yTi+"),d=U.n(a),s=U("m3rI"),i=function(P){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(t(P)&&u(E))},t=function(P){return Object(p.p)()?!0:(P({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},u=function(){var P,E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,b=Object(D.c)()._store.getState(),h=b.user;return(P=h.userInfo)!==null&&P!==void 0&&P.profile_completed?!0:(K.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:E?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){D.d.push("/account/profile/edit")}}),!1)},o=function(){var P,E=Object(D.c)()._store.getState(),b=E.user;return(P=b.userInfo)!==null&&P!==void 0&&P.professional_certification?!0:(K.a.confirm({title:"\u63D0\u793A",centered:!0,content:r.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(g.S)("/account/certification")}}),!1)},R=function(){var P;if(Object(p.a)())return!0;var E=Object(D.c)()._store.getState(),b=E.user,h=E.globalSetting;return K.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("p",null,"\u626B\u7801\u6DFB\u52A0\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),r.a.createElement("img",{src:s.a.IMG_SERVER+(h==null||((P=h.setting)===null||P===void 0)?void 0:P.authority_qrcode_url),width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1},T=function(P,E){var b;if(P)return!0;var h=Object(D.c)()._store.getState(),f=h.user,C=h.globalSetting;return K.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,E||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),r.a.createElement("div",{style:{marginLeft:"110px"}},r.a.createElement("img",{src:s.a.IMG_SERVER+(C==null||((b=C.setting)===null||b===void 0)?void 0:b.authority_qrcode_url),width:200}),r.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(g.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1},S=function(P){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",b=Object(D.c)()._store.getState(),h=b.shixunsDetail.detail;return(h==null?void 0:h.public)===2||(h==null?void 0:h.public)===1||(h==null?void 0:h.shixun_status)===3?(K.a.info({centered:!0,icon:r.a.createElement(m.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(h==null?void 0:h.public)===2?"\u5DF2\u516C\u5F00":(h==null?void 0:h.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",E,"\u3002"),r.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),r.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:d.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(h==null?void 0:h.shixun_status)===2?(K.a.confirm({centered:!0,icon:r.a.createElement(m.a,null),title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",E,"\u3002"),r.a.createElement("br",null),r.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){K.a.confirm({width:440,centered:!0,icon:r.a.createElement(m.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var C=Object(B.a)($.a.mark(function _(){var j;return $.a.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,P({type:"shixunsDetail/cancelRelease",payload:{id:h==null?void 0:h.identifier}});case 2:j=w.sent,j.status!==401&&(Q.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),P({type:"shixunsDetail/getShixunsDetail",payload:{id:h==null?void 0:h.identifier}}),P({type:"practiceSetting/getCommonData",payload:{id:h==null?void 0:h.identifier}}));case 4:case"end":return w.stop()}},_)}));function x(){return C.apply(this,arguments)}return x}()})}}),!0):!1}},Nog9:function(kt,Ae,U){kt.exports={flex_box_center:"flex_box_center___FKAcC",flex_space_between:"flex_space_between___1W0sn",flex_box_vertical_center:"flex_box_vertical_center___1ZtTo",flex_box_center_end:"flex_box_center_end___3Rjsx",flex_box_column:"flex_box_column___3qWVQ",wrap:"wrap___K2ugW",modal:"modal___3Jrop",titleWrap:"titleWrap___2PdmB",required:"required___XbmpK",title:"title___1w-JF",colorGray:"colorGray___2hKRg",choiceWrap:"choiceWrap___3oJpR",answer:"answer___1Kugg",activeAnswer:"activeAnswer___3MPrD",deleteIcon:"deleteIcon___2j8_2",addIcon:"addIcon___2lm8T",editorWrap:"editorWrap___1f48O",htmlWrap:"htmlWrap___2gSXb",radio:"radio___1S16G",color333:"color333___3rZXR",color999:"color999___2xzRf",questionType:"questionType___2l_WF",questionChoices:"questionChoices___hYMa9",action:"action___1DPov",difficult:"difficult___1CZwg",fold:"fold___2FQQU",head:"head___2Es3Y"}},NvD2:function(kt,Ae,U){"use strict";U.d(Ae,"a",function(){return N});var te=U("Kwbf");function Q($,z){var r=new Set;return $.forEach(function(D){z.has(D)||r.add(D)}),r}function B($){var z=$||{},r=z.disabled,D=z.disableCheckbox,p=z.checkable;return!!(r||D)||p===!1}function J($,z,r,D){for(var p=new Set($),g=new Set,m=0;m<=r;m+=1){var a=z.get(m)||new Set;a.forEach(function(t){var u=t.key,o=t.node,R=t.children,T=R===void 0?[]:R;p.has(u)&&!D(o)&&T.filter(function(S){return!D(S.node)}).forEach(function(S){p.add(S.key)})})}for(var d=new Set,s=r;s>=0;s-=1){var i=z.get(s)||new Set;i.forEach(function(t){var u=t.parent,o=t.node;if(D(o)||!t.parent||d.has(t.parent.key))return;if(D(t.parent.node)){d.add(u.key);return}var R=!0,T=!1;(u.children||[]).filter(function(S){return!D(S.node)}).forEach(function(S){var A=S.key,P=p.has(A);R&&!P&&(R=!1),!T&&(P||g.has(A))&&(T=!0)}),R&&p.add(u.key),T&&g.add(u.key),d.add(u.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(Q(g,p))}}function K($,z,r,D,p){for(var g=new Set($),m=new Set(z),a=0;a<=D;a+=1){var d=r.get(a)||new Set;d.forEach(function(u){var o=u.key,R=u.node,T=u.children,S=T===void 0?[]:T;!g.has(o)&&!m.has(o)&&!p(R)&&S.filter(function(A){return!p(A.node)}).forEach(function(A){g.delete(A.key)})})}m=new Set;for(var s=new Set,i=D;i>=0;i-=1){var t=r.get(i)||new Set;t.forEach(function(u){var o=u.parent,R=u.node;if(p(R)||!u.parent||s.has(u.parent.key))return;if(p(u.parent.node)){s.add(o.key);return}var T=!0,S=!1;(o.children||[]).filter(function(A){return!p(A.node)}).forEach(function(A){var P=A.key,E=g.has(P);T&&!E&&(T=!1),!S&&(E||m.has(P))&&(S=!0)}),T||g.delete(o.key),S&&m.add(o.key),s.add(o.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(Q(m,g))}}function N($,z,r,D){var p=[],g;D?g=D:g=B;var m=new Set($.filter(function(i){var t=!!r[i];return t||p.push(i),t})),a=new Map,d=0;Object.keys(r).forEach(function(i){var t=r[i],u=t.level,o=a.get(u);o||(o=new Set,a.set(u,o)),o.add(t),d=Math.max(d,u)}),Object(te.a)(!p.length,"Tree missing follow keys: ".concat(p.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var s;return z===!0?s=J(m,a,d,g):s=K(m,z.halfCheckedKeys,a,d,g),s}},O2Wb:function(kt,Ae,U){kt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(kt,Ae,U){"use strict";U.d(Ae,"b",function(){return D}),U.d(Ae,"a",function(){return p}),U.d(Ae,"k",function(){return g}),U.d(Ae,"h",function(){return m}),U.d(Ae,"i",function(){return a}),U.d(Ae,"g",function(){return d}),U.d(Ae,"c",function(){return s}),U.d(Ae,"d",function(){return i}),U.d(Ae,"j",function(){return o}),U.d(Ae,"e",function(){return R}),U.d(Ae,"f",function(){return T});var te=U("KQm4"),Q=U("U8pU"),B=U("Ff2n"),J=U("q1tI"),K=U.n(J),N=U("Kwbf"),$=U("WaYH"),z=.25,r=2;function D(S,A){var P=S.slice(),E=P.indexOf(A);return E>=0&&P.splice(E,1),P}function p(S,A){var P=S.slice();return P.indexOf(A)===-1&&P.push(A),P}function g(S){return S.split("-")}function m(S,A){return"".concat(S,"-").concat(A)}function a(S){return S&&S.type&&S.type.isTreeNode}function d(S,A){var P=[S],E=A[S];function b(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(f){var C=f.key,x=f.children;P.push(C),b(x)})}return b(E.children),P}function s(S,A){var P=S.clientY,E=A.selectHandle.getBoundingClientRect(),b=E.top,h=E.bottom,f=E.height,C=Math.max(f*z,r);return P<=b+C?-1:P>=h-C?1:0}function i(S,A){if(!S)return;var P=A.multiple;return P?S.slice():S.length?[S[0]]:S}var t=function(A){return A};function u(S,A){if(!S)return[];var P=A||{},E=P.processProps,b=E===void 0?t:E,h=Array.isArray(S)?S:[S];return h.map(function(f){var C=f.children,x=Object(B.a)(f,["children"]),_=u(C,A);return K.a.createElement($.a,Object.assign({},b(x)),_)})}function o(S){if(!S)return null;var A;if(Array.isArray(S))A={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(Q.a)(S)==="object")A={checkedKeys:S.checked||void 0,halfCheckedKeys:S.halfChecked||void 0};else return Object(N.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function R(S,A){var P=new Set;function E(b){if(P.has(b))return;var h=A[b];if(!h)return;P.add(b);var f=h.parent,C=h.node;if(C.disabled)return;f&&E(f.key)}return(S||[]).forEach(function(b){E(b)}),Object(te.a)(P)}function T(S){var A={};return Object.keys(S).forEach(function(P){(P.startsWith("data-")||P.startsWith("aria-"))&&(A[P]=S[P])}),A}},Ot1p:function(kt,Ae,U){"use strict";var te=U("2qtc"),Q=U("kLXV"),B=U("rAM+"),J=U("miYZ"),K=U("tsqr"),N=U("9og8"),$=U("tJVT"),z=U("jrin"),r=U("WmNS"),D=U.n(r),p=U("q1tI"),g=U.n(p),m=U("VrN/"),a=U.n(m),d=U("bdgK"),s=U("p77/"),i=U("Bd2K"),t=U("ELLl"),u=U("19Vz"),o=U("lZu9"),R=U("+NIl"),T=U("kSUc"),S=U("9Bee"),A=function(Fe){var at=Fe.value,xt=at===void 0?"":at,Gt=Fe.className,$t=Fe.showTextOnly,Yt=Fe.showLines,$n=Fe.style,vn=$n===void 0?{}:$n,ln=Object(p.useMemo)(function(){return""},[xt]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:ln}}))},P=U("0Owb"),E=U("dejd"),b=U("C+DQ"),h=U("1vsH"),f=U("m3rI"),C=[{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 x(Fe){var at=Fe.onActionCallback,xt=Fe.title,Gt=Fe.icon,$t=Fe.actionName,Yt=Fe.className,$n=Yt===void 0?"":Yt,vn=Fe.children;function ln(){at($t)}return g.a.createElement("a",{title:xt,className:$n,onClick:ln},g.a.createElement("i",{className:"md-iconfont ".concat(Gt)}),vn)}var _=function(Fe){var at=Fe.watch,xt=Fe.showNullButton,Gt=Fe.onActionCallback,$t=Fe.fullScreen,Yt=Fe.insertTemp,$n=Fe.hidetoolBar,vn=Fe.uuid,ln=Fe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(vn,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var hn=[].concat(C,[{title:"".concat(at?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(at?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!$n&&hn.map(function(Gn,fr){return g.a.createElement("li",{key:fr},Gn.actionName?g.a.createElement(x,Object(P.a)({},Gn,{onActionCallback:Gt})):g.a.createElement("span",{className:"v-line"}))}),xt?g.a.createElement("li",null,g.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Gt},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Yt&&g.a.createElement("li",null,g.a.createElement(x,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Yt),onActionCallback:Gt},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(x,{icon:"".concat($t?"icon-shrink":"icon-enlarge"),title:$t?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Gt})))},j=U("M8RZ"),W=U("+L6B"),w=U("2/Rp"),F=U("y8nQ"),I=U("Vl3Y"),v=U("5NDa"),H=U("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},ie=function(Fe){var at=Fe.callback,xt=Fe.onCancel;function Gt($t){at($t)}return g.a.createElement(I.a,Object(P.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Gt}),g.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(H.a,null)),g.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(H.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))},le=U("7ahc"),he=U("HmJG"),we=U("BjJ7"),Pe=I.a.useForm,xe={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},pe=function(Fe){var at=Fe.callback,xt=Fe.onCancel,Gt=Pe(),$t=Object($.a)(Gt,1),Yt=$t[0];function $n(hn){at(hn)}function vn(hn,Gn){if(hn.status===-1){K.b.error(hn.message);return}Yt.setFieldsValue({src:"/api/attachments/".concat(hn.id),type:Gn.type})}function ln(hn){var Gn=hn.target.files[0];ne(Gn,vn)}return g.a.createElement(I.a,Object(P.a)({form:Yt},Oe,{className:"upload-image-panel",onFinish:$n}),g.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},g.a.createElement(H.a,{style:xe})),g.a.createElement(be,{onFileChange:ln}))),g.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(H.a,{style:{width:264}})),g.a.createElement(I.a.Item,{style:{textAlign:"right"}},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))};function be(Fe){var at=Fe.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:at}))}function ne(Fe,at){if(!Fe)throw new String("\u6CA1\u6709\u6587\u4EF6");var xt=new FormData;xt.append("editormd-image-file",Fe),xt.append("file_param_name","editormd-image-file"),xt.append("byxhr","true");var Gt=new window.XMLHttpRequest;Gt.withCredentials=!0,Gt.addEventListener("load",function($t){at(JSON.parse($t.target.responseText),Fe)},!1),Gt.addEventListener("error",function($t){console.error($t)},!1),Gt.open("POST","".concat(we.a,"/api/attachments.json")),Gt.send(xt)}var fe=U("giR+"),_e=U("fyUT"),ke=U("7Kak"),qe=U("9yH6"),je=qe.a.Group,st={margin:"0 8px"},vt=function(Fe){var at=Fe.callback,xt=Fe.onCancel;function Gt($t){at($t)}return g.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Gt},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:st},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:st},"\u884C\u6570"),g.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(_e.a,null)),g.a.createElement("span",{style:st},"\u5217\u6570"),g.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(_e.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:st},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(I.a.Item,{name:"align"},g.a.createElement(je,null,g.a.createElement(qe.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(qe.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(qe.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(qe.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))},Re=U("ErOA"),Be=U("7Cbv"),Ye="link",Ke="upload-image",yt="code-block",Pt="add-table",Ht="------------",Xt={default:Ht,left:":".concat(Ht),center:":".concat(Ht,":"),right:"".concat(Ht,":")},an=U("9VGf"),tn,et;function Ze(){}var Ct=0,At=1e4,dt="\u2581",ft=`
**\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 He(Fe){return/^\d+$/.test(Fe)?"".concat(Fe,"px"):Fe}var Ne=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ue=Ne?"Cmd":"Ctrl",ge=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],Ee=(tn={},Object(z.a)(tn,Ue+"-B","bold"),Object(z.a)(tn,Ue+"-I","italic"),tn),De=(et={},Object(z.a)(et,Ye,"\u6DFB\u52A0\u94FE\u63A5"),Object(z.a)(et,yt,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(z.a)(et,Ke,"\u6DFB\u52A0\u6587\u4EF6"),Object(z.a)(et,Pt,"\u6DFB\u52A0\u8868\u683C"),et),ue=Ae.a=function(Fe){var at=Fe.defaultValue,xt=at===void 0?"":at,Gt=Fe.onChange,$t=Fe.width,Yt=$t===void 0?"100%":$t,$n=Fe.height,vn=$n===void 0?400:$n,ln=Fe.miniToolbar,hn=ln===void 0?!1:ln,Gn=Fe.isFocus,fr=Gn===void 0?!1:Gn,vr=Fe.watch,ir=Fe.insertTemp,br=Fe.mode,Rr=br===void 0?"markdown":br,Jt=Fe.id,Ar=Jt===void 0?"markdown-editor-id":Jt,Nn=Fe.showResizeBar,Tn=Nn===void 0?!1:Nn,pr=Fe.noStorage,_r=pr===void 0?!1:pr,Pr=Fe.showNullButton,yr=Pr===void 0?!1:Pr,mt=Fe.hidetoolBar,Ge=mt===void 0?!1:mt,Ot=Fe.fullScreen,Me=Ot===void 0?!1:Ot,ye=Fe.onBlur,ve=Fe.onCMBeforeChange,or=Fe.onFullScreen,en=Fe.className,Ie=en===void 0?"":en,gt=Fe.disablePaste,Ce=gt===void 0?!1:gt,cn=Fe.placeholder,hr=cn===void 0?"":cn,mr=Fe.values,q=mr===void 0?"":mr,O=Object(p.useState)(null),M=Object($.a)(O,2),X=M[0],se=M[1],Z=Object(p.useState)(xt),Le=Object($.a)(Z,2),ot=Le[0],wt=Le[1],Lt=Object(p.useState)(vr),ct=Object($.a)(Lt,2),Et=ct[0],Mt=ct[1],Cn=Object(p.useState)(Me),Yn=Object($.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(p.useState)(""),sn=Object($.a)(Wt,2),qt=sn[0],Ft=sn[1],Qn=Object(p.useState)(0),Bn=Object($.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(p.useState)(vn),Sn=Object($.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(p.useState)(!1),nr=Object($.a)(Xn,2),Ln=nr[0],Kn=nr[1],rn=Object(p.useRef)(Object(Be.a)()),_n=Object(p.useRef)(!1),In=Object(p.useRef)(),wn=Object(p.useRef)(),Zn=Object(p.useRef)(),yn=Object(p.useRef)(),Vn=Object(p.useRef)(),qn=function(){var bt=Object(N.a)(D.a.mark(function lt(){var Je,nt;return D.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(Re.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:rn.current}});case 2:nt=pt.sent,nt!=null&&(Je=nt.attachments)!==null&&Je!==void 0&&Je.length&&(console.log("cm:",X,wn),nt.attachments.map(function(rt){rt.content_type.indexOf("image")>-1?X.replaceSelection(".concat(rt.content_type,")")):rt.content_type.indexOf("video")>-1?X.replaceSelection('')):rt.content_type.indexOf("pdf")>-1?X.replaceSelection('').concat(rt.name,"")):X.replaceSelection("[".concat(rt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(rt.id,"?type=").concat(rt.content_type,")"))}));case 4:case"end":return pt.stop()}},lt)}));return function(){return bt.apply(this,arguments)}}();Object(p.useEffect)(function(){wt(q),X==null||X.setValue(q)},[q]),Object(p.useEffect)(function(){or==null||or(Hn)},[Hn]),Object(p.useEffect)(function(){if(wn.current){var bt=a.a.fromTextArea(wn.current,{mode:Rr,lineNumbers:!hn,lineWrapping:!0,value:xt,autoCloseTags:!0,autoCloseBrackets:!0});fr&&bt.focus();function lt(Je,nt){if(Ce){nt.preventDefault();return}var ze=nt.clipboardData;if(ze){var pt=ze.types.toString(),rt=ze.items;if(pt==="Files"||ze.types.indexOf("Files")>-1){if(nt.preventDefault(),Rr=="stex")return;try{var Tt,Nt=rt[1];((Tt=rt[0])===null||Tt===void 0?void 0:Tt.kind)==="file"&&(Nt=rt[0]);var St=Nt.getAsFile(),Kt=St.name.split(".").pop();ne(St,function(Rt){if(Rt.id){var It,En,on;(St==null||((It=St.type)===null||It===void 0)?void 0:It.indexOf("image"))>-1?bt.replaceSelection(".concat(Rt.content_type,")")):(St==null||((En=St.type)===null||En===void 0)?void 0:En.indexOf("video"))>-1?bt.replaceSelection('')):(St==null||((on=St.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?bt.replaceSelection('').concat(St.name,"")):ge.includes(Kt)?bt.replaceSelection('').concat(St.name,"")):bt.replaceSelection("[".concat(St.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}else(Rt==null?void 0:Rt.status)===401&&(document.location.href="/user/login")})}catch(Rt){K.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return bt.on("paste",lt),bt.on("dragleave",function(Je,nt){Zn.current.classList.remove("mouse-hover-md")}),bt.on("dragover",function(Je,nt){Zn.current.classList.add("mouse-hover-md")}),bt.on("drop",function(Je,nt){Zn.current.classList.add("mouse-hover-md");var ze;if(ze=nt.dataTransfer.files,ze.length>0){nt.preventDefault(),nt.stopPropagation();for(var pt=function(Nt){var St=ze[Nt],Kt=St.name.split(".").pop();ne(St,function(Rt){if(Rt.id){var It,En,on;(St==null||((It=St.type)===null||It===void 0)?void 0:It.indexOf("image"))>-1?bt.replaceSelection(".concat(Rt.content_type,")")):(St==null||((En=St.type)===null||En===void 0)?void 0:En.indexOf("video"))>-1?bt.replaceSelection('')):(St==null||((on=St.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?bt.replaceSelection('').concat(St.name,"")):ge.includes(Kt)?bt.replaceSelection('').concat(St.name,"")):bt.replaceSelection("[".concat(St.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}else(Rt==null?void 0:Rt.status)===401&&(document.location.href="/user/login")})},rt=0;rt0||rt.target.offsetWidth>0)&&(kn(),X.setSize("100%","100%"),X.refresh())}}catch(Tt){ze.e(Tt)}finally{ze.f()}});return Je.observe(wn.current.parentElement),Je}if(X){var lt=bt();return function(){lt.unobserve(wn.current.parentElement)}}},[X,kn]),Object(p.useEffect)(function(){if(X){for(var bt=[],lt=function(){var rt=nt[Je];ze=Object($.a)(rt,2);var Tt=ze[0],Nt=ze[1],St=Object(z.a)({},Tt,function(){Pn(Nt)});bt.push(St),X.addKeyMap(St)},Je=0,nt=Object.entries(Ee);Je0){var bt=new Date().getTime(),lt=window.sessionStorage.getItem(Ar);bt>=xn+At&&(!lt||lt!==ot)&&(window.sessionStorage.setItem(Ar,ot),Kn(!0))}},At),Object(p.useEffect)(function(){Mt(vr)},[X,vr]),Object(p.useEffect)(function(){X&&(fr&&X.focus())},[X,fr]),Object(p.useEffect)(function(){if(Et&&X){var bt=X.getScrollerElement();function lt(Je){var nt=Je.target;if(Vn.current){var ze=nt.scrollTop/nt.scrollHeight;Vn.current.scrollTop=Vn.current.scrollHeight*ze}}return bt.addEventListener("scroll",lt),function(){bt.removeEventListener("scroll",lt)}}},[X,Et]),Object(p.useEffect)(function(){if(X&&ve){function bt(lt,Je){ve(lt,Je)}return X.on("beforeChange",bt),function(){X.off("beforeChange",bt)}}},[X,ve]),Object(p.useEffect)(function(){if(X&&ye){function bt(){ye(X.getValue())}return X.on("blur",bt),function(){X.off("blur",bt)}}},[X,ye]),Object(p.useEffect)(function(){if(X){function bt(lt){var Je=lt.getValue();wt(Je),Jn(new Date().getTime()),lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Gt&&Gt(Je)}return X.on("change",bt),function(){X.off("change",bt)}}},[X,Gt]),Object(p.useEffect)(function(){X&&(xt==null?(X.setValue(""),wt("")):xt!==X.getValue()&&(X.setValue(xt),wt(xt),X.setCursor(X.lineCount(),0)))},[X,xt]);var Pn=Object(p.useCallback)(function(bt){var lt=X.getCursor(),Je=X.getSelection(),nt=Je.split(`
`);switch(bt){case"bold":return X.replaceSelection("**"+Je+"**"),Je===""&&X.setCursor(lt.line,lt.ch+2),X.focus();case"italic":return X.replaceSelection("*"+Je+"*"),Je===""&&X.setCursor(lt.line,lt.ch+1),X.focus();case"code":return X.replaceSelection("`"+Je+"`"),Je===""&&X.setCursor(lt.line,lt.ch+1),X.focus();case"inline-latex":return X.replaceSelection("`$$"+Je+"$$`"),Je===""&&X.setCursor(lt.line,lt.ch+3),X.focus();case"latex":return X.replaceSelection("```latex\n"+Je+"\n```"),X.setCursor(lt.line+1,Je.length+1),X.focus();case"line-break":return X.replaceSelection(`
`),X.focus();case"list-ul":return Je===""?X.replaceSelection("- "+Je):X.replaceSelection(nt.map(function(ze){return ze===""?"":"- ".concat(ze)}).join(`
`)),X.focus();case"list-ol":return Je===""?X.replaceSelection("1. "+Je):X.replaceSelection(nt.map(function(ze,pt){return ze===""?"":"".concat(pt+1,". ").concat(ze)}).join(`
`)),X.focus();case"add-null-ch":return Je===""&&X.setCursor(lt.line,lt.ch+1),X.replaceSelection(dt),X.focus();case"inster-template-1":return Je===""&&X.setCursor(lt.line,lt.ch),X.replaceSelection(ft),X.focus();case"eraser":return X.setValue(""),X.focus();case"trigger-watch":return Mt(!Et),X.focus();case"trigger-full-screen":return fn(!Hn),X.focus();case Ye:Ft(Ye);return;case yt:Ft(yt);return;case Ke:Ft(Ke);return;case Pt:Ft(Pt);return;default:throw new Error}},[X,Et,Hn]),Mn=Object(p.useCallback)(function(bt){Ft("");switch(qt){case Ye:var lt=bt.title,Je=bt.link;return X.replaceSelection("[".concat(lt,"](").concat(Je,")")),X.focus();case yt:var nt=bt.language,ze=bt.content;return X.replaceSelection(["```"+nt,ze,"```"].join(`
`)),X.focus();case Ke:var pt=bt.src,rt=bt.alt;return rt?X.replaceSelection(".concat(pt,' "').concat(rt,'" )')):X.replaceSelection("")),X.focus();case Pt:for(var Tt=bt.row,Nt=bt.col,St=bt.align,Kt=`
`,Rt=0;Rt300&&(Tt=300);var Nt=vn+Tt+"px";Un(Nt)}}return bt.addEventListener("mousedown",nt),document.addEventListener("mousemove",pt),document.addEventListener("mouseup",ze),function(){bt.removeEventListener("mousedown",nt),document.removeEventListener("mousemove",pt),document.removeEventListener("mouseup",ze)}}},[X,yn]),Object(p.useEffect)(function(){Un(vn)},[vn]);var Ut=He(Yt),zt=He(un),Vt={width:Ut,height:zt},jt=Object(p.useMemo)(function(){if(xn){var bt=new Date(xn),lt=bt.getHours(),Je=bt.getMinutes(),nt=bt.getSeconds();return lt=lt<10?"0"+lt:lt,Je=Je<10?"0"+Je:Je,nt=nt<10?"0"+nt:nt,"".concat(lt,":").concat(Je,":").concat(nt)}return 0},[xn]);function nn(){window.sessionStorage.removeItem(Ar),Kn(!1),Jn(0)}function bn(){Kn(!1),Jn(0),X.setValue(window.sessionStorage.getItem(Ar))}function gn(bt,lt){var Je=X.getValue();Je=Je.replace(bt,lt),wt(Je),X==null||X.setValue(Je)}return g.a.createElement(p.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:Zn},g.a.createElement("div",{className:"markdown-editor-container ".concat(Ie," ").concat(Et?"on-preview":""," ").concat(hn?"mini":""," ").concat(Hn?"full-screen":""),style:Vt},g.a.createElement(_,{insertTemp:ir,watch:Et,fullScreen:Hn,showNullButton:yr,onActionCallback:Pn,hidetoolBar:Ge,uuid:rn.current,setOpenPhones:function(){_n.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:wn,placeholder:hr})),Et?g.a.createElement("div",{ref:Vn,className:"preview-container"},Rr==="stex"&&g.a.createElement(A,{value:ot}),Rr!=="stex"&&g.a.createElement(S.a,{edit:!0,value:ot,replaces:gn})):null))),Tn?g.a.createElement("a",{ref:yn,className:"editor-resize"}):null,g.a.createElement(j.a,null,De[qt]?g.a.createElement(Q.a,{centered:!0,title:De[qt],visible:!0,onCancel:dn,footer:null,className:"markdown-popup-form"},Dn):null))}},Pxm8:function(kt,Ae,U){kt.exports={flex_box_center:"flex_box_center___3O17H",flex_space_between:"flex_space_between___1PCIj",flex_box_vertical_center:"flex_box_vertical_center___3W4zT",flex_box_center_end:"flex_box_center_end___3TSxu",flex_box_column:"flex_box_column___3pTiU",bg:"bg___3XbLP",title:"title___3HsI1",titleLeft:"titleLeft___3MQGG",titleRight:"titleRight___2RPg2",formWrap:"formWrap___3LmMJ"}},RxwV:function(kt,Ae,U){"use strict";var te=U("q1tI"),Q=U("uciX"),B=U("2W6z"),J=U.n(B),K=U("4IlW"),N=U("uK0f"),$=U.n(N);function z(xe,Oe){if(xe===Oe)return!0;if(!xe||!Oe)return!1;var pe=xe.length;if(Oe.length!==pe)return!1;for(var be=0;be0;(Pt||fe.isLeaf===!1)&&(Ke+=" ".concat(qe,"-menu-item-expand"),fe.loading||(yt=te.createElement("span",{className:"".concat(qe,"-menu-item-expand-icon")},st))),je==="hover"&&(Pt||fe.isLeaf===!1)&&(Ye={onMouseEnter:this.delayOnSelect.bind(this,Re),onMouseLeave:this.delayOnSelect.bind(this),onClick:Re}),this.isActiveOption(fe,_e)&&(Ke+=" ".concat(qe,"-menu-item-active"),Ye.ref=this.saveMenuItem(_e)),fe.disabled&&(Ke+=" ".concat(qe,"-menu-item-disabled"));var Ht=null;fe.loading&&(Ke+=" ".concat(qe,"-menu-item-loading"),Ht=vt||null);var Xt="";return"title"in fe?Xt=fe.title:typeof fe[this.getFieldName("label")]=="string"&&(Xt=fe[this.getFieldName("label")]),te.createElement("li",Object.assign({key:fe[this.getFieldName("value")],className:Ke,title:Xt},Ye,{role:"menuitem",onMouseDown:function(tn){return tn.preventDefault()}}),fe[this.getFieldName("label")],yt,Ht)}},{key:"getActiveOptions",value:function(fe){var _e=this,ke=this.props.options,qe=fe||this.props.activeValue;return $()(ke,function(je,st){return je[_e.getFieldName("value")]===qe[st]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var fe=this,_e=this.props.options,ke=this.getActiveOptions().map(function(qe){return qe[fe.getFieldName("children")]}).filter(function(qe){return!!qe});return ke.unshift(_e),ke}},{key:"delayOnSelect",value:function(fe){for(var _e=this,ke=arguments.length,qe=new Array(ke>1?ke-1:0),je=1;je=0)continue;if(!Object.prototype.propertyIsEnumerable.call(xe,be))continue;pe[be]=xe[be]}}return pe}function E(xe,Oe){if(xe==null)return{};var pe={},be=Object.keys(xe),ne,fe;for(fe=0;fe=0)continue;pe[ne]=xe[ne]}return pe}function b(xe){return x(xe)||C(xe)||f(xe)||h()}function h(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(xe,Oe){if(!xe)return;if(typeof xe=="string")return _(xe,Oe);var pe=Object.prototype.toString.call(xe).slice(8,-1);if(pe==="Object"&&xe.constructor&&(pe=xe.constructor.name),pe==="Map"||pe==="Set")return Array.from(xe);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return _(xe,Oe)}function C(xe){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(xe))return Array.from(xe)}function x(xe){if(Array.isArray(xe))return _(xe)}function _(xe,Oe){(Oe==null||Oe>xe.length)&&(Oe=xe.length);for(var pe=0,be=new Array(Oe);pe=vt.length?0:Be):(Be-=1,Be=Be<0?vt.length-1:Be):Be=0,je[st]=vt[Be][fe.getFieldName("value")]}else if(ke.keyCode===K.a.LEFT||ke.keyCode===K.a.BACKSPACE)ke.preventDefault(),je.splice(je.length-1,1);else if(ke.keyCode===K.a.RIGHT)ke.preventDefault(),vt[Re]&&vt[Re][fe.getFieldName("children")]&&je.push(vt[Re][fe.getFieldName("children")][0][fe.getFieldName("value")]);else if(ke.keyCode===K.a.ESC||ke.keyCode===K.a.TAB){fe.setPopupVisible(!1);return}(!je||je.length===0)&&fe.setPopupVisible(!1);var Ye=fe.getActiveOptions(je),Ke=Ye[Ye.length-1];fe.handleMenuSelect(Ke,Ye.length-1,ke),fe.props.onKeyDown&&fe.props.onKeyDown(ke)},fe.saveTrigger=function(ke){fe.trigger=ke};var _e=[];return"value"in ne?_e=ne.value||[]:"defaultValue"in ne&&(_e=ne.defaultValue||[]),J()(!("filedNames"in ne),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),fe.state={popupVisible:ne.popupVisible,activeValue:_e,value:_e,prevProps:ne},fe.defaultFieldNames={label:"label",value:"value",children:"children"},fe}return w(be,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(fe){var _e=this.defaultFieldNames,ke=this.props,qe=ke.fieldNames,je=ke.filedNames;return"filedNames"in this.props?je[fe]||_e[fe]:qe[fe]||_e[fe]}},{key:"getFieldNames",value:function(){var fe=this.props,_e=fe.fieldNames,ke=fe.filedNames;return"filedNames"in this.props?ke:_e}},{key:"getCurrentLevelOptions",value:function(){var fe=this,_e=this.props.options,ke=_e===void 0?[]:_e,qe=this.state.activeValue,je=qe===void 0?[]:qe,st=$()(ke,function(vt,Re){return vt[fe.getFieldName("value")]===je[Re]},{childrenKeyName:this.getFieldName("children")});return st[st.length-2]?st[st.length-2][this.getFieldName("children")]:b(ke).filter(function(vt){return!vt.disabled})}},{key:"getActiveOptions",value:function(fe){var _e=this;return $()(this.props.options||[],function(ke,qe){return ke[_e.getFieldName("value")]===fe[qe]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var fe=this.props,_e=fe.prefixCls,ke=fe.transitionName,qe=fe.popupClassName,je=fe.options,st=je===void 0?[]:je,vt=fe.disabled,Re=fe.builtinPlacements,Be=fe.popupPlacement,Ye=fe.children,Ke=fe.dropdownRender,yt=P(fe,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Pt=te.createElement("div",null),Ht="";st&&st.length>0?Pt=te.createElement(R,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Ht=" ".concat(_e,"-menus-empty");var Xt=Pt;return Ke&&(Xt=Ke(Pt)),te.createElement(Q.a,Object.assign({ref:this.saveTrigger},yt,{popupPlacement:Be,builtinPlacements:Re,popupTransitionName:ke,action:vt?[]:["click"],popupVisible:vt?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(_e,"-menus"),popupClassName:qe+Ht,popup:Xt}),te.cloneElement(Ye,{onKeyDown:this.handleKeyDown,tabIndex:vt?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(fe,_e){var ke=_e.prevProps,qe=ke===void 0?{}:ke,je={prevProps:fe};return"value"in fe&&!z(qe.value,fe.value)&&(je.value=fe.value||[],"loadData"in fe||(je.activeValue=fe.value||[])),"popupVisible"in fe&&(je.popupVisible=fe.popupVisible),je}}]),be}(te.Component);return xe.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:S,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},xe}(),we=he,Pe=Ae.a=we},"SA+Z":function(kt,Ae,U){var te=U("wTVA"),Q=U("EbDI"),B=U("ZhPi"),J=U("wkBT");function K(N){return te(N)||Q(N)||B(N)||J()}kt.exports=K,kt.exports.__esModule=!0,kt.exports.default=kt.exports},SJMd:function(kt,Ae){/**
* @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 U,te,Q,B=!1,J,K;window.PR_SHOULD_USE_CONTINUATION=!0;var N,$;(function(){var z=window,r=["break,continue,do,else,for,if,return,while"],D=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],p=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[p,"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"],m=[p,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[p,"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"],d="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",s=[p,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",t=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],u=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],o=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[g,a,m,s,i,t,u,o],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",A="kwd",P="com",E="typ",b="lit",h="pun",f="pln",C="tag",x="dec",_="src",j="atn",W="atv",w="nocode",F="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(je){for(var st=0,vt=!1,Re=!1,Be=0,Ye=je.length;Be122||(ge<65||Ue>90||Ct.push([Math.max(65,Ue)|32,Math.min(ge,90)|32]),ge<97||Ue>122||Ct.push([Math.max(97,Ue)&~32,Math.min(ge,122)&~32]))}}Ct.sort(function(Fe,at){return Fe[0]-at[0]||at[1]-Fe[1]});for(var Ee=[],De=[],ft=0;ftue[0]&&(ue[1]+1>ue[0]&&dt.push("-"),dt.push(Ht(ue[1])))}return dt.push("]"),dt.join("")}function an(et){for(var Ze=et.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")),Ct=Ze.length,At=[],dt=0,ft=0;dt=2&&Ue==="["?Ze[dt]=Xt(He):Ue!=="\\"&&(Ze[dt]=He.replace(/[a-zA-Z]/g,function(De){var ue=De.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return Ze.join("")}for(var tn=[],Be=0,Ye=je.length;Be=0;)vt[tn.charAt(et)]=an;var Ze=an[1],Ct=""+Ze;Pt.hasOwnProperty(Ct)||(yt.push(Ze),Pt[Ct]=null)}yt.push(/[\0-\uffff]/),Re=I(yt)})();var Be=st.length,Ye=function(Ke){for(var yt=Ke.sourceCode,Pt=Ke.basePos,Ht=Ke.sourceNode,Xt=[Pt,f],an=0,tn=yt.match(Re)||[],et={},Ze=0,Ct=tn.length;Ze=5&&dt.substring(0,5)==="lang-",He&&!(ft&&typeof ft[1]=="string")&&(He=!1,dt=_),He||(et[At]=dt)}var ge=an;if(an+=At.length,!He)Xt.push(Pt+ge,dt);else{var Ee=ft[1],De=At.indexOf(Ee),ue=De+Ee.length;ft[2]&&(ue=At.length-ft[2].length,De=ue-Ee.length);var Fe=dt.substring(5);H(Ht,Pt+ge,At.substring(0,De),Ye,Xt),H(Ht,Pt+ge+De,Ee,be(Fe,Ee),Xt),H(Ht,Pt+ge+ue,At.substring(ue),Ye,Xt)}}Ke.decorations=Xt};return Ye}function he(je){var st=[],vt=[];je.tripleQuotedStrings?st.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):je.multiLineStrings?st.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):st.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),je.verbatimStrings&&vt.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Re=je.hashComments;Re&&(je.cStyleComments?(Re>1?st.push([P,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):st.push([P,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),vt.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):st.push([P,/^#[^\r\n]*/,null,"#"])),je.cStyleComments&&(vt.push([P,/^\/\/[^\r\n]*/,null]),vt.push([P,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Be=je.regexLiterals;if(Be){var Ye=Be>1?"":`
\r`,Ke=Ye?".":"[\\S\\s]",yt="/(?=[^/*"+Ye+"])(?:[^/\\x5B\\x5C"+Ye+"]|\\x5C"+Ke+"|\\x5B(?:[^\\x5C\\x5D"+Ye+"]|\\x5C"+Ke+")*(?:\\x5D|$))+/";vt.push(["lang-regex",RegExp("^"+F+"("+yt+")")])}var Pt=je.types;Pt&&vt.push([E,Pt]);var Ht=(""+je.keywords).replace(/^ | $/g,"");Ht.length&&vt.push([A,new RegExp("^(?:"+Ht.replace(/[\s,]+/g,"|")+")\\b"),null]),st.push([f,/^\s+/,null,` \r
\xA0`]);var Xt="^.[^\\s\\w.$@'\"`/\\\\]*";return je.regexLiterals&&(Xt+="(?!s*/)"),vt.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[E,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[h,new RegExp(Xt),null]),le(st,vt)}var we=he({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Pe(je,st,vt){for(var Re=/(?:^|\s)nocode(?:\s|$)/,Be=/\r\n?|\n/,Ye=je.ownerDocument,Ke=Ye.createElement("li");je.firstChild;)Ke.appendChild(je.firstChild);var yt=[Ke];function Pt(Ze){var Ct=Ze.nodeType;if(Ct==1&&!Re.test(Ze.className))if(Ze.nodeName==="br")Ht(Ze),Ze.parentNode&&Ze.parentNode.removeChild(Ze);else for(var At=Ze.firstChild;At;At=At.nextSibling)Pt(At);else if((Ct==3||Ct==4)&&vt){var dt=Ze.nodeValue,ft=dt.match(Be);if(ft){var He=dt.substring(0,ft.index);Ze.nodeValue=He;var Ne=dt.substring(ft.index+ft[0].length);if(Ne){var Ue=Ze.parentNode;Ue.insertBefore(Ye.createTextNode(Ne),Ze.nextSibling)}Ht(Ze),He||Ze.parentNode.removeChild(Ze)}}}function Ht(Ze){for(;!Ze.nextSibling;)if(Ze=Ze.parentNode,!Ze)return;function Ct(ft,He){var Ne=He?ft.cloneNode(!1):ft,Ue=ft.parentNode;if(Ue){var ge=Ct(Ue,1),Ee=ft.nextSibling;ge.appendChild(Ne);for(var De=Ee;De;De=Ee)Ee=De.nextSibling,ge.appendChild(De)}return Ne}for(var At=Ct(Ze.nextSibling,0),dt;(dt=At.parentNode)&&dt.nodeType===1;)At=dt;yt.push(At)}for(var Xt=0;Xt=Ue&&(Pt+=2),Ye>=ge&&(an+=2)}}finally{dt&&(dt.style.display=ft)}}var Oe={};function pe(je,st){for(var vt=st.length;--vt>=0;){var Re=st[vt];Oe.hasOwnProperty(Re)?z.console&&console.warn("cannot override language handler %s",Re):Oe[Re]=je}}function be(je,st){return je&&Oe.hasOwnProperty(je)||(je=/^\s*]*(?:>|$)/],[P,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^