(window.webpackJsonp=window.webpackJsonp||[]).push([[181,7,8,17],{"+NIl": /*!***************************************************!*\ !*** ./node_modules/codemirror/mode/stex/stex.js ***! \***************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";e.defineMode("stex",(function(e,t){function n(e,t){e.cmdState.push(t)}function i(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function r(e,t,n){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var o={};function a(e,t){e.f=t}function s(e,t){var r;if(e.match(/^\\[a-zA-Z@]+/)){var s=e.current().slice(1);return n(t,r=new(r=o.hasOwnProperty(s)?o[s]:o.DEFAULT)),a(t,c),r.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return a(t,(function(e,t){return l(e,t,"\\]")})),"keyword";if(e.match("\\("))return a(t,(function(e,t){return l(e,t,"\\)")})),"keyword";if(e.match("$$"))return a(t,(function(e,t){return l(e,t,"$$")})),"keyword";if(e.match("$"))return a(t,(function(e,t){return l(e,t,"$")})),"keyword";var u=e.next();return"%"==u?(e.skipToEnd(),"comment"):"}"==u||"]"==u?(r=i(t))?(r.closeBracket(u),a(t,c),"bracket"):"error":"{"==u||"["==u?(n(t,r=new(r=o.DEFAULT)),"bracket"):/\d/.test(u)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(r=function(e){for(var t=e.cmdState,n=t.length-1;n>=0;n--){var i=t[n];if("DEFAULT"!=i.name)return i}return{styleIdentifier:function(){return null}}}(t)).name&&(r.argument=e.current()),r.styleIdentifier())}function l(e,t,n){if(e.eatSpace())return null;if(n&&e.match(n))return a(t,s),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=e.next();return"{"==i||"}"==i||"["==i||"]"==i||"("==i||")"==i?"bracket":"%"==i?(e.skipToEnd(),"comment"):"error"}function c(e,t){var n=e.peek();return"{"==n||"["==n?(i(t).openBracket(n),e.eat(n),a(t,s),"bracket"):/[ \t\r]/.test(n)?(e.eat(n),null):(a(t,s),function(e){var t=e.cmdState.pop();t&&t.closeBracket()}(t),s(e,t))}return o.importmodule=r("importmodule","tag",["string","builtin"]),o.documentclass=r("documentclass","tag",["","atom"]),o.usepackage=r("usepackage","tag",["atom"]),o.begin=r("begin","tag",["atom"]),o.end=r("end","tag",["atom"]),o.label=r("label","tag",["atom"]),o.ref=r("ref","tag",["atom"]),o.eqref=r("eqref","tag",["atom"]),o.cite=r("cite","tag",["atom"]),o.bibitem=r("bibitem","tag",["atom"]),o.Bibitem=r("Bibitem","tag",["atom"]),o.RBibitem=r("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:t.inMathMode?function(e,t){return l(e,t)}:s}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=s,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(n(/*! ../../lib/codemirror */"VrN/"))},"+RXH": /*!*****************************************!*\ !*** ./src/assets/images/paper/shu.svg ***! \*****************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/shu.a39bf729.svg"},"+yhJ": /*!******************************************!*\ !*** ./src/assets/images/paper/xixi.svg ***! \******************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/xixi.d492fb65.svg"},"0eGx": /*!*******************************************!*\ !*** ./src/assets/images/paper/zhong.svg ***! \*******************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/zhong.c1924b73.svg"},"19Vz": /*!**************************************************************!*\ !*** ./node_modules/codemirror/addon/display/placeholder.js ***! \**************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.style.direction=e.getOption("direction"),n.className="CodeMirror-placeholder CodeMirror-line-like";var i=e.getOption("placeholder");"string"==typeof i&&(i=document.createTextNode(i)),n.appendChild(i),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function i(e){o(e)&&n(e)}function r(e){var i=e.getWrapperElement(),r=o(e);i.className=i.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(o,a,s){var l=s&&s!=e.Init;if(a&&!l)o.on("blur",i),o.on("change",r),o.on("swapDoc",r),e.on(o.getInputField(),"compositionupdate",o.state.placeholderCompose=function(){!function(e){setTimeout((function(){var i=!1,r=e.getInputField();"TEXTAREA"==r.nodeName?i=!r.value:1==e.lineCount()&&(i=!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)),i?n(e):t(e)}),20)}(o)}),r(o);else if(!a&&l){o.off("blur",i),o.off("change",r),o.off("swapDoc",r),e.off(o.getInputField(),"compositionupdate",o.state.placeholderCompose),t(o);var c=o.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}a&&!o.hasFocus()&&i(o)}))}(n(/*! ../../lib/codemirror */"VrN/"))},"1eCo": /*!*************************************************!*\ !*** ./node_modules/codemirror/mode/xml/xml.js ***! \*************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";var t={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},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(i,r){var o,a,s=i.indentUnit,l={},c=r.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in r)l[u]=r[u];function h(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(p("atom","]]>")):null:e.match("--")?n(p("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,i){for(var r;null!=(r=n.next());){if("<"==r)return i.tokenize=e(t+1),i.tokenize(n,i);if(">"==r){if(1==t){i.tokenize=h;break}return i.tokenize=e(t-1),i.tokenize(n,i)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var n,i,r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=h,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){t.tokenize=h,t.state=v,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=(n=r,(i=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=d;break}return"string"}).isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e,t){return function(n,i){for(;!n.eol();){if(n.match(t)){i.tokenize=h;break}n.next()}return e}}function f(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function g(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(t))return;m(e)}}function v(e,t,n){return"openTag"==e?(n.tagStart=t.column(),y):"closeTag"==e?b:v}function y(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",w):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",w(e,0,n)):(a="error",y)}function b(e,t,n){if("word"==e){var i=t.current();return n.context&&n.context.tagName!=i&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&m(n),n.context&&n.context.tagName==i||!1===l.matchClosing?(a="tag",x):(a="tag error",C)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",x(e,0,n)):(a="error",C)}function x(e,t,n){return"endTag"!=e?(a="error",x):(m(n),v)}function C(e,t,n){return a="error",x(e,0,n)}function w(e,t,n){if("word"==e)return a="attribute",k;if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(i)?g(n,i):(g(n,i),n.context=new f(n,i,r==n.indented)),v}return a="error",w}function k(e,t,n){return"equals"==e?S:(l.allowMissing||(a="error"),w(e,0,n))}function S(e,t,n){return"string"==e?E:"word"==e&&l.allowUnquoted?(a="string",w):(a="error",w(e,0,n))}function E(e,t,n){return"string"==e?E:w(e,0,n)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:v,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,i){var r=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(r&&r.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return i?i.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==S&&(e.state=w)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)n.tagName&&t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(n(/*! ../../lib/codemirror */"VrN/"))},"2sxD": /*!*********************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/List/index.less?modules ***! \*********************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={list:"list___3_VOx",head:"head___37dUf",name:"name___1VbnU",right:"right___gDdSx",body:"body___1wO_8",top:"top___cjRoo",bottom:"bottom___O44ku",l:"l___3de2t",ListGroup:"ListGroup___22jzr",a:"a___3Rx6Z",b:"b___S9Ybp",c:"c___3CVXw",c1:"c1___3b8Zq",radio:"radio___LnwQZ",d:"d___2-cs-"}},"51dB": /*!****************************************!*\ !*** ./src/assets/images/paper/sc.svg ***! \****************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/sc.c1696770.svg"},"5MlY": /*!****************************************!*\ !*** ./src/assets/images/paper/sm.svg ***! \****************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/sm.8ccb50bf.svg"},"6+eU": /*!************************************************************!*\ !*** ./node_modules/rc-pagination/es/index.js + 4 modules ***! \************************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-pagination/es/locale/zh_CN.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var i=n("wx14"),r=n("rePB"),o=n("VTBJ"),a=n("1OyB"),s=n("vuIU"),l=n("Ji7U"),c=n("LK+K"),u=n("q1tI"),h=n.n(u),d=n("TSYQ"),p=n.n(d),f=function(e){var t,n="".concat(e.rootPrefixCls,"-item"),i=p()(n,"".concat(n,"-").concat(e.page),(t={},Object(r.a)(t,"".concat(n,"-active"),e.active),Object(r.a)(t,e.className,!!e.className),Object(r.a)(t,"".concat(n,"-disabled"),!e.page),t));return h.a.createElement("li",{title:e.showTitle?e.page:null,className:i,onClick:function(){e.onClick(e.page)},onKeyPress:function(t){e.onKeyPress(t,e.onClick,e.page)},tabIndex:"0"},e.itemRender(e.page,"page",h.a.createElement("a",{rel:"nofollow"},e.page)))},m=13,g=38,v=40,y=function(e){Object(l.a)(n,e);var t=Object(c.a)(n);function n(){var e;Object(a.a)(this,n);for(var i=arguments.length,r=new Array(i),o=0;o=0||t.relatedTarget.className.indexOf("".concat(o,"-next"))>=0)||(e.setState({goInputText:""}),r(e.getValidValue()))},e.go=function(t){""!==e.state.goInputText&&(t.keyCode!==m&&"click"!==t.type||(e.setState({goInputText:""}),e.props.quickGo(e.getValidValue())))},e}return Object(s.a)(n,[{key:"getValidValue",value:function(){var e=this.state,t=e.goInputText,n=e.current;return!t||isNaN(t)?n:Number(t)}},{key:"getPageSizeOptions",value:function(){var e=this.props,t=e.pageSize,n=e.pageSizeOptions;return n.some((function(e){return e.toString()===t.toString()}))?n:n.concat([t.toString()]).sort((function(e,t){return(isNaN(Number(e))?0:Number(e))-(isNaN(Number(t))?0:Number(t))}))}},{key:"render",value:function(){var e=this,t=this.props,n=t.pageSize,i=t.locale,r=t.rootPrefixCls,o=t.changeSize,a=t.quickGo,s=t.goButton,l=t.selectComponentClass,c=t.buildOptionText,u=t.selectPrefixCls,d=t.disabled,p=this.state.goInputText,f="".concat(r,"-options"),m=l,g=null,v=null,y=null;if(!o&&!a)return null;var b=this.getPageSizeOptions();if(o&&m){var x=b.map((function(t,n){return h.a.createElement(m.Option,{key:n,value:t.toString()},(c||e.buildOptionText)(t))}));g=h.a.createElement(m,{disabled:d,prefixCls:u,showSearch:!1,className:"".concat(f,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(n||b[0]).toString(),onChange:this.changeSize,getPopupContainer:function(e){return e.parentNode}},x)}return a&&(s&&(y="boolean"==typeof s?h.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:d,className:"".concat(f,"-quick-jumper-button")},i.jump_to_confirm):h.a.createElement("span",{onClick:this.go,onKeyUp:this.go},s)),v=h.a.createElement("div",{className:"".concat(f,"-quick-jumper")},i.jump_to,h.a.createElement("input",{disabled:d,type:"text",value:p,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),i.page,y)),h.a.createElement("li",{className:"".concat(f)},g,v)}}]),n}(h.a.Component);y.defaultProps={pageSizeOptions:["10","20","50","100"]};var b=y,x=n("N2Kk");function C(){}function w(e,t,n){var i=void 0===e?t.pageSize:e;return Math.floor((n.total-1)/i)+1}var k=function(e){Object(l.a)(n,e);var t=Object(c.a)(n);function n(e){var i;Object(a.a)(this,n),(i=t.call(this,e)).getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(w(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(e,t){var n=i.props.prefixCls,r=e||h.a.createElement("button",{type:"button","aria-label":t,className:"".concat(n,"-item-link")});return"function"==typeof e&&(r=h.a.createElement(e,Object(o.a)({},i.props))),r},i.savePaginationNode=function(e){i.paginationNode=e},i.isValid=function(e){return"number"==typeof(t=e)&&isFinite(t)&&Math.floor(t)===t&&e!==i.state.current;var t},i.shouldDisplayQuickJumper=function(){var e=i.props,t=e.showQuickJumper,n=e.pageSize;return!(e.total<=n)&&t},i.handleKeyDown=function(e){e.keyCode!==g&&e.keyCode!==v||e.preventDefault()},i.handleKeyUp=function(e){var t=i.getValidValue(e);t!==i.state.currentInputValue&&i.setState({currentInputValue:t}),e.keyCode===m?i.handleChange(t):e.keyCode===g?i.handleChange(t-1):e.keyCode===v&&i.handleChange(t+1)},i.changePageSize=function(e){var t=i.state.current,n=w(e,i.state,i.props);t=t>n?n:t,0===n&&(t=i.state.current),"number"==typeof e&&("pageSize"in i.props||i.setState({pageSize:e}),"current"in i.props||i.setState({current:t,currentInputValue:t})),i.props.onShowSizeChange(t,e),"onChange"in i.props&&i.props.onChange&&i.props.onChange(t,e)},i.handleChange=function(e){var t=i.props.disabled,n=e;if(i.isValid(n)&&!t){var r=w(void 0,i.state,i.props);n>r?n=r:n<1&&(n=1),"current"in i.props||i.setState({current:n,currentInputValue:n});var o=i.state.pageSize;return i.props.onChange(n,o),n}return i.state.current},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current2?n-2:0),r=2;r=n?n:Number(t)}},{key:"getShowSizeChanger",value:function(){var e=this.props,t=e.showSizeChanger,n=e.total,i=e.totalBoundaryShowSizeChanger;return void 0!==t?t:n>i}},{key:"renderPrev",value:function(e){var t=this.props,n=t.prevIcon,i=(0,t.itemRender)(e,"prev",this.getItemIcon(n,"prev page")),r=!this.hasPrev();return Object(u.isValidElement)(i)?Object(u.cloneElement)(i,{disabled:r}):i}},{key:"renderNext",value:function(e){var t=this.props,n=t.nextIcon,i=(0,t.itemRender)(e,"next",this.getItemIcon(n,"next page")),r=!this.hasNext();return Object(u.isValidElement)(i)?Object(u.cloneElement)(i,{disabled:r}):i}},{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,o=t.className,a=t.style,s=t.disabled,l=t.hideOnSinglePage,c=t.total,d=t.locale,m=t.showQuickJumper,g=t.showLessItems,v=t.showTitle,y=t.showTotal,x=t.simple,C=t.itemRender,k=t.showPrevNextJumpers,S=t.jumpPrevIcon,E=t.jumpNextIcon,_=t.selectComponentClass,O=t.selectPrefixCls,N=t.pageSizeOptions,T=this.state,L=T.current,A=T.pageSize,M=T.currentInputValue;if(!0===l&&c<=A)return null;var j=w(void 0,this.state,this.props),D=[],P=null,I=null,R=null,B=null,z=null,F=m&&m.goButton,H=g?1:2,W=L-1>0?L-1:0,V=L+1=2*H&&3!==L&&(D[0]=Object(u.cloneElement)(D[0],{className:"".concat(n,"-item-after-jump-prev")}),D.unshift(P)),j-L>=2*H&&L!==j-2&&(D[D.length-1]=Object(u.cloneElement)(D[D.length-1],{className:"".concat(n,"-item-before-jump-next")}),D.push(I)),1!==X&&D.unshift(R),Z!==j&&D.push(B)}var ee=null;y&&(ee=h.a.createElement("li",{className:"".concat(n,"-total-text")},y(c,[0===c?0:(L-1)*A+1,L*A>c?c:L*A])));var te=!this.hasPrev()||!j,ne=!this.hasNext()||!j;return h.a.createElement("ul",Object(i.a)({className:p()(n,o,Object(r.a)({},"".concat(n,"-disabled"),s)),style:a,unselectable:"unselectable",ref:this.savePaginationNode},G),ee,h.a.createElement("li",{title:v?d.prev_page:null,onClick:this.prev,tabIndex:te?null:0,onKeyPress:this.runIfEnterPrev,className:p()("".concat(n,"-prev"),Object(r.a)({},"".concat(n,"-disabled"),te)),"aria-disabled":te},this.renderPrev(W)),D,h.a.createElement("li",{title:v?d.next_page:null,onClick:this.next,tabIndex:ne?null:0,onKeyPress:this.runIfEnterNext,className:p()("".concat(n,"-next"),Object(r.a)({},"".concat(n,"-disabled"),ne)),"aria-disabled":ne},this.renderNext(V)),h.a.createElement(b,{disabled:s,locale:d,rootPrefixCls:n,selectComponentClass:_,selectPrefixCls:O,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:L,pageSize:A,pageSizeOptions:N,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:F}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n={};if("current"in e&&(n.current=e.current,e.current!==t.current&&(n.currentInputValue=n.current)),"pageSize"in e&&e.pageSize!==t.pageSize){var i=t.current,r=w(e.pageSize,t,e);i=i>r?r:i,"current"in e||(n.current=i,n.currentInputValue=i),n.pageSize=e.pageSize}return n}}]),n}(h.a.Component);k.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:C,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:C,locale:x.a,style:{},itemRender:function(e,t,n){return n},totalBoundaryShowSizeChanger:50};var S=k},"6K3P": /*!********************************************!*\ !*** ./src/assets/images/paper/jinshi.svg ***! \********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/jinshi.9b74f304.svg"},"7Cbv": /*!**************************************************************!*\ !*** ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules ***! \**************************************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";var i="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),r=new Uint8Array(16);function o(){if(!i)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(r)}var a=/^(?:[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;for(var s=function(e){return"string"==typeof e&&a.test(e)},l=[],c=0;c<256;++c)l.push((c+256).toString(16).substr(1));var u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!s(n))throw TypeError("Stringified UUID is invalid");return n};t.a=function(e,t,n){var i=(e=e||{}).random||(e.rng||o)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return u(i)}},"7ahc": /*!*************************************************************!*\ !*** ./src/components/markdown-editor/code-block/index.tsx ***! \*************************************************************/ /*! exports provided: default, MyCodeMirror */ /*! exports used: MyCodeMirror, default */function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),o=(n(/*! antd/es/button/style */"+L6B"),n(/*! antd/es/button */"2/Rp")),a=(n(/*! antd/es/form/style */"y8nQ"),n(/*! antd/es/form */"Vl3Y")),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),c=n(/*! react */"q1tI"),u=n.n(c),h=n(/*! codemirror */"VrN/"),d=n.n(h),p=(n(/*! codemirror/lib/codemirror.css */"p77/"),n(/*! codemirror/theme/blackboard.css */"c5Ni"),l.a.Option),f={labelCol:{span:4},wrapperCol:{span:20}},m={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"]};function g(e){var t=e.value,n=e.onChange,r=e.mode,o=e.options,a=void 0===o?{}:o,l=Object(c.useRef)(),h=Object(c.useState)(),p=Object(s.a)(h,2),f=p[0],m=p[1];return Object(c.useEffect)((function(){if(f){function e(e){var t=e.getValue();n&&n(t)}return f.on("change",e),function(){f.off("change",e)}}}),[f,n]),Object(c.useEffect)((function(){f&&f.setOption("mode",r)}),[f,r]),Object(c.useEffect)((function(){f&&(t===f.getValue()&&""!==t||setTimeout((function(){f.setValue(t||" ")}),300))}),[f,t]),Object(c.useEffect)((function(){if(l.current&&!f){var e=d.a.fromTextArea(l.current,Object(i.a)({mode:r,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},a));m(e)}}),[l.current,f]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}t.b=function(e){var t=e.callback,n=e.onCancel,i=Object(c.useState)("python"),h=Object(s.a)(i,2),d=h[0],v=h[1];return u.a.createElement(a.a,Object(r.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)}}),u.a.createElement(a.a.Item,{label:"代码语言",name:"language"},u.a.createElement(l.a,{onChange:function(e){v(m[e][1])}},Object.keys(m).map((function(e){return u.a.createElement(p,{key:e,value:e},m[e][0])})))),u.a.createElement(a.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},u.a.createElement(g,{mode:d})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(o.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(o.a,{type:"ghost",onClick:n},"取消")))}},"7ixt": /*!**************************************************!*\ !*** ./node_modules/rc-tooltip/es/placements.js ***! \**************************************************/ /*! exports provided: placements, default */ /*! exports used: placements */function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var i={adjustX:1,adjustY:1},r=[0,0],o={left:{points:["cr","cl"],overflow:i,offset:[-4,0],targetOffset:r},right:{points:["cl","cr"],overflow:i,offset:[4,0],targetOffset:r},top:{points:["bc","tc"],overflow:i,offset:[0,-4],targetOffset:r},bottom:{points:["tc","bc"],overflow:i,offset:[0,4],targetOffset:r},topLeft:{points:["bl","tl"],overflow:i,offset:[0,-4],targetOffset:r},leftTop:{points:["tr","tl"],overflow:i,offset:[-4,0],targetOffset:r},topRight:{points:["br","tr"],overflow:i,offset:[0,-4],targetOffset:r},rightTop:{points:["tl","tr"],overflow:i,offset:[4,0],targetOffset:r},bottomRight:{points:["tr","br"],overflow:i,offset:[0,4],targetOffset:r},rightBottom:{points:["bl","br"],overflow:i,offset:[4,0],targetOffset:r},bottomLeft:{points:["tl","bl"],overflow:i,offset:[0,4],targetOffset:r},leftBottom:{points:["br","bl"],overflow:i,offset:[-4,0],targetOffset:r}}},"7qnI": /*!********************************************************!*\ !*** ./src/components/Editor/NullChildEditor/index.js ***! \********************************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";n(/*! antd/es/tooltip/style */"5Dmo");var i=n(/*! antd/es/tooltip */"3S7+"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),l=(n(/*! antd/es/input/style */"5NDa"),n(/*! antd/es/input */"5rEg")),c=n(/*! react */"q1tI"),u=n.n(c),h=n(/*! ./index.less?modules */"O2Wb"),d=n.n(h),p=l.a.TextArea,f=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.index,r=t.onAnswerChange,o=t.addChildAnswer,a=t.exerciseIsPublish,s=t.answers,l=t.activeOptionErrorIndex,c=t.flex,h=void 0===c?"0 0 1000px":c;return u.a.createElement("div",{className:d.a.flex},u.a.createElement("div",{className:"".concat(d.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"答案(填空",n+1,"):"),u.a.createElement("div",{className:"".concat(d.a.flex," ").concat(d.a.flex1),style:{flexDirection:"column"}},s.map((function(t,c){var f="".concat(n,"-").concat(c);return u.a.createElement("div",{className:"".concat(d.a.flex," ").concat(d.a.flex1),key:c},u.a.createElement("div",{className:d.a.flex1,style:{flex:h}},u.a.createElement("div",null,u.a.createElement(p,{className:f===l?d.a.error:"",spellCheck:!1,rows:4,value:t||"",defaultValue:"请输入参考答案".concat(0==c?"":"(可选)"),onChange:function(e){return r(n,c,e.target.value)},style:{minHeight:95}}))),!a&&u.a.createElement(u.a.Fragment,null,0!=c&&u.a.createElement(i.a,{title:"删除"},u.a.createElement("i",{className:"".concat(d.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return e.props.deleteChildAnswer(n,c)},style:{float:"right"}})),0===c&&u.a.createElement(i.a,{title:"删除"},u.a.createElement("i",{className:"".concat(d.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return e.props.deleteChildAnswermain(n,c)},style:{float:"right"}})),u.a.createElement(i.a,{title:"新增参考答案"},u.a.createElement("i",{className:"".concat(d.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return o(n)},style:{float:"right",visibility:c==s.length-1?"":"hidden"}}))))}))))}}]),n}(c.Component);t.a=f},"815F": /*!***************************************************!*\ !*** ./node_modules/rc-tree/es/utils/treeUtil.js ***! \***************************************************/ /*! exports provided: getKey, warningWithoutKey, convertTreeToData, flattenTreeData, traverseDataNodes, convertDataToEntities, getTreeNodeProps, convertNodePropsToEventData */ /*! exports used: convertDataToEntities, convertNodePropsToEventData, convertTreeToData, flattenTreeData, getKey, getTreeNodeProps */function(e,t,n){"use strict";n.d(t,"e",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"f",(function(){return f})),n.d(t,"b",(function(){return m}));var i=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),r=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ"),o=n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),a=n(/*! rc-util/es/Children/toArray */"Zm9Q"),s=n(/*! rc-util/es/warning */"Kwbf"),l=n(/*! ../util */"OZM5");function c(e,t){return null!=e?e:t}function u(e){return function e(t){return Object(a.a)(t).map((function(t){if(!Object(l.i)(t))return Object(s.a)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;var n=t.key,i=t.props,a=i.children,c=Object(o.a)(i,["children"]),u=Object(r.a)({key:n},c),h=e(a);return h.length&&(u.children=h),u})).filter((function(e){return e}))}(e)}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Set(!0===t?[]:t),o=[];function a(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e.map((function(u,h){var d=Object(l.h)(s?s.pos:"0",h),p=c(u.key,d),f=Object(r.a)(Object(r.a)({},u),{},{parent:s,pos:d,children:null,data:u,isStart:[].concat(Object(i.a)(s?s.isStart:[]),[0===h]),isEnd:[].concat(Object(i.a)(s?s.isEnd:[]),[h===e.length-1])});return o.push(f),!0===t||n.has(p)?f.children=a(u.children||[],f):f.children=[],f}))}return a(e),o}function d(e,t,n){var i;n?"string"==typeof n?i=function(e){return e[n]}:"function"==typeof n&&(i=function(e){return n(e)}):i=function(e,t){return c(e.key,t)},function n(r,o,a){var s=r?r.children:e,c=r?Object(l.h)(a.pos,o):"0";if(r){var u=i(r,c),h={node:r,index:o,pos:c,key:u,parentPos:a.node?a.pos:null,level:a.level+1};t(h)}s&&s.forEach((function(e,t){n(e,t,{node:r,pos:c,level:a?a.level+1:-1})}))}(null)}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.initWrapper,i=t.processEntity,r=t.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,a={},s={},l={posEntities:a,keyEntities:s};return n&&(l=n(l)||l),d(e,(function(e){var t=e.node,n=e.index,r=e.pos,o=e.key,u=e.parentPos,h={node:t,index:n,key:o,pos:r,level:e.level},d=c(o,r);a[r]=h,s[d]=h,h.parent=a[u],h.parent&&(h.parent.children=h.parent.children||[],h.parent.children.push(h)),i&&i(h,l)}),o),r&&r(l),l}function f(e,t){var n=t.expandedKeys,i=t.selectedKeys,r=t.loadedKeys,o=t.loadingKeys,a=t.checkedKeys,s=t.halfCheckedKeys,l=t.dragOverNodeKey,c=t.dropPosition,u=t.keyEntities[e];return{eventKey:e,expanded:-1!==n.indexOf(e),selected:-1!==i.indexOf(e),loaded:-1!==r.indexOf(e),loading:-1!==o.indexOf(e),checked:-1!==a.indexOf(e),halfChecked:-1!==s.indexOf(e),pos:String(u?u.pos:""),dragOver:l===e&&0===c,dragOverGapTop:l===e&&-1===c,dragOverGapBottom:l===e&&1===c}}function m(e){var t=e.data,n=e.expanded,i=e.selected,o=e.checked,a=e.loaded,l=e.loading,c=e.halfChecked,u=e.dragOver,h=e.dragOverGapTop,d=e.dragOverGapBottom,p=e.pos,f=e.active,m=Object(r.a)(Object(r.a)({},t),{},{expanded:n,selected:i,checked:o,loaded:a,loading:l,halfChecked:c,dragOver:u,dragOverGapTop:h,dragOverGapBottom:d,pos:p,active:f});return"props"in m||Object.defineProperty(m,"props",{get:function(){return Object(s.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}},"8EBN": /*!**********************************************!*\ !*** ./node_modules/codemirror/mode/meta.js ***! \**********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";e.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 t=0;t-1&&t.substring(r+1,t.length);if(o)return e.findModeByExtension(o)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n"],v=new p.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){m.length=0,g=["
    "]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(){return function e(t,n,i,r){if(n>=t.length||t[n].level<=i)return n;var o=t[n];r.push("
  • "+o.text+"");var a=[];return n=e(t,++n,o.level,a),a.length>0&&(r.push("
      "),a.forEach((function(e){r.push(e)})),r.push("
    ")),r.push("
  • "),n=e(t,n,i,r)}(m,0,0,g),g.push("
"),g.join("")}var w={heading:function(e){var t=y.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:Object(s.a)(t,1)[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||""),r=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(r)>=0){var o=E(),a=i;i=o,_[o]={type:"block",expression:a}}return{type:"code",raw:n,lang:r,text:i}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,E=function(){return"__special_katext_id_".concat(S++,"__")},_={};function O(){S=0,_={}}function N(e){return e=e.replace(k,(function(e,t){var n=E();return _[n]={type:"inline",expression:t},n}))}var T=v.listitem;v.listitem=function(e){return T(N(e))};var L=v.paragraph;v.paragraph=function(e){return L(N(e))};var A=v.tablecell;v.tablecell=function(e,t){return A(N(e),t)},v.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];return i?["latex","katex","math"].indexOf(i)>=0?"

".concat(e,"

"):'
').concat(n?e:Object(f.escape)(e,!0),"
\n"):'
'+(n?e:Object(f.escape)(e,!0))+"
"},v.heading=function(e,t,n){var i=this.options.headerPrefix+n.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return m.push({anchor:i,level:t,text:e}),"'+e+""},p.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),p.a.use({tokenizer:w,renderer:v});var M=p.a,j=(n("SJMd"),n("ulZh")),D=n.n(j),P=n("m3rI"),I=n("Oy/b"),R=n("p5ED"),B=n("ErOA"),z=function(e,t){return(z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function F(e,t){function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function H(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function W(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]',"select"),this.addActionButton(n,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(n,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(n,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(n,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(n,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(n,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(n,'',"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(e){var n=document.createElement("div");n.className=""+t.toolbarButtonStyleClass.name,n.setAttribute("data-type-name",e.typeName),n.innerHTML=e.icon,n.addEventListener("click",(function(){t.markerToolbarButtonClicked(n,e)})),t.buttons.push(n),t.markerButtons.push(n)})),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 i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",i.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(i),this.addActionButton(i,'',"render"),this.addActionButton(i,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},e.prototype.addButtonClickListener=function(e){this.buttonClickListeners.push(e)},e.prototype.removeButtonClickListener=function(e){this.buttonClickListeners.indexOf(e)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(e),1)},e.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},e.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var e=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var t=0;t0&&this.buttonClickListeners.forEach((function(e){return e("marker",t)})),this.markerButtonOverflowBlock.style.display="none"},e.prototype.actionToolbarButtonClicked=function(e,t){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("action",t)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},e.prototype.setActiveButton=function(e){this.resetButtonStyles(),e.className=e.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),e.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},e.prototype.setActiveMarkerButton=function(e){var t=this.markerButtons.find((function(t){return t.getAttribute("data-type-name")===e}));t&&this.setActiveButton(t)},e.prototype.setCurrentMarker=function(e){var t=this;this.currentMarker=e,this.buttons.filter((function(e){return/delete|notes/.test(e.getAttribute("data-action"))})).forEach((function(e){void 0===t.currentMarker?(e.style.fillOpacity="0.4",e.style.pointerEvents="none"):(e.style.fillOpacity="1",e.style.pointerEvents="all")}))},e}(),J=function(){function e(e,t,n,i){this.panels=[],this.panelButtons=[],this.markerjsContainer=e,this.displayMode=t,this.uiStyleSettings=n,this.styles=i,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return e.prototype.addStyles=function(){var e;this.toolboxStyleClass=this.styles.addClass(new X("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new X("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new X("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new X("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new X("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new X("toolbox-panel-row_colors","\n background-color: "+(null!==(e=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==e?e:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new X("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new X("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new X("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new Y("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new Y("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},e.prototype.show=function(e){var t;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==t?t:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},e.prototype.setPanelButtons=function(e){var t,n,i=this;this.panels=e,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==t?t:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(n=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==n?n:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(e){var t;e.uiStyleSettings=i.uiStyleSettings;var n=document.createElement("div");n.className=i.toolboxButtonStyleClass.name+" "+(null!==(t=i.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==t?t:i.toolboxButtonStyleColorsClass.name),n.innerHTML=e.icon,n.title=e.title,n.addEventListener("click",(function(){i.panelButtonClick(e)})),i.panelButtons.push(n),i.buttonRow.appendChild(n)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},e.prototype.panelButtonClick=function(e){var t=this,n=-1;if(e!==this.activePanel){n=this.panels.indexOf(e),this.panelRow.innerHTML="";var i=e.getUi();i.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(i),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=e}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===t.displayMode?t.panelRow.style.display="none":t.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(e,i){var r,o;e.className=t.toolboxButtonStyleClass.name+" "+(i===n?""+(null!==(r=t.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==r?r:t.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=t.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:t.toolboxButtonStyleColorsClass.name))}))},e}(),Q=function(e,t){this.title=e,this.icon=t},ee=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'')||this;return o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=n,o.currentColor=i,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.whiteSpace="nowrap",this.colors.forEach((function(n){var i=e.getColorBox(n);t.appendChild(i),e.colorBoxes.push(i)})),t},t.prototype.getColorBox=function(e){var t=this,n=this.uiStyleSettings.toolbarHeight/4,i=this.uiStyleSettings.toolbarHeight-n,r=document.createElement("div");r.style.display="inline-block",r.style.boxSizing="content-box",r.style.width=i-2+"px",r.style.height=i-2+"px",r.style.padding="1px",r.style.marginRight="2px",r.style.marginBottom="2px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderRadius=(i+2)/2+"px",r.style.borderColor=e===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){t.setCurrentColor(e,r)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=i-2+"px",o.style.height=i-2+"px",o.style.backgroundColor=e,o.style.borderRadius=i/2+"px","transparent"===e&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.innerHTML='\n \n '),r.appendChild(o),r},t.prototype.setCurrentColor=function(e,t){var n=this;this.currentColor=e,this.colorBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(e)},t}(Q),te=function(){function e(e,t,n){this._state="new",this._isSelected=!1,this._container=e,this._overlayContainer=t,this.globalSettings=n,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(e.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!1},Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},e.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},e.prototype.pointerDown=function(e,t){},e.prototype.dblClick=function(e,t){},e.prototype.manipulate=function(e){},e.prototype.pointerUp=function(e){this.stateChanged()},e.prototype.dispose=function(){},e.prototype.addMarkerVisualToContainer=function(e){this.container.childNodes.length>0?this.container.insertBefore(e,this.container.childNodes[0]):this.container.appendChild(e)},e.prototype.getState=function(){return{typeName:e.typeName,state:this.state,notes:this.notes}},e.prototype.restoreState=function(e){this._state=e.state,this.notes=e.notes},e.prototype.scale=function(e,t){},e.prototype.colorChanged=function(e){this.onColorChanged&&this.onColorChanged(e),this.stateChanged()},e.prototype.fillColorChanged=function(e){this.onFillColorChanged&&this.onFillColorChanged(e),this.stateChanged()},e.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var e=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),e.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(e)&&this.onStateChanged(this)}},e.typeName="MarkerBase",e}(),ne=function(){function e(){this.findGripByVisual=this.findGripByVisual.bind(this)}return e.prototype.findGripByVisual=function(e){return this.topLeft.ownsTarget(e)?this.topLeft:this.topCenter.ownsTarget(e)?this.topCenter:this.topRight.ownsTarget(e)?this.topRight:this.centerLeft.ownsTarget(e)?this.centerLeft:this.centerRight.ownsTarget(e)?this.centerRight:this.bottomLeft.ownsTarget(e)?this.bottomLeft:this.bottomCenter.ownsTarget(e)?this.bottomCenter:this.bottomRight.ownsTarget(e)?this.bottomRight:void 0},e}(),ie=function(){function e(){this.GRIP_SIZE=10,this.visual=G.createGroup(),this.visual.appendChild(G.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(G.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e}(),re=function(){function e(){}return e.toITransformMatrix=function(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}},e.toSVGMatrix=function(e,t){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e},e}(),oe=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.left=0,r.top=0,r.width=0,r.height=0,r.defaultSize={x:50,y:20},r.offsetX=0,r.offsetY=0,r.rotationAngle=0,r.CB_DISTANCE=10,r._suppressMarkerCreateEvent=!1,r.container.transform.baseVal.appendItem(G.createTransform()),r.setupControlBox(),r}return F(t,e),Object.defineProperty(t.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visual",{get:function(){return this._visual},set:function(e){this._visual=e;var t=G.createTransform();this._visual.transform.baseVal.appendItem(t)},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!!(void 0!==this.controlGrips.findGripByVisual(t)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.left=t.x,this.top=t.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var i=this.unrotatePoint(t);if(this.manipulationStartX=i.x,this.manipulationStartY=i.y,this.offsetX=i.x-this.left,this.offsetY=i.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(n),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(n)){this.activeGrip=this.rotatorGrip;var r=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=r.x-this.width/2,this.top=r.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(t),this._state="select","creating"===n&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},t.prototype.moveVisual=function(e){this.visual.style.transform="translate("+e.x+"px, "+e.y+"px)"},t.prototype.manipulate=function(e){var t=this.unrotatePoint(e);"creating"===this.state?this.resize(e):"move"===this.state?(this.left=this.manipulationStartLeft+(t.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(t.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(t):"rotate"===this.state&&this.rotate(e)},t.prototype.resize=function(e){var t=this.manipulationStartLeft,n=this.manipulationStartWidth,i=this.manipulationStartTop,r=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:t=this.manipulationStartLeft+e.x-this.manipulationStartX,n=this.manipulationStartWidth+this.manipulationStartLeft-t;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:n=this.manipulationStartWidth+e.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:i=this.manipulationStartTop+e.y-this.manipulationStartY,r=this.manipulationStartHeight+this.manipulationStartTop-i;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:r=this.manipulationStartHeight+e.y-this.manipulationStartY}n>=0?(this.left=t,this.width=n):(this.left=t+n,this.width=-n),r>=0?(this.top=i,this.height=r):(this.top=i+r,this.height=-r),this.setSize()},t.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},t.prototype.rotate=function(e){if(Math.abs(e.x-this.centerX)>.1){var t=Math.sign(e.x-this.centerX);this.rotationAngle=180*Math.atan((e.y-this.centerY)/(e.x-this.centerX))/Math.PI+90*t,this.applyRotation()}},t.prototype.applyRotation=function(){var e=this.container.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(e,0)},t.prototype.rotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM(),n=G.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.unrotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM();t=t.inverse();var n=G.createPoint(e.x,e.y);return{x:(n=n.matrixTransform(t)).x,y:n.y}},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=G.createGroup();var e=G.createTransform();e.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(e),this.container.appendChild(this.controlBox),this.controlRect=G.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),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=G.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 ne,this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){var e=this.controlBox.transform.baseVal.getItem(0);e.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(e,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(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()},t.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(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},t.prototype.createGrip=function(){var e=new ie;return e.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.controlGrips.topLeft.GRIP_SIZE,t=-e/2,n=t,i=(this.width+this.CB_DISTANCE)/2-e/2,r=(this.height+this.CB_DISTANCE)/2-e/2,o=this.height+this.CB_DISTANCE-e/2,a=this.width+this.CB_DISTANCE-e/2;this.positionGrip(this.controlGrips.topLeft.visual,t,n),this.positionGrip(this.controlGrips.topCenter.visual,i,n),this.positionGrip(this.controlGrips.topRight.visual,a,n),this.positionGrip(this.controlGrips.centerLeft.visual,t,r),this.positionGrip(this.controlGrips.centerRight.visual,a,r),this.positionGrip(this.controlGrips.bottomLeft.visual,t,o),this.positionGrip(this.controlGrips.bottomCenter.visual,i,o),this.positionGrip(this.controlGrips.bottomRight.visual,a,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,i,n-3*this.CB_DISTANCE)},t.prototype.positionGrip=function(e,t,n){var i=e.transform.baseVal.getItem(0);i.setTranslate(t,n),e.transform.baseVal.replaceItem(i,0)},t.prototype.hideControlBox=function(){this.controlBox.style.display="none"},t.prototype.showControlBox=function(){this.controlBox.style.display=""},t.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:re.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:re.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.left=n.left,this.top=n.top,this.width=n.width,this.height=n.height,this.rotationAngle=n.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(re.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,n.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(re.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,n.containerTransformMatrix))},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n);var i=this.rotatePoint({x:this.left,y:this.top}),r=this.unrotatePoint({x:i.x*t,y:i.y*n});this.left=r.x,this.top=r.y,this.width=this.width*t,this.height=this.height*n,this.adjustControlBox()},t}(te),ae=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=G.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&G.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&G.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&G.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&G.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){var n=t;this.fillColor=n.fillColor,this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.opacity=n.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize()},t.title="Rectangle marker",t}(oe),se=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'')||this;return o.widths=[],o.widthBoxes=[],o.widths=n,o.currentWidth=i,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.widths.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.flexGrow="2",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===e.currentWidth?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentWidth(n,i)})),t.appendChild(i);var r=document.createElement("div");r.innerText=n.toString(),r.style.marginRight="5px",i.appendChild(r);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var a=document.createElement("hr");a.style.minWidth="20px",a.style.border="0px",a.style.borderTop=n+"px solid "+e.uiStyleSettings.toolboxColor,a.style.flexGrow="2",o.appendChild(a),i.appendChild(o),e.widthBoxes.push(i)})),t},t.prototype.setCurrentWidth=function(e,t){var n=this;this.currentWidth=e,this.widthBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},t}(Q),le=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'')||this;return o.styles=[],o.styleBoxes=[],o.styles=n,o.currentStyle=i,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.styles.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/e.styles.length-5+"%",i.style.borderColor=n===e.currentStyle?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentStyle(n,i)})),t.appendChild(i);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.overflow="hidden";var o='\n \n ";r.innerHTML=o,i.appendChild(r),e.styleBoxes.push(i)})),t},t.prototype.setCurrentStyle=function(e,t){var n=this;this.currentStyle=e,this.styleBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},t}(Q),ce=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new ee("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new le("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="FrameMarker",t.title="Frame marker",t.icon='',t}(ae),ue=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},he=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.x1=0,r.y1=0,r.x2=0,r.y2=0,r.defaultLength=50,r.manipulationStartX=0,r.manipulationStartY=0,r.manipulationStartX1=0,r.manipulationStartY1=0,r.manipulationStartX2=0,r.manipulationStartY2=0,r.setupControlBox(),r}return F(t,e),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!(!this.grip1.ownsTarget(t)&&!this.grip2.ownsTarget(t))},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartX=t.x,this.manipulationStartY=t.y,"new"===this.state&&(this.x1=t.x,this.y1=t.y,this.x2=t.x,this.y2=t.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(n)?this.activeGrip=this.grip1:this.grip2.ownsTarget(n)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},t.prototype.pointerUp=function(t){var n=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(t),this._state="select","creating"===n&&this.onMarkerCreated&&this.onMarkerCreated(this)},t.prototype.adjustVisual=function(){},t.prototype.manipulate=function(e){"creating"===this.state?this.resize(e):"move"===this.state?(this.x1=this.manipulationStartX1+e.x-this.manipulationStartX,this.y1=this.manipulationStartY1+e.y-this.manipulationStartY,this.x2=this.manipulationStartX2+e.x-this.manipulationStartX,this.y2=this.manipulationStartY2+e.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(e)},t.prototype.resize=function(e){switch(this.activeGrip){case this.grip1:this.x1=e.x,this.y1=e.y;break;case this.grip2:case void 0:this.x2=e.x,this.y2=e.y}this.adjustVisual(),this.adjustControlBox()},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=G.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){this.positionGrips()},t.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},t.prototype.createGrip=function(){var e=new ie;return e.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-e/2,this.y1-e/2),this.positionGrip(this.grip2.visual,this.x2-e/2,this.y2-e/2)},t.prototype.positionGrip=function(e,t,n){var i=e.transform.baseVal.getItem(0);i.setTranslate(t,n),e.transform.baseVal.replaceItem(i,0)},t.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.x1=n.x1,this.y1=n.y1,this.x2=n.x2,this.y2=n.y2},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.x1=this.x1*t,this.y1=this.y1*n,this.x2=this.x2*t,this.y2=this.y2*n,this.adjustVisual(),this.adjustControlBox()},t}(te),de=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new ee("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new le("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorLine&&t!==this.visibleLine)},t.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorLine=G.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=G.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},t.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()),G.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.createVisual(),this.adjustVisual()},t.typeName="LineMarker",t.title="Line marker",t.icon='',t}(he),pe=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'')||this;return o.fonts=[],o.fontBoxes=[],o.fonts=n,o.currentFont=i,o.setCurrentFont=o.setCurrentFont.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.flexGrow="2",this.fonts.forEach((function(n){var i=document.createElement("div");i.style.display="inline-block",i.style.alignItems="center",i.style.justifyContent="space-between",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.overflow="hidden",i.style.maxWidth=100/e.fonts.length-5+"%",i.style.borderColor=n===e.currentFont?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentFont(n,i)})),t.appendChild(i);var r=document.createElement("div");r.style.display="flex",r.style.minHeight="20px",r.style.flexGrow="2",r.style.fontFamily=n,r.style.overflow="hidden";var o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",r.appendChild(o),i.appendChild(r),e.fontBoxes.push(i)})),t},t.prototype.setCurrentFont=function(e,t){var n=this;this.currentFont=e,this.fontBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},t}(Q),fe=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.color="transparent",r.padding=5,r.DEFAULT_TEXT="your text here",r.text=r.DEFAULT_TEXT,r.isMoved=!1,r.color=i.defaultColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setColor=r.setColor.bind(r),r.setFont=r.setFont.bind(r),r.renderText=r.renderText.bind(r),r.sizeText=r.sizeText.bind(r),r.textEditDivClicked=r.textEditDivClicked.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.setSize=r.setSize.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.colorPanel=new ee("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.fontFamilyPanel=new pe("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r}return F(t,e),t.prototype.ownsTarget=function(t){if(e.prototype.ownsTarget.call(this,t)||t===this.visual||t===this.textElement||t===this.bgRectangle)return!0;var n=!1;return this.textElement.childNodes.forEach((function(e){e===t&&(n=!0)})),n},t.prototype.createVisual=function(){this.visual=G.createGroup(),this.bgRectangle=G.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=G.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.isMoved=!1,this.pointerDownPoint=t,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.renderText=function(){var e=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(t){e.textElement.appendChild(G.createTSpan(""===t.trim()?" ":t.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},t.prototype.getTextScale=function(){var e=this.textElement.getBBox(),t=1;if(e.width>0&&e.height>0){var n=(1*this.width-this.width*this.padding*2/100)/e.width,i=(1*this.height-this.height*this.padding*2/100)/e.height;t=Math.min(n,i)}return t},t.prototype.getTextPosition=function(e){var t=this.textElement.getBBox(),n=0,i=0;return t.width>0&&t.height>0&&(n=(this.width-t.width*e)/2,i=this.height/2-t.height*e/2),{x:n,y:i}},t.prototype.sizeText=function(){var e=this.textElement.getBBox(),t=this.getTextScale(),n=this.getTextPosition(t);n.y-=e.y*t,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+n.x+"px, "+n.y+"px) scale("+t+", "+t+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(n.x,n.y),this.textElement.transform.baseVal.getItem(1).setScale(t,t))},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(t.x-this.pointerDownPoint.x)>5||Math.abs(t.y-this.pointerDownPoint.y)>5)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.isMoved=!0,this.setSize(),this.sizeText()},t.prototype.setSize=function(){e.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},t.prototype.pointerUp=function(t){var n=this.state;"creating"===n&&(this._suppressMarkerCreateEvent=!0),e.prototype.pointerUp.call(this,t),this.setSize(),("creating"===n||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},t.prototype.showTextEditor=function(){var e=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(e){e.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var t=Number.parseFloat(e.textEditor.style.fontSize);e.textEditor.clientWidth>=Number.parseInt(e.textEditor.style.maxWidth)&&t>.9;)t-=.1,e.textEditor.style.fontSize=Math.max(t,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(e){e.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(e){if(e.clipboardData){var t=e.clipboardData.getData("text"),n=window.getSelection();if(!n.rangeCount)return!1;n.deleteFromDocument(),n.getRangeAt(0).insertNode(document.createTextNode(t)),e.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){e.textEditDivClicked(e.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},t.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var e=this.getTextScale(),t=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),n=this.textElement.getBBox(),i={x:n.width*e,y:n.height*e};t.x-=i.x/2,t.y-=i.y/2,this.textEditor.style.top=t.y+"px",this.textEditor.style.left=t.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-t.x+"px",this.textEditor.style.fontSize=Math.max(16*e,12)+"px",this.textElement.style.display="none"}},t.prototype.textEditDivClicked=function(e){this.text=e.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},t.prototype.select=function(){e.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},t.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),e.prototype.deselect.call(this)},t.prototype.dblClick=function(t,n){e.prototype.dblClick.call(this,t,n),this.showTextEditor()},t.prototype.setColor=function(e){this.textElement&&G.setAttributes(this.textElement,[["fill",e]]),this.color=e,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(e)},t.prototype.setFont=function(e){this.textElement&&G.setAttributes(this.textElement,[["font-family",e]]),this.fontFamily=e,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},t.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},t.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){var n=t;this.color=n.color,this.fontFamily=n.fontFamily,this.padding=n.padding,this.text=n.text,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setSize(),this.sizeText(),this.positionTextEditor()},t.typeName="TextMarker",t.title="Text marker",t.icon='',t}(oe),me=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.color="transparent",r.lineWidth=3,r.drawing=!1,r.pixelRatio=1,r.color=i.defaultColor,r.lineWidth=i.defaultStrokeWidth,r.pixelRatio=i.freehandPixelRatio,r.setColor=r.setColor.bind(r),r.addCanvas=r.addCanvas.bind(r),r.finishCreation=r.finishCreation.bind(r),r.setLineWidth=r.setLineWidth.bind(r),r.colorPanel=new ee("Color",i.defaultColorSet,i.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.lineWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.lineWidthPanel.onWidthChanged=r.setLineWidth,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.drawingImage)},t.prototype.createVisual=function(){this.visual=G.createGroup(),this.drawingImage=G.createImage(),this.visual.appendChild(this.drawingImage);var e=G.createTransform();this.visual.transform.baseVal.appendItem(e),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,n){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(t.x,t.y),this.drawing=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.manipulate=function(t){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(t.x,t.y),this.canvasContext.stroke()):e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):e.prototype.pointerUp.call(this,t)},t.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)},t.prototype.select=function(){"creating"===this.state&&this.finishCreation(),e.prototype.select.call(this)},t.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),e.prototype.deselect.call(this)},t.prototype.finishCreation=function(){for(var e=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),t=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],n=t[0],i=t[1],r=t[2],o=t[3],a=!1,s=0;s0&&(a=!0,so&&(o=s),l>r&&(r=l));if(a){this.left=n/this.pixelRatio,this.top=i/this.pixelRatio,this.width=(r-n)/this.pixelRatio,this.height=(o-i)/this.pixelRatio;var c=document.createElement("canvas");c.width=r-n,c.height=o-i,c.getContext("2d").putImageData(this.canvasContext.getImageData(n,i,r-n,o-i),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},t.prototype.setDrawingImage=function(){G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},t.prototype.setColor=function(e){this.color=e,this.colorChanged(e)},t.prototype.setLineWidth=function(e){this.lineWidth=e},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({drawingImgUrl:this.drawingImgUrl},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){this.createVisual(),e.prototype.restoreState.call(this,t),this.drawingImgUrl=t.drawingImgUrl,this.setDrawingImage()},t.prototype.scale=function(t,n){e.prototype.scale.call(this,t,n),this.setDrawingImage()},t.typeName="FreehandMarker",t.title="Freehand marker",t.icon='',t}(oe),ge=function(e){function t(t,n,i){var r=e.call(this,t,i||'')||this;return r.typeBoxes=[],r.currentType=n,r.setCurrentType=r.setCurrentType.bind(r),r}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2";for(var n=function(n){var r="both";switch(n){case 0:r="both";break;case 1:r="start";break;case 2:r="end";break;case 3:r="none"}var o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=r===i.currentType?i.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){e.setCurrentType(r,o)})),t.appendChild(o),"both"===r||"start"===r){var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.innerHTML='\n \n ',a.style.marginLeft="5px",o.appendChild(a)}var s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.minHeight="20px",s.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",s.appendChild(l),o.appendChild(s),"both"===r||"end"===r){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='\n \n ',c.style.marginRight="5px",o.appendChild(c)}i.typeBoxes.push(o)},i=this,r=0;r<4;r++)n(r);return t},t.prototype.setCurrentType=function(e,t){var n=this;this.currentType=e,this.typeBoxes.forEach((function(e){e.style.borderColor=e===t?void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},t}(Q),ve=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.arrowType="end",r.arrowBaseHeight=10,r.arrowBaseWidth=10,r.getArrowPoints=r.getArrowPoints.bind(r),r.setArrowType=r.setArrowType.bind(r),r.arrowTypePanel=new ge("Arrow type","end"),r.arrowTypePanel.onArrowTypeChanged=r.setArrowType,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.arrow1&&t!==this.arrow2)},t.prototype.getArrowPoints=function(e,t){var n=this.arrowBaseWidth+2*this.strokeWidth,i=this.arrowBaseHeight+2*this.strokeWidth;return e-n/2+","+(t+i/2)+" "+e+","+(t-i/2)+" "+(e+n/2)+","+(t+i/2)},t.prototype.createTips=function(){this.arrow1=G.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=G.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow2)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",G.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),G.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.arrow1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(n,0);var i=this.arrow2.transform.baseVal.getItem(0);i.setRotate(t+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(i,0)}},t.prototype.setArrowType=function(e){this.arrowType=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({arrowType:this.arrowType},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.arrowType=n.arrowType,this.createTips(),this.adjustVisual()},t.typeName="ArrowMarker",t.title="Arrow marker",t.icon='',t}(de),ye=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.fillColor=i.defaultFillColor,r.strokeWidth=0,r.fillPanel=new ee("Color",i.defaultColorSet,i.defaultFillColor),r.fillPanel.onColorChanged=r.setFillColor,r}return F(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="CoverMarker",t.title="Cover marker",t.icon='',t}(ae),be=function(e){function t(t,n,i,r){var o=e.call(this,t,r||'')||this;return o.opacities=[],o.opacityBoxes=[],o.opacities=n,o.currentOpacity=i,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return F(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",t.style.justifyContent="space-between",this.opacities.forEach((function(n){var i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.padding="5px",i.style.borderWidth="2px",i.style.borderStyle="solid",i.style.borderColor=n===e.currentOpacity?e.uiStyleSettings.toolboxAccentColor:"transparent",i.addEventListener("click",(function(){e.setCurrentOpacity(n,i)})),t.appendChild(i);var r=document.createElement("div");r.innerText=100*n+"%",i.appendChild(r),e.opacityBoxes.push(i)})),t},t.prototype.setCurrentOpacity=function(e,t){var n=this;this.currentOpacity=e,this.opacityBoxes.forEach((function(e){e.style.borderColor=e===t?n.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},t}(Q),xe=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.setOpacity=r.setOpacity.bind(r),r.fillColor=i.defaultHighlightColor,r.strokeWidth=0,r.opacity=i.defaultHighlightOpacity,r.fillPanel=new ee("Color",i.defaultColorSet,r.fillColor),r.fillPanel.onColorChanged=r.setFillColor,r.opacityPanel=new be("Opacity",i.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return F(t,e),t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&G.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="HighlightMarker",t.title="Highlight marker",t.icon='',t}(ye),Ce='',we=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.bgColor="transparent",r.tipPosition={x:0,y:0},r.tipBase1Position={x:0,y:0},r.tipBase2Position={x:0,y:0},r.tipMoving=!1,r.color=i.defaultStrokeColor,r.bgColor=i.defaultFillColor,r.fontFamily=i.defaultFontFamily,r.defaultSize={x:100,y:30},r.setBgColor=r.setBgColor.bind(r),r.getTipPoints=r.getTipPoints.bind(r),r.positionTip=r.positionTip.bind(r),r.setTipPoints=r.setTipPoints.bind(r),r.colorPanel=new ee("Text color",i.defaultColorSet,r.color,''),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new ee("Fill color",i.defaultColorSet,r.bgColor,Ce),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new pe("Font",i.defaultFontFamilies,i.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.tipGrip=new ie,r.tipGrip.visual.transform.baseVal.appendItem(G.createTransform()),r.controlBox.appendChild(r.tipGrip.visual),r}return F(t,e),t.prototype.ownsTarget=function(t){return e.prototype.ownsTarget.call(this,t)||this.tipGrip.ownsTarget(t)||this.tip===t},t.prototype.createTip=function(){G.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=G.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},t.prototype.pointerDown=function(t,n){"new"===this.state&&e.prototype.pointerDown.call(this,t,n),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(n)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):e.prototype.pointerDown.call(this,t,n)},t.prototype.pointerUp=function(t){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,e.prototype.pointerUp.call(this,t);else{var n="creating"===this.state;e.prototype.pointerUp.call(this,t),this.setTipPoints(n),this.positionTip()}},t.prototype.manipulate=function(t){if(this.tipMoving){var n=this.unrotatePoint(t);this.tipPosition={x:n.x-this.manipulationStartLeft,y:n.y-this.manipulationStartTop},this.positionTip()}else e.prototype.manipulate.call(this,t)},t.prototype.setBgColor=function(e){this.bgRectangle&&this.tip&&(G.setAttributes(this.bgRectangle,[["fill",e]]),G.setAttributes(this.tip,[["fill",e]])),this.bgColor=e,this.fillColorChanged(e)},t.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},t.prototype.setTipPoints=function(e){void 0===e&&(e=!1);var t=Math.min(this.height/2,15),n=this.height/5;e&&(this.tipPosition={x:t+n/2,y:this.height+20});var i=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?i.1)){var t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),n=this.tip1.transform.baseVal.getItem(0);n.setRotate(t,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(n,0);var i=this.tip2.transform.baseVal.getItem(0);i.setRotate(t+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(i,0)}},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t),this.createTips(),this.adjustVisual()},t.typeName="MeasurementMarker",t.title="Measurement marker",t.icon='',t}(de),Ee=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokePanel.colors=i.defaultColorSet,r.fillColor="transparent",r}return F(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=e.prototype.getState.call(this);return n.typeName=t.typeName,n},t.typeName="EllipseFrameMarker",t.title="Ellipse frame marker",t.icon='',t}(ke),_e=function(){function e(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),e.prototype.addUndoStep=function(e){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(e)||(this.undoStack.push(e),JSON.stringify(this.lastRedoStep)!==JSON.stringify(e)&&this.redoStack.splice(0,this.redoStack.length))},e.prototype.replaceLastUndoStep=function(e){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=e)},e.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},e.prototype.undo=function(){if(this.undoStack.length>1){var e=this.undoStack.pop();return void 0!==e&&this.redoStack.push(e),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},e.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},e}(),Oe=function(e){function t(t,n,i){var r=e.call(this,t,n,i)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.curveX=0,r.curveY=0,r.manipulationStartCurveX=0,r.manipulationStartCurveY=0,r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.positionGrips=r.positionGrips.bind(r),r.addControlGrips=r.addControlGrips.bind(r),r.adjustVisual=r.adjustVisual.bind(r),r.setupControlBox=r.setupControlBox.bind(r),r.resize=r.resize.bind(r),r.strokeColor=i.defaultColor,r.strokeWidth=i.defaultStrokeWidth,r.strokeDasharray=i.defaultStrokeDasharray,r.strokePanel=new ee("Line color",i.defaultColorSet,i.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new se("Line width",i.defaultStrokeWidths,i.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new le("Line style",i.defaultStrokeDasharrays,i.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorCurve&&t!==this.visibleCurve&&!this.curveGrip.ownsTarget(t))},t.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},t.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorCurve=G.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=G.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)},t.prototype.pointerDown=function(t,n){e.prototype.pointerDown.call(this,t,n),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=t.x,this.curveY=t.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(n)&&(this.activeGrip=this.curveGrip,this._state="resize")},t.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),G.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setupControlBox=function(){e.prototype.setupControlBox.call(this),this.curveControlLine1=G.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=G.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)},t.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,e.prototype.addControlGrips.call(this)},t.prototype.positionGrips=function(){e.prototype.positionGrips.call(this);var t=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-t/2,this.curveY-t/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},t.prototype.manipulate=function(t){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+t.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+t.y-this.manipulationStartY),e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){this.activeGrip===this.curveGrip&&(this.curveX=t.x,this.curveY=t.y),e.prototype.resize.call(this,t),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual()},t.prototype.scale=function(t,n){this.curveX=this.curveX*t,this.curveY=this.curveY*n,e.prototype.scale.call(this,t,n)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var n=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},e.prototype.getState.call(this));return n.typeName=t.typeName,n},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var n=t;this.strokeColor=n.strokeColor,this.strokeWidth=n.strokeWidth,this.strokeDasharray=n.strokeDasharray,this.curveX=n.curveX,this.curveY=n.curveY,this.createVisual(),this.adjustVisual()},t.typeName="CurveMarker",t.title="Curve marker",t.icon='',t}(he),Ne=function(){function e(e,t){void 0===t&&(t=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=e,this.cancelable=t}return Object.defineProperty(e.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this._defaultPrevented=!0},e}(),Te=function(e){function t(t,n,i){var r=e.call(this,t,!1)||this;return r.dataUrl=n,r.state=i,r}return F(t,e),t}(Ne),Le=function(e){function t(t,n,i){void 0===i&&(i=!1);var r=e.call(this,t,i)||this;return r.marker=n,r}return F(t,e),t}(Ne),Ae=function(){function e(){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 e.prototype.addEventListener=function(e,t){this[e].push(t)},e.prototype.removeEventListener=function(e,t){var n=this[e].indexOf(t);n>-1&&this[e].splice(n,1)},e}(),Me=function(){function e(t){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ue,this._isOpen=!1,this.undoRedoManager=new _e,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 Ae,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=e.instanceCounter++,this.styles=new $(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=t,this.targetRoot=document.body,this.width=t.clientWidth,this.height=t.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(e.prototype,"ALL_MARKER_TYPES",{get:function(){return[ce,me,ve,fe,Ee,ke,xe,we,Se,ye,de,Oe]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ce,me,ve,fe,ke,xe,we]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ce,me,ve,fe,xe]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(e){var t=this;this._availableMarkerTypes.splice(0),e.forEach((function(e){if("string"==typeof e){var n=t.ALL_MARKER_TYPES.find((function(t){return t.typeName===e}));void 0!==n&&t._availableMarkerTypes.push(n)}else t._availableMarkerTypes.push(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(e){this._zoomLevel=e,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(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),K.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},e.prototype.show=function(){var e=this;void 0===this.styles.styleSheetRoot&&void 0!==q.styleSheetRoot&&(this.styles.styleSheetRoot=q.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(t){return t(new Ne(e))}))},e.prototype.render=function(){return H(this,void 0,void 0,(function(){var e;return W(this,(function(t){switch(t.label){case 0:return this.setCurrentMarker(),(e=new U).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.markersOnly=this.renderMarkersOnly,e.width=this.renderWidth,e.height=this.renderHeight,[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return t.sent(),[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,t.sent()]}}))}))},e.prototype.close=function(e){var t=this;if(void 0===e&&(e=!1),this.isOpen){var n=!1;e||this.eventListeners.beforeclose.forEach((function(e){var i=new Ne(t,!0);e(i),i.defaultPrevented&&(n=!0)})),n||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(e){return e(new Ne(t))})),this.detachEvents(),this._isOpen=!1)}},e.prototype.addMarkersToToolbar=function(){for(var e,t=[],n=0;nthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*e:this.editorCanvas.clientWidth,n=t',e.title="Powered by marker.js",e.style.display="grid",e.style.alignItems="center",e.style.justifyItems="center",e.style.padding="3px",e.style.width="20px",e.style.height="20px",this.logoUI.appendChild(e),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},e.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?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")},e.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"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&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 e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?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=void 0!==this.uiStyleSettings.zIndex?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="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Z(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","popup"===this.settings.displayMode&&(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","popup"===this.settings.displayMode&&(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(e),1),e.dispose()},e.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},e.prototype.toolbarButtonClicked=function(e,t){if("marker"===e&&void 0!==t)this.createNewMarker(t);else if("action"===e)switch(t){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},e.prototype.deleteSelectedMarker=function(){var e=this;if(void 0!==this._currentMarker){var t=!1;if(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new Le(e,e._currentMarker,!0);n(i),i.defaultPrevented&&(t=!0)})),!t){var n=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(t){return t(new Le(e,n))}))}}},e.prototype.clear=function(){var e=this,t=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(n){var i=new Le(e,void 0,!0);n(i),i.defaultPrevented&&(t=!0)})),!t)){this.setCurrentMarker();for(var n=function(t){var n=i.markers[t];i.setCurrentMarker(i.markers[t]),i._currentMarker.dispose(),i.markerImage.removeChild(i._currentMarker.container),i.markers.splice(i.markers.indexOf(i._currentMarker),1),i.eventListeners.markerdelete.forEach((function(t){return t(new Le(e,n))}))},i=this,r=this.markers.length-1;r>=0;r--)n(r);this.addUndoStep()}},Object.defineProperty(e.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),e.prototype.showNotesEditor=function(){var e;void 0!==this._currentMarker&&(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=null!==(e=this._currentMarker.notes)&&void 0!==e?e:"",this.overlayContainer.appendChild(this.notesArea))},e.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},e.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},e.prototype.addUndoStep=function(){var e=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var t=this.getState(),n=this.undoRedoManager.getLastUndoStep();if(!n||n.width===t.width&&n.height===t.height){var i=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(t),i1&&this.panTo({x:e.clientX,y:e.clientY}))},e.prototype.onPointerUp=function(e){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(e.clientX,e.clientY)),this.isDragging=!1,this.addUndoStep()},e.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},e.prototype.onKeyUp=function(e){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==e.key&&"Backspace"!==e.key||this.deleteSelectedMarker()},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.markerImage.getBoundingClientRect();return{x:(e-n.left)/this.zoomLevel,y:(t-n.top)/this.zoomLevel}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"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()},e.prototype.addLicenseKey=function(e){K.addKey(e)},e.prototype.addEventListener=function(e,t){this.eventListeners.addEventListener(e,t)},e.prototype.removeEventListener=function(e,t){this.eventListeners.removeEventListener(e,t)},e.prototype.renderState=function(e){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(e),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),e.prototype.focus=function(){var e=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(t){return t(new Ne(e))})))},e.prototype.blur=function(){var e=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(t){return t(new Ne(e))})))},e.instanceCounter=0,e}(),je=function(e,t){return(je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)}; /* ********************************** 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. ***************************************************************************** */function De(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}je(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Pe(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function Ie(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&t>0){var n=new qe(e,t),i=n.ratio>=1?20:n.getHorizontalLength(20),r=n.ratio<1?20:n.getVerticalLength(20),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(o);var a=Be.createDefs();o.appendChild(a);var s=Be.createElement("clipPath",[["id","text-bg-clip"]]);a.appendChild(s);var l=Be.createPath(Be.getHollowRectanglePath((24-i)/2,(24-r)/2,i,r,(24-i)/2+2,(24-r)/2+2,i-4,r-4));o.appendChild(l);var c=Be.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(Be.createTSpan(e+":"+t)),o.appendChild(c);var u=c.getBBox();Be.setAttributes(c,[["x",((24-u.width)/2).toString()],["y",((24-u.height)/2-u.y).toString()]]);var h=Be.createPath(Be.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(u.width))/2,(24-Math.ceil(u.height))/2,Math.ceil(u.width),Math.ceil(u.height)));return s.appendChild(h),Be.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(o),o.outerHTML}return''},e}(),Ye=function(e){function t(t,n,i){var r=e.call(this,t,n)||this;return r.isDropdownOpen=!1,r.onClick=r.dropdownButtonClicked,r.dropdownButtons=i,r}return De(t,e),t.prototype.setupDropdown=function(){var e=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach((function(t){t.className=e.className,t.colorsClassName=e.colorsClassName,e.dropdownBlock.appendChild(t.getUI())})),this.uiContainer.appendChild(this.dropdownBlock)},t.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},t.prototype.dropdownButtonClicked=function(){void 0===this.dropdownBlock&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},t.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},t.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},t.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},t}(Ke),Xe=function(){function e(e,t){this.GRIP_SIZE=10,this.color=e,this.fillColor=t,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",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e.prototype.setCenter=function(e,t){this.visual.childNodes.forEach((function(n){return Be.setAttributes(n,[["cx",e.toString()],["cy",t.toString()]])}))},e}(),Ze=function(){function e(e,t,n,i){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=e,this.canvasHeight=t,this.margin=n,this.container=i,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(e.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(e){this._aspectRatio=e,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(e){this._isGridVisible=e,this.gridContainer&&Be.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(e){this._zoomFactor=e,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),e.prototype.open=function(){var e=this;this.cropShadeElement=Be.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Be.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var t=0;tthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-t.height/2),Be.setAttributes(this.cropRectElement,[["x",t.x.toString()],["y",t.y.toString()],["width",t.width.toString()],["height",t.height.toString()]]);var n=t.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(e,i){var r=t.y+n*(i+1);Be.setAttributes(e,[["x1",""+t.x],["y1",""+r],["x2",""+(t.x+t.width)],["y2",""+r]])}));var i=t.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(e,n){var r=t.x+i*(n+1);Be.setAttributes(e,[["x1",""+r],["y1",""+t.y],["x2",""+r],["y2",""+(t.y+t.height)]])})),Be.setAttributes(this.cropShadeElement,[["d",Be.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,t.x,t.y,t.width,t.height)]]),this.topLeftGrip.setCenter(t.x,t.y),this.topRightGrip.setCenter(t.x+t.width,t.y),this.bottomLeftGrip.setCenter(t.x,t.y+t.height),this.bottomRightGrip.setCenter(t.x+t.width,t.y+t.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},e.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)},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.container.getBoundingClientRect();return{x:e-n.left+this.margin,y:t-n.top+this.margin}},e.prototype.onPointerDown=function(e){this.container.setPointerCapture(e.pointerId),this.previousPoint=this.clientToLocalCoordinates(e.clientX,e.clientY),this.cropRectElement===e.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(e.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(e.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(e.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(e.target)&&(this.activeGrip=this.bottomRightGrip)},e.prototype.onPointerMove=function(e){if(this.isMoving)this.move(this.clientToLocalCoordinates(e.clientX,e.clientY));else if(this.activeGrip){var t=this.clientToLocalCoordinates(e.clientX,e.clientY);this.resize(t)}e.preventDefault()},e.prototype.onPointerUp=function(e){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(e.pointerId)},e.prototype.move=function(e){var t=e.x-this.previousPoint.x,n=e.y-this.previousPoint.y;1!==this.zoomFactor&&(t=-t/this.zoomFactor,n=-n/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+t),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+n),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=e},e.prototype.resize=function(e){var t=Object.assign({},this.cropRect),n=e.x-this.previousPoint.x,i=e.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:t.x+nthis.canvasWidth*this.zoomFactor&&(n=this.canvasWidth*this.zoomFactor-t.width),t.width+=n}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(t.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(n),t.height=this.aspectRatio.getVerticalLength(t.width)):(t.y+=i,t.height=this.cropRect.y+this.cropRect.height-t.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?t.height=this.aspectRatio.getVerticalLength(t.width):t.height+=i}t.width<10&&(t.x=this.cropRect.x,t.width=10),t.height<10&&(t.y=this.cropRect.y,t.height=10),this.previousPoint=e,t.x>=this.margin&&t.y>=this.margin&&t.x-this.margin+t.width<=this.canvasWidth&&t.y-this.margin+t.height<=this.canvasHeight&&(this.cropRect=t,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},e.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var e=this.cropRect.x+this.cropRect.width/2,t=this.cropRect.y+this.cropRect.height/2,n=this.aspectRatio.getHorizontalLength(this.cropRect.height),i=this.aspectRatio.getVerticalLength(this.cropRect.width);n/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=e-this.cropRect.width/2,this.cropRect.y=t-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},e.prototype.getRescaledRect=function(e,t,n,i,r,o){var a=n/e,s=i/t;return{x:(r.x-o)*a+o,y:(r.y-o)*s+o,width:r.width*a,height:r.height*s}},e.prototype.scaleCanvas=function(e,t){var n=this.getRescaledRect(this.canvasWidth,this.canvasHeight,e,t,this.cropRect,this.margin);this.canvasWidth=e,this.canvasHeight=t,this.onCropChange&&this.onCropChange(n),this.setCropRectangle(n)},e}(),Je=function(){function e(e){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=e,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(e.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),e.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},e.prototype.onPointerDown=function(e){this.controlContainer.setPointerCapture(e.pointerId),this.isDragging=!0,this.previousPoint={x:e.clientX,y:e.clientY}},e.prototype.onPointerMove=function(e){this.isDragging&&(this.onAngleChange&&this.onAngleChange((e.clientX-this.previousPoint.x)/5),this.previousPoint.x=e.clientX)},e.prototype.onPointerUp=function(e){this.isDragging&&this.onAngleChange&&this.onAngleChange((e.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(e.pointerId)},e.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var e=this.angleLabelText.getBBox();Be.setAttributes(this.angleLabelElement,[["x",((this.width-e.width)/2).toString()],["y",(this.height/2).toString()]])}},e.prototype.positionScaleShape=function(){if(this.scaleShape){var e=this.scaleShape.transform.baseVal.getItem(0);e.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(e,0)}},e.prototype.getVisual=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("width",this.width+"px"),e.setAttribute("height",this.height+"px"),e.setAttribute("viewBox","0 0 "+this.width+" "+this.height),e.style.flexShrink="0",document.body.appendChild(e);for(var t="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,n=1;n<=this.width/5+10;n++){var i=n%5==0?this.height/3:this.height/6;t+="h4v"+-i+"h1v"+i}t+="v1H0Z",this.scaleShape=Be.createPath(t);var r=Be.createTransform();this.scaleShape.transform.baseVal.appendItem(r),e.appendChild(this.scaleShape),this.angleLabelElement=Be.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Be.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var o=Be.createTSpan("");return o.innerHTML="°",this.angleLabelElement.appendChild(o),e.appendChild(this.angleLabelElement),document.body.removeChild(e),e},e}(),Qe=function(){function e(){this.naturalSize=!1,this.imageType="image/png"}return e.prototype.rasterize=function(e,t,n,i,r,o,a){var s=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=e.width.baseVal.value-2*i,c.height=e.height.baseVal.value-2*i;var u=1,h=1;!0===s.naturalSize?(u=t.naturalWidth/(e.width.baseVal.value-2*i)/o,h=t.naturalHeight/(e.height.baseVal.value-2*i)/a,c.width=t.naturalWidth/o,c.height=t.naturalHeight/a):void 0!==s.width&&void 0!==s.height&&(u=s.width/n.width,h=s.height/n.height,c.width*=u,c.height*=h);var d=c.getContext("2d");d.translate(c.width/2,c.height/2),d.rotate(r*Math.PI/180),d.scale(o,a),d.translate(-c.width/2,-c.height/2),d.drawImage(t,0,0,c.width,c.height);var p=document.createElement("canvas");p.width=n.width*u,p.height=n.height*h,p.getContext("2d").putImageData(d.getImageData((n.x-i)*u,(n.y-i)*h,n.width*u,n.height*h),0,0),l(p.toDataURL(s.imageType,s.imageQuality))}))},e}(),et=function(){function e(t){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=e.instanceCounter++,this.styles=new ze(this.instanceNo),this.target=t,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(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(e){this._zoomToCropEnabled=e,e?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(e){this._isGridVisible=e,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gridLines",{get:function(){return this._gridLines},set:function(e){this._gridLines=e,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(e){this._rotationAngle=e,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){var e;return null!==(e=this._aspectRatio)&&void 0!==e?e:this.aspectRatios[0]},set:function(e){this._aspectRatio=e},enumerable:!1,configurable:!0}),e.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(),"popup"===this.displayMode&&this.onPopupResize(),this._isOpen=!0},e.prototype.show=function(){this.showUI(),this.open()},e.prototype.close=function(e){void 0===e&&(e=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.displayMode&&window.removeEventListener("resize",this.setWindowHeight),e||this.closeEventListeners.forEach((function(e){return e()})),this._isOpen=!1)},e.prototype.addRenderEventListener=function(e){this.renderEventListeners.push(e)},e.prototype.removeRenderEventListener=function(e){this.renderEventListeners.indexOf(e)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(e),1)},e.prototype.addCloseEventListener=function(e){this.closeEventListeners.push(e)},e.prototype.removeCloseEventListener=function(e){this.closeEventListeners.indexOf(e)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(e),1)},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},e.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.contentDiv.clientWidth/e>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*e:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,n=t+2*this.CANVAS_MARGINe+this.CANVAS_MARGIN?this.target.offsetTop-(e+this.CANVAS_MARGIN):0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=void 0!==this.styles.settings.zIndex?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=void 0!==this.styles.settings.zIndex?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="popup"===this.displayMode?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,"popup"===this.displayMode&&(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","popup"===this.displayMode&&(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},e.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},e.prototype.addTopToolbar=function(){var e=this;this.topToolbar=new We,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var t=new Ge;t.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(t);var n=[];this.aspectRatios.forEach((function(t){var i=new Ke($e.getIcon(t.horizontal,t.vertical),0===t.horizontal&&0===t.vertical?"FREE":t.horizontal+":"+t.vertical);i.onClick=function(){return e.ratioButtonClicked(t)},n.push(i)})),this.aspectRatioButton=new Ye($e.getIcon(0,0),"Aspect ratio",n),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,t.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var i=new Ke('',"Toggle grid");i.isActive=this.isGridVisible,i.onClick=function(){e.isGridVisible=!e.isGridVisible,i.isActive=e.isGridVisible},t.addButton(i);var r=new Ke('',"Zoom to selection");if(r.isActive=this.zoomToCropEnabled,r.onClick=function(){e.zoomToCropEnabled=!e.zoomToCropEnabled,r.isActive=e.zoomToCropEnabled},t.addButton(r),!Re.isLicensed){var o=new Ue;this.topToolbar.addElementBlock(o);var a=document.createElement("div");a.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var s=document.createElement("a");s.style.color="currentColor",s.href="https://markerjs.com/products/cropro",s.target="_blank",s.innerHTML='',a.appendChild(s),o.addElement(a)}var l=new Ge;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new Ke('',"OK");c.onClick=this.startRenderAndClose,l.addButton(c),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(c.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var u=new Ke('',"Close");u.onClick=this.close,l.addButton(u),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(u.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},e.prototype.addBottomToolbar=function(){var e=this;this.bottomToolbar=new We,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var t=new Ge;t.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(t);var n=new Ke('',"Rotate left");n.onClick=this.rotateLeftButtonClicked,t.addButton(n);var i=new Ke('',"Rotate right");i.onClick=this.rotateRightButtonClicked,t.addButton(i);var r=new Ue;r.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(r),this.straightener=new Je("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(t){e.rotateBy(t),e.straightener.angle=e.rotationAngle},r.addElement(this.straightener.getUI());var o=new Ge;o.minWidth=2*this.toolbarHeight+"px",o.contentAlign="end",this.bottomToolbar.addButtonBlock(o);var a=new Ke('',"Flip horizontal");a.onClick=this.flipHorizontallyButtonClicked,o.addButton(a);var s=new Ke('',"Flip vertical");s.onClick=this.flipVerticallyButtonClicked,o.addButton(s)},e.prototype.ratioButtonClicked=function(e){this.aspectRatio=e,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},e.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=$e.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},e.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&0!==this.aspectRatio.horizontal&&0!==this.aspectRatio.vertical?this.cropLayer.aspectRatio=new qe(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},e.prototype.closeUI=function(){"popup"===this.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},e.prototype.restoreState=function(e){if(e){var t=this.cropLayer.getRescaledRect(e.width,e.height,this.imageWidth,this.imageHeight,e.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(t),this.cropRectChanged(t),this.flippedHorizontally=e.flippedHorizontally,this.flippedVertically=e.flippedVertically,this.applyFlip(),this.rotationAngle=e.rotationAngle,this.applyRotation()}},e.prototype.clientToLocalCoordinates=function(e,t){var n=this.cropImage.getBoundingClientRect();return{x:e-n.left,y:t-n.top}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var e=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=e+"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()},e.prototype.rotateLeftButtonClicked=function(){var e=this.rotationAngle-90;this.rotationAngle%90!=0&&(e+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(e)},e.prototype.rotateRightButtonClicked=function(){var e=this.rotationAngle+90;this.rotationAngle%90!=0&&(e-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(e)},e.prototype.rotateTo=function(e){e=(e=e>180?e-360:e)<=-180?e+360:e,this.rotationAngle=e,this.applyRotation()},e.prototype.rotateBy=function(e){this.rotateTo((this.rotationAngle+e)%360)},e.prototype.applyRotation=function(){var e=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var t=this.editingTargetRotationContainer.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(t,0);var n=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/n.width,this.imageHeight/n.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=e},e.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},e.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},e.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},e.prototype.startRenderAndClose=function(){return Pe(this,void 0,void 0,(function(){var e,t;return Ie(this,(function(n){switch(n.label){case 0:return[4,this.render()];case 1:return e=n.sent(),t=this.getState(),this.renderEventListeners.forEach((function(n){return n(e,t)})),this.close(!0),[2]}}))}))},e.prototype.render=function(){return Pe(this,void 0,void 0,(function(){var e;return Ie(this,(function(t){switch(t.label){case 0:return(e=new Qe).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.width=this.renderWidth,e.height=this.renderHeight,this.unzoomFromCrop(),Be.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,e.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return t.sent(),[4,e.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,t.sent()]}}))}))},e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new He("toolbar","\n width: "+("inline"===this.displayMode?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+";\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.toolbarHeight+"px;\n box-sizing: content-box;\n overflow: hidden;\n line-height: 0px;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new He("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new He("toolbar-block","\n display: flex;\n align-items: center;\n box-sizing: content-box;\n "));var e=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new He("toolbar_button","\n display: inline-block;\n width: "+(this.toolbarHeight-2*e)+"px;\n height: "+(this.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new He("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new He("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new Fe("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Fe("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new He("toolbar_dropdown","\n position: absolute;\n max-width: "+4*this.toolbarHeight+"px;\n z-index: 20;\n white-space: normal;\n box-sizing: content-box;\n box-shadow: 3px 3px rgba(33, 33, 33, 0.1);\n margin: "+("inline"===this.displayMode?"0":this.popupMargin)+"px;\n line-height: 0px;\n ")),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new He("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new He("toolbar_straightener_block","\n display: flex;\n overflow: hidden;\n justify-content: center;\n -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%);\n ")),this.toolbarStraightenerStyleClass=this.styles.addClass(new He("toolbar_straightener","\n display: flex;\n overflow: hidden;\n justify-content: center;\n height: "+(this.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new He("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},e.instanceCounter=0,e}(),tt=n("8hTe"),nt=n.n(tt),it=/]*>/g;t.a=function(e){var t=e.value,n=void 0===t?"":t,l=e.edit,d=void 0!==l&&l,p=e.className,f=e.showTextOnly,m=e.showLines,g=e.replaces,v=e.zoomImg,y=e.hasMask,w=e.style,k=void 0===w?{}:w,S=e.stylesPrev,E=void 0===S?{}:S,N=String(n),T=Object(u.useRef)(),L=Object(u.useRef)(),A=Object(u.useState)(""),j=Object(s.a)(A,2),z=j[0],F=j[1],H=Object(u.useState)("office"),W=Object(s.a)(H,2),V=W[0],G=W[1],K=Object(u.useMemo)((function(){try{N=(N=N.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+P.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+P.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+P.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,"\n")).replace(new RegExp("(?[TOC]

",C()),b()),e=(e=e.replace(/(__special_katext_id_\d+__)/g,(function(e,n){var i=t[n],r=i.type,o=i.expression;return Object(I.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),O(),f){var n=document.createElement("div");return n.innerHTML=e,n.innerText}return setTimeout((function(){return $()}),500),e}),[N]),U=Object(u.useRef)();function q(e){var t=e.target;if("IMG"===t.tagName.toUpperCase()){if(v){var n=t.getAttribute("src");F(n),G("image")}}else if("A"===t.tagName.toUpperCase()){var i=t.getAttribute("href");if(i.indexOf("office")>-1)e.preventDefault(),F(i),G("office");else if(i.indexOf("application/pdf")>-1)e.preventDefault(),F(i),G("pdf");else if(i.indexOf("type=text")>-1)e.preventDefault(),F(i),G("html");else if(i.startsWith("#")){e.preventDefault();var r=document.getElementById(i.replace("#",""));r&&r.scrollIntoView(!0)}}}x.WebkitLineClamp=m,m&&(k=Object(o.a)(Object(o.a)({},k),x));var $=function(){var e,t=null===(e=U.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(D.a.isSupported()){var t=new D.a;t.loadSource(e.src),t.attachMedia(e)}}))};Object(u.useEffect)((function(){if(U.current&&K&&K.match(it)&&window.PR.prettyPrint(),U.current)return U.current.addEventListener("click",q),function(){U.current.removeEventListener("click",q),O(),b()}}),[K,U.current,q]);return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:U,style:Object(o.a)({},k),className:"".concat(p||""," markdown-body ").concat(nt.a.mdBody),onMouseOver:function(e){d&&("IMG"===e.target.nodeName?(T.current.style.display="flex",T.current.style.width=e.target.clientWidth+"px",T.current.style.height=e.target.clientHeight+"px",T.current.style.top=e.target.offsetTop+"px",T.current.style.left=e.target.offsetLeft+"px",L.current.src=e.target.getAttribute("src")):T.current.style.display="none")},dangerouslySetInnerHTML:{__html:K}}),h.a.createElement("div",{ref:T,className:nt.a.button},h.a.createElement(i.a,null,h.a.createElement(r.a,{onClick:function(){return(e=new et(L.current)).displayMode="popup",e.addRenderEventListener(function(){var e=Object(a.a)(c.a.mark((function e(t){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T.current.style.display="none",e.next=3,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:t}});case 3:null!=(n=e.sent)&&n.id&&g(L.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),void e.show();var e}},"裁剪"),h.a.createElement(r.a,{onClick:function(){return(e=new Me(L.current)).settings.displayMode="popup",e.addEventListener("render",function(){var e=Object(a.a)(c.a.mark((function e(t){var n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(T.current.style.display="none",!L.current){e.next=6;break}return e.next=4,Object(B.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:t.dataUrl}});case 4:null!=(n=e.sent)&&n.id&&g(L.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==n?void 0:n.id,"?type=").concat(n.content_type));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.show(),void(window.markerArea=e);var e}},"编辑"))),h.a.createElement("img",{ref:L,src:"https://ali-cdn.educoder.net/images/avatars/PortalImage/170?t=1659681136",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),h.a.createElement(R.a,{close:!0,data:z,hasMask:y,type:null!=z&&z.length?V:"",style:Object(o.a)({},E),onClose:function(){return F("")}}))}},"9VGf": /*!****************************************!*\ !*** ./src/components/useInterval.tsx ***! \****************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(/*! react */"q1tI");function r(e,t){var n=Object(i.useRef)();Object(i.useEffect)((function(){n.current=e})),Object(i.useEffect)((function(){if(null!==t){var e=setInterval((function(){n.current()}),t);return function(){return clearInterval(e)}}}),[t])}},"A+k2": /*!*************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/Tabs/index.less?modules ***! \*************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={tabs:"tabs___2hYAP",active:"active___2Xkwd"}},Bd2K: /*!********************************************************!*\ !*** ./node_modules/codemirror/addon/edit/closetag.js ***! \********************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){e.defineOption("autoCloseTags",!1,(function(a,s,l){if(l!=e.Init&&l&&a.removeKeyMap("autoCloseTags"),s){var c={name:"autoCloseTags"};"object"==typeof s&&!1===s.whenClosing||(c["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:i(t,!0)}(t)}),"object"==typeof s&&!1===s.whenOpening||(c["'>'"]=function(i){return function(i){if(i.getOption("disableInput"))return e.Pass;for(var a=i.listSelections(),s=[],l=i.getOption("autoCloseTags"),c=0;cu.ch&&(m=m.slice(0,m.length-h.end+u.ch));var b=m.toLowerCase();if(!m||"string"==h.type&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&f.close||h.string.indexOf("/")==u.ch-h.start-1||v&&r(v,b)>-1||o(i,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(p)||[],m,u,!0))return e.Pass;var x="object"==typeof l&&l.emptyTags;if(x&&r(x,m)>-1)s[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var C=y&&r(y,b)>-1;s[c]={indent:C,text:">"+(C?"\n\n":"")+"",newPos:C?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var w="object"==typeof l&&l.dontIndentOnAutoClose;for(c=a.length-1;c>=0;c--){var k=s[c];i.replaceRange(k.text,a[c].head,a[c].anchor,"+insert");var S=i.listSelections().slice(0);S[c]={head:k.newPos,anchor:k.newPos},i.setSelections(S),!w&&k.indent&&(i.indentLine(k.newPos.line,null,!0),i.indentLine(k.newPos.line+1,null,!0))}}(i)}),a.addKeyMap(c)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],n=["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 i(t,n){for(var i=t.listSelections(),r=[],a=n?"/":""!=t.getLine(u.line).charAt(h.end)&&(f+=">"),r[c]=f}if(t.replaceSelections(r),i=t.listSelections(),!l)for(c=0;c=0&&n[c]==i;c--)++l;for(r=s.to,c=1;c0){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=0;i=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n>6),t+=String.fromCharCode(128|63&i)):i<55296||i>=57344?(t+=String.fromCharCode(224|i>>12),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|63&i)):(n++,i=65536+((1023&i)<<10|1023&e.charCodeAt(n)),t+=String.fromCharCode(240|i>>18),t+=String.fromCharCode(128|i>>12&63),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|63&i))}return t}var C={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1};function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return e.forEach((function(e,i){var r=null;e.forEach((function(o,a){if(!o&&null!==r)return n.push("M".concat(r+t," ").concat(i+t,"h").concat(a-r,"v1H").concat(r+t,"z")),void(r=null);if(a!==e.length-1)o&&null===r&&(r=a);else{if(!o)return;null===r?n.push("M".concat(a+t,",").concat(i+t," h1v1H").concat(a+t,"z")):n.push("M".concat(r+t,",").concat(i+t," h").concat(a+1-r,"v1H").concat(r+t,"z"))}}))})),n.join("")}function k(e,t){return e.slice().map((function(e,n){return n=t.y+t.h?e:e.map((function(e,n){return(n=t.x+t.w)&&e}))}))}function S(e,t){var n=e.imageSettings,i=e.size,r=e.includeMargin;if(null==n)return null;var o=r?4:0,a=t.length+2*o,s=Math.floor(.1*i),l=a/i,c=(n.width||s)*l,u=(n.height||s)*l,h=null==n.x?t.length/2-c/2:n.x*l,d=null==n.y?t.length/2-u/2:n.y*l,p=null;if(n.excavate){var f=Math.floor(h),m=Math.floor(d);p={x:f,y:m,w:Math.ceil(c+h-f),h:Math.ceil(u+d-m)}}return{x:h,y:d,h:u,w:c,excavation:p}}var E=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}(),_=function(e){function t(){var e,n;l(this,t);for(var i=arguments.length,r=new Array(i),o=0;oe.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(i=e[Symbol.iterator]()).next.bind(i)}var i=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){function t(){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}}e.exports={defaults:{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},getDefaults:t,changeDefaults:function(t){e.exports.defaults=t}}})),r=(i.defaults,i.getDefaults,i.changeDefaults,/[&<>"']/),o=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return l[e]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var d=/(^|[^\[])\^/g,p=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,m={},g=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(e,t){m[" "+e]||(g.test(e)?m[" "+e]=e+"/":m[" "+e]=x(e,"/",!0));var n=-1===(e=m[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(v,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(y,"$1")+t:e+t}function x(e,t,n){var i=e.length;if(0===i)return"";for(var r=0;r=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n.length>t)n.splice(t);else for(;n.length1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var n=this.rules.block.code.exec(e);if(n){var i=t[t.length-1];if(i&&"paragraph"===i.type)return{raw:n[0],text:n[0].trimRight()};var r=n[0].replace(/^ {4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:M(r,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],i=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var i=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=i.length?e.slice(i.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:i}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:j(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var i,r=n.align.length;for(i=0;i ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){for(var n,i,r,o,a,s,l,c=t[0],u=t[2],h=u.length>1,d=")"===u[u.length-1],p={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},f=t[0].match(this.rules.block.item),m=!1,g=f.length,v=0;v1||this.options.smartLists&&r!==u)&&(o=f.slice(v+1).join("\n"),p.raw=p.raw.substring(0,p.raw.length-o.length),v=g-1)),a=m||/\n\n(?!\s*$)/.test(n),v!==g-1&&(m="\n"===n.charAt(n.length-1),a||(a=m)),a&&(p.loose=!0),l=void 0,(s=/^\[[ xX]\] /.test(n))&&(l=" "!==n[1],n=n.replace(/^\[[ xX]\] +/,"")),p.items.push({type:"list_item",raw:c,task:s,checked:l,loose:a,text:n});return p}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):D(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var n={type:"table",header:j(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=t[0];var i,r=n.align.length;for(i=0;i/i.test(i[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:i[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):D(i[0]):i[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=P(t[2],"()");if(n>-1){var i=(0===t[0].indexOf("!")?5:4)+t[1].length+n;t[2]=t[2].substring(0,n),t[0]=t[0].substring(0,i).trim(),t[3]=""}var r=t[2],o="";if(this.options.pedantic){var a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);a?(r=a[1],o=a[3]):o=""}else o=t[3]?t[3].slice(1,-1):"";return I(t,{href:(r=r.trim().replace(/^<([\s\S]*)>$/,"$1"))?r.replace(this.rules.inline._escapes,"$1"):r,title:o?o.replace(this.rules.inline._escapes,"$1"):o},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=t[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return I(n,i,n[0])}},t.strong=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.strong.start.exec(e);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var r,o="**"===i[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(i=o.exec(t));)if(r=this.rules.inline.strong.middle.exec(t.slice(0,i.index+3)))return{type:"strong",raw:e.slice(0,r[0].length),text:e.slice(2,r[0].length-2)}}},t.em=function(e,t,n){void 0===n&&(n="");var i=this.rules.inline.em.start.exec(e);if(i&&(!i[1]||i[1]&&(""===n||this.rules.inline.punctuation.exec(n)))){t=t.slice(-1*e.length);var r,o="*"===i[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(i=o.exec(t));)if(r=this.rules.inline.em.middle.exec(t.slice(0,i.index+2)))return{type:"em",raw:e.slice(0,r[0].length),text:e.slice(1,r[0].length-1)}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=n.startsWith(" ")&&n.endsWith(" ");return i&&r&&(n=n.substring(1,n.length-1)),n=D(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}},t.autolink=function(e,t){var n,i,r=this.rules.inline.autolink.exec(e);if(r)return i="@"===r[2]?"mailto:"+(n=D(this.options.mangle?t(r[1]):r[1])):n=D(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var i,r;if("@"===n[2])r="mailto:"+(i=D(this.options.mangle?t(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=D(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}},t.inlineText=function(e,t,n){var i,r=this.rules.inline.text.exec(e);if(r)return i=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):D(r[0]):r[0]:D(this.options.smartypants?n(r[0]):r[0]),{type:"text",raw:r[0],text:i}},e}(),B=E,z=k,F=_,H={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:B,table:B,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};H.def=z(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,H.item=z(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.list=z(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._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",H._comment=//,H.html=z(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=z(H._paragraph).replace("hr",H.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",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.blockquote=z(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=F({},H),H.gfm=F({},H.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*|$)"}),H.gfm.nptable=z(H.gfm.nptable).replace("hr",H.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",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.gfm.table=z(H.gfm.table).replace("hr",H.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",")|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.pedantic=F({},H.normal,{html:z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",H._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:B,paragraph:z(H.normal._paragraph).replace("hr",H.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var W={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:B,tag:"^comment|^|^<[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:B,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};W.punctuation=z(W.punctuation).replace(/punctuation/g,W._punctuation).getRegex(),W._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",W._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",W.em.start=z(W.em.start).replace(/punctuation/g,W._punctuation).getRegex(),W.em.middle=z(W.em.middle).replace(/punctuation/g,W._punctuation).replace(/overlapSkip/g,W._overlapSkip).getRegex(),W.em.endAst=z(W.em.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.em.endUnd=z(W.em.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.start=z(W.strong.start).replace(/punctuation/g,W._punctuation).getRegex(),W.strong.middle=z(W.strong.middle).replace(/punctuation/g,W._punctuation).replace(/blockSkip/g,W._blockSkip).getRegex(),W.strong.endAst=z(W.strong.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.endUnd=z(W.strong.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.blockSkip=z(W._blockSkip,"g").getRegex(),W.overlapSkip=z(W._overlapSkip,"g").getRegex(),W._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,W._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,W._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,W.autolink=z(W.autolink).replace("scheme",W._scheme).replace("email",W._email).getRegex(),W._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,W.tag=z(W.tag).replace("comment",H._comment).replace("attribute",W._attribute).getRegex(),W._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,W._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,W._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,W.link=z(W.link).replace("label",W._label).replace("href",W._href).replace("title",W._title).getRegex(),W.reflink=z(W.reflink).replace("label",W._label).getRegex(),W.reflinkSearch=z(W.reflinkSearch,"g").replace("reflink",W.reflink).replace("nolink",W.nolink).getRegex(),W.normal=F({},W),W.pedantic=F({},W.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:z(/^!?\[(label)\]\((.*?)\)/).replace("label",W._label).getRegex(),reflink:z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W._label).getRegex()}),W.gfm=F({},W.normal,{escape:z(W.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var Y=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||G,this.options.tokenizer=this.options.tokenizer||new R,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:K.normal,inline:U.normal};this.options.pedantic?(t.block=K.pedantic,t.inline=U.pedantic):this.options.gfm&&(t.block=K.gfm,this.options.breaks?t.inline=U.breaks:t.inline=U.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)};var n,i,r,o=t.prototype;return o.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(e,t,n){var i,r,o,a;for(void 0===t&&(t=[]),void 0===n&&(n=!0),e=e.replace(/^ +$/gm,"");e;)if(i=this.tokenizer.space(e))e=e.substring(i.raw.length),i.type&&t.push(i);else if(i=this.tokenizer.code(e,t))e=e.substring(i.raw.length),i.type?t.push(i):((a=t[t.length-1]).raw+="\n"+i.raw,a.text+="\n"+i.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.nptable(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),i.tokens=this.blockTokens(i.text,[],n),t.push(i);else if(i=this.tokenizer.list(e)){for(e=e.substring(i.raw.length),o=i.items.length,r=0;r0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(s));)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(o=this.tokenizer.escape(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.tag(e,n,i))e=e.substring(o.raw.length),n=o.inLink,i=o.inRawBlock,t.push(o);else if(o=this.tokenizer.link(e))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),t.push(o);else if(o=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,i)),t.push(o);else if(o=this.tokenizer.strong(e,s,r))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);else if(o=this.tokenizer.em(e,s,r))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);else if(o=this.tokenizer.codespan(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.br(e))e=e.substring(o.raw.length),t.push(o);else if(o=this.tokenizer.del(e))e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],n,i),t.push(o);else if(o=this.tokenizer.autolink(e,$))e=e.substring(o.raw.length),t.push(o);else if(n||!(o=this.tokenizer.url(e,$))){if(o=this.tokenizer.inlineText(e,i,q))e=e.substring(o.raw.length),r=o.raw.slice(-1),t.push(o);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(o.raw.length),t.push(o);return t},n=t,r=[{key:"rules",get:function(){return{block:K,inline:U}}}],(i=null)&&e(n.prototype,i),r&&e(n,r),t}(),X=i.defaults,Z=S,J=C,Q=function(){function e(e){this.options=e||X}var t=e.prototype;return t.code=function(e,t,n){var i=(t||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(e,i);null!=r&&r!==e&&(n=!0,e=r)}return i?'
'+(n?e:J(e,!0))+"
\n":"
"+(n?e:J(e,!0))+"
\n"},t.blockquote=function(e){return"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,n,i){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
\n":"
\n"},t.list=function(e,t,n){var i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,n){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return n;var i='"},t.image=function(e,t,n){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return n;var i=''+n+'":">"},t.text=function(e){return e},e}(),ee=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),te=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),ne=i.defaults,ie=w,re=function(){function e(e){this.options=e||ne,this.options.renderer=this.options.renderer||new Q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,n){return new e(n).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,i,r,o,a,s,l,c,u,h,d,p,f,m,g,v,y,b,x="",C=e.length;for(n=0;n0&&"text"===g.tokens[0].type?(g.tokens[0].text=b+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=b+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:b}):m+=b),m+=this.parse(g.tokens,f),u+=this.renderer.listitem(m,y,v);x+=this.renderer.list(u,d,p);continue;case"html":x+=this.renderer.html(h.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;n+1An error occurred:

    "+se(e.message+"",!0)+"
    ";throw e}}return he.options=he.setOptions=function(e){return oe(he.defaults,e),ce(he.defaults),he},he.getDefaults=le,he.defaults=ue,he.use=function(e){var t=oe({},e);if(e.renderer&&function(){var n=he.defaults.renderer||new Q,i=function(t){var i=n[t];n[t]=function(){for(var r=arguments.length,o=new Array(r),a=0;ae.length){var c=Object(J.xor)(s,e);console.log(c,"newLevel"),l=l.filter((function(e){return!c.includes(e)}))}i(l),h(e.length===(null==r||null===(o=r.tag_disciplines)||void 0===o?void 0:o.length))}}))):m.a.createElement(m.a.Fragment,null)},te=n("ErOA"),ne=(n("ozfa"),n("MJZm")),ie=n("0Owb"),re=n("tmPe"),oe=n.n(re),ae=function(e){var t=e.value,n=e.onChange,i=e.defaultValue,r=e.treeData,o=void 0===r?[]:r,a=Object(Y.a)(e,["value","onChange","defaultValue","treeData"]);return m.a.createElement("div",{className:oe.a.customTree},m.a.createElement(ne.a,Object(ie.a)({multiple:!0,showIcon:!0,selectedKeys:t,defaultExpandedKeys:i,treeData:o,onSelect:n},a)))},se=n("sbIO"),le=h.a.Search,ce=function(e){var t,n=e.formValue,o=e.setFatherTabs,c=e.tabs,h=e.editData,d=e.dispatch,y=Object(g.i)().id,b=Object(f.useState)(["mine"]),x=Object(u.a)(b,2),C=x[0],N=x[1],A=Object(f.useState)(!0),j=Object(u.a)(A,2),P=j[0],R=j[1],z=Object(f.useState)(!1),H=Object(u.a)(z,2),V=H[0],K=H[1],Y=Object(f.useState)(!1),X=Object(u.a)(Y,2),Z=X[0],Q=X[1],ne=Object(f.useState)(0),ie=Object(u.a)(ne,2),re=ie[0],oe=ie[1],ce=Object(f.useState)(""),ue=Object(u.a)(ce,2),he=ue[0],de=ue[1],pe=Object(f.useState)(!1),fe=Object(u.a)(pe,2),me=fe[0],ge=fe[1],ve=Object(f.useState)(!1),ye=Object(u.a)(ve,2),be=ye[0],xe=ye[1],Ce=Object(f.useState)({}),we=Object(u.a)(Ce,2),ke=we[0],Se=we[1],Ee=Object(f.useState)([]),_e=Object(u.a)(Ee,2),Oe=_e[0],Ne=_e[1],Te=Object(f.useState)([]),Le=Object(u.a)(Te,2),Ae=Le[0],Me=Le[1],je=Object(f.useState)([]),De=Object(u.a)(je,2),Pe=De[0],Ie=De[1],Re=Object(f.useState)([]),Be=Object(u.a)(Re,2),ze=Be[0],Fe=Be[1],He=Object(f.useState)(null),We=Object(u.a)(He,2),Ve=We[0],Ge=We[1],Ke=Object(f.useRef)([]),Ue=Object(f.useState)(!1),qe=Object(u.a)(Ue,2),$e=qe[0],Ye=qe[1],Xe=Object(f.useState)([]),Ze=Object(u.a)(Xe,2),Je=Ze[0],Qe=Ze[1],et=Object(f.useState)([0]),tt=Object(u.a)(et,2),nt=tt[0],it=tt[1],rt=Object(f.useState)([]),ot=Object(u.a)(rt,2),at=ot[0],st=ot[1],lt=Object(f.useRef)([]),ct=Object(f.useState)(!1),ut=Object(u.a)(ct,2),ht=ut[0],dt=ut[1],pt=Object(f.useState)([]),ft=Object(u.a)(pt,2),mt=ft[0],gt=ft[1],vt=Object(f.useState)([]),yt=Object(u.a)(vt,2),bt=yt[0],xt=yt[1],Ct=Object(f.useRef)([]),wt=Object(f.useState)([]),kt=Object(u.a)(wt,2),St=kt[0],Et=kt[1],_t=Object(f.useState)(!1),Ot=Object(u.a)(_t,2),Nt=Ot[0],Tt=Ot[1],Lt=Object(f.useRef)([]),At=Object(f.useState)(0),Mt=Object(u.a)(At,2),jt=Mt[0],Dt=Mt[1],Pt=null==at?void 0:at.filter((function(e){return null==Je?void 0:Je.includes(e.id)})),It=null==bt?void 0:bt.filter((function(e){return null==mt?void 0:mt.includes(e.id)}));Object(f.useEffect)((function(){Wt()}),[]),Object(f.useEffect)((function(){return 1===c&&(d({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),d({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1})),function(){d({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),d({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}}),[c]),Object(f.useEffect)((function(){y?h&&Vt():(Kt(C),Ut(),R(!1))}),[h]),Object(f.useEffect)((function(){he&&Ft()}),[he]);var Rt,Bt,zt,Ft=function(){var e=null;null==Ae||Ae.forEach((function(t){var n;null===(n=t.sub_disciplines)||void 0===n||n.forEach((function(n){var i;null===(i=n.tag_disciplines)||void 0===i||i.forEach((function(n){var i;(null===(i=n.name)||void 0===i?void 0:i.includes(he))&&0!==n.item_count&&!e&&(e=t.id)}))}))})),e&&Ge(e)},Ht=function(e){return null==e?void 0:e.map((function(e){return function e(t){var n=t.children,i=Array.isArray(n)&&n.length>0,r=null==t?void 0:t.group_id;return Lt.current.push({name:null==t?void 0:t.name,id:r,count:null==t?void 0:t.count}),{title:m.a.createElement("div",{title:null==t?void 0:t.name,className:T.a.name},null==t?void 0:t.name,"(".concat(null==t?void 0:t.count,")")),value:r,name:null==t?void 0:t.name,key:r,count:null==t?void 0:t.count,id:r,icon:m.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:i?null==n?void 0:n.map((function(t){return e(t)})):[]}}(e)}))},Wt=function(){var e=Object(s.a)(p.a.mark((function e(){var t,n;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(L.z)({});case 2:t=e.sent,Lt.current=[{id:0,name:"根目录",count:null==t?void 0:t.root_count}],null!=t&&t.data&&(n=[{title:m.a.createElement("div",{title:"根目录",className:T.a.name},"根目录","(".concat((null==t?void 0:t.root_count)||0,")")),value:0,id:0,key:0,count:null==t?void 0:t.root_count,name:"根目录",icon:m.a.createElement("i",{className:"iconfont icon-wenjianjia2 c-light-primary mr10",style:{lineHeight:"19px"}}),children:Ht(t.data||[])}],st(Lt.current),Et(n));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Vt=function(){var e=Object(s.a)(p.a.mark((function e(){var t,n,i,r,o,a,s,c,u,d,f,m,g,v,y,b,x,C;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return d=null==h||null===(t=h.tag_disciplines)||void 0===t?void 0:t.map((function(e){return e.tag_discipline_id})),f=null==h||null===(n=h.groups)||void 0===n?void 0:n.map((function(e){return e.id})),m={source:null==h||null===(i=h.examination_bank)||void 0===i?void 0:i.source,group_ids:f,tag_discipline_ids:d,teach_group_ids:null==h?void 0:h.teach_group_ids},e.next=5,Object(te.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:m});case 5:if(-1!==(null==(g=e.sent)?void 0:g.status)){e.next=8;break}return e.abrupt("return");case 8:v=(v=null==g?void 0:g.filter((function(e){var t;return!(null==e||null===(t=e.item_banks)||void 0===t||!t.length)}))).map((function(e){return Object(l.a)(Object(l.a)({},e),{},{scoreTotal:0,score:0,questionTotal:0})})),v=null===(r=v)||void 0===r?void 0:r.map((function(e,t){var n,i,r;return Object(l.a)(Object(l.a)({},e),{},{score:(null==h||null===(n=h.score_settings)||void 0===n||null===(i=n.find((function(t){return t.item_type===(null==e?void 0:e.item_type)})))||void 0===i?void 0:i.score)||0,item_banks:null==e||null===(r=e.item_banks)||void 0===r?void 0:r.map((function(t){var n;return Object(l.a)(Object(l.a)({},t),{},{tag_disciplines:null==t||null===(n=t.tag_disciplines)||void 0===n?void 0:n.map((function(n){var i;return Object(l.a)(Object(l.a)({},n),{},{difficulties:null==n||null===(i=n.difficulties)||void 0===i?void 0:i.map((function(i){var r=null==h?void 0:h.contents.find((function(r){return r.item_type===e.item_type&&r.sub_discipline_id===t.sub_discipline_id&&r.tag_discipline_id===n.tag_discipline_id&&r.difficulty===i.difficulty}));return r?Object(l.a)(Object(l.a)({},i),{},{num:null==r?void 0:r.quanlity}):Object(l.a)({},i)}))})}))})}))})})),y=Yt(v),b=y.panel,x=y.score_num_item,v=null===(o=v)||void 0===o?void 0:o.map((function(e,t){var n,i=(null==b||null===(n=b[t])||void 0===n?void 0:n.reduce((function(e,t){return e+t}),0))||0;return Object(l.a)(Object(l.a)({},e),{},{scoreTotal:i*(x[t]||0),questionTotal:i})})),C=[],null==h||null===(a=h.sort_by_item_type)||void 0===a||a.forEach((function(e){var t=v.find((function(t){var n;return(null===(n=Jt.find((function(e){return e.type===(null==t?void 0:t.item_type)})))||void 0===n?void 0:n.name)===e}));C.push(t)})),C=Object(J.compact)(C),Kt(null==h||null===(s=h.examination_bank)||void 0===s?void 0:s.source),Ut(),N(null==h||null===(c=h.examination_bank)||void 0===c?void 0:c.source),Fe(d),Ke.current=d,Qe(f),gt((null==h?void 0:h.teach_group_ids)||[]),Dt(null==h||null===(u=h.groups)||void 0===u?void 0:u.map((function(e){return e.count})).reduce((function(e,t){return e+t}),0)),lt.current=f,it(null!=f&&f.length?f:[0]),Ne(Object(J.cloneDeep)(C)),R(!1);case 29:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Gt=function(){var e=Object(s.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:mt,item_bank_quotes:re}),Ke.current=ze,ge(!1);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Kt=function(){var e=Object(s.a)(p.a.mark((function e(t){var n,i,r,o,a,s;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(te.a)("/api/disciplines.json",{method:"get",params:{source:"question",question_source:t}});case 2:r=e.sent,o=[],null==r||null===(n=r.disciplines)||void 0===n||n.forEach((function(e){var t;null==e||null===(t=e.sub_disciplines)||void 0===t||t.forEach((function(e){o=o.concat((null==e?void 0:e.tag_disciplines)||[])}))})),a=null,s=null==r||null===(i=r.disciplines)||void 0===i?void 0:i.map((function(e){var t,n=null==e||null===(t=e.sub_disciplines)||void 0===t?void 0:t.reduce((function(e,t){return e+t.item_count}),0);return a||0===n||(a=e.id),Object(l.a)(Object(l.a)({},e),{},{item_count:n})})),console.log(s,48767874),Me(s),Ie(o),Ge(a);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ut=function(){var e=Object(s.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(te.a)("/api/teach_groups.json",{method:"get",params:{is_random_exam:!0}});case 2:t=e.sent,xt((null==t?void 0:t.groups)||[]);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qt=function(){var e=Object(s.a)(p.a.mark((function e(t){var n,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R(!0),e.next=3,Object(te.a)("/api/examination_intelligent_settings/form_paper.json",{method:"post",body:t});case 3:n=e.sent,i=(i=null==n?void 0:n.filter((function(e){var t;return!(null==e||null===(t=e.item_banks)||void 0===t||!t.length)}))).map((function(e){return Object(l.a)(Object(l.a)({},e),{},{scoreTotal:0,score:0,questionTotal:0})})),Ne(i),R(!1);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$t=function(e){Fe(e)},Yt=function(e){var t={contents:[],panel:[],score_num_item:[],score_total:[],error_tips:[]};return null==e||e.forEach((function(e,n){var i,r,o;t.panel.push([]),t.score_num_item.push(null==e?void 0:e.score),t.score_total.push(null==e?void 0:e.scoreTotal),null===(i=t.error_tips)||void 0===i||i.push({name:null===(r=Jt.find((function(t){return t.type===(null==e?void 0:e.item_type)})))||void 0===r?void 0:r.name,score:(null==e?void 0:e.score)||0,scoreTotal:null==e?void 0:e.scoreTotal,item_type:null==e?void 0:e.item_type}),null==e||null===(o=e.item_banks)||void 0===o||o.forEach((function(i){var r;null==i||null===(r=i.tag_disciplines)||void 0===r||r.forEach((function(r){var o;null==r||null===(o=r.difficulties)||void 0===o||o.forEach((function(o){o.num&&(t.panel[n].push(o.num),t.contents.push({difficulty:o.difficulty,item_type:e.item_type,items_count:o.num,sub_discipline_id:i.sub_discipline_id,tag_discipline_id:r.tag_discipline_id}))}))}))}))})),t},Xt=function(){var e=Object(s.a)(p.a.mark((function e(t){var i,r,o,a,s,c,u,d,f,m,g,y,b,x,w,k;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Je.length||ze.length||mt.length){e.next=3;break}return _.b.warn("必须选择考察范围或试题文件夹或教研团队的其中一项"),e.abrupt("return");case 3:i=[],r=[],o=Yt(Oe),a=0;case 7:if(!(a0})).map((function(e,n){var i;return null===(i=e.questions)||void 0===i||i.forEach((function(e){g.push(e.id),v+=e.score,y+=1})),Object(l.a)(Object(l.a)({},e),{number:t[n+1]})}));return{all_questions_count:y,all_score:v,questionList:b,ids:g,exam:i}}},nn=null==Ae||null===(t=Ae.find((function(e){return e.id===Ve})))||void 0===t?void 0:t.sub_disciplines,rn=function(){for(var e=null==Pe?void 0:Pe.filter((function(e){return null==ze?void 0:ze.includes(e.id)})),t=Object(O.a)(e),n=0,i=[],r=0;r0?m.a.createElement(E.a,{getPopupContainer:function(e){return document.getElementById("id_left")},title:"上移"},m.a.createElement("span",{onClick:function(){return e=t,n=[],(i=Object(J.cloneDeep)(Oe)).length>1&&0!==e&&(n=Qt(i,e,e-1)),void Ne(n);var e,n,i},className:"mb20",style:{transform:"rotate(270deg)"}},m.a.createElement("i",{className:"icon-jiantou1"}))):m.a.createElement("span",{className:"mb20",style:{transform:"rotate(270deg)",cursor:"not-allowed"}},m.a.createElement("i",{className:"icon-jiantou1"})),t1&&e!==i.length-1&&(n=Qt(i,e,e+1)),void Ne(n);var e,n,i},style:{transform:"rotate(90deg)"}},m.a.createElement("i",{className:"icon-jiantou1"}))):m.a.createElement("span",{style:{transform:"rotate(90deg)",cursor:"not-allowed"}},m.a.createElement("i",{className:"icon-jiantou1"})))))}))),(Rt=Yt(Oe),Bt=Rt.panel,zt=(zt=Rt.score_total).reduce((function(e,t){return e+t}),0),Bt=Object(J.flatten)(Bt).reduce((function(e,t){return e+t}),0),m.a.createElement("div",{className:T.a.total},m.a.createElement("div",null,m.a.createElement("img",{src:F.a}),m.a.createElement("span",null,"题数(道)"),m.a.createElement("aside",null,Bt)),m.a.createElement("aside",null),m.a.createElement("div",null,m.a.createElement("img",{src:W.a}),m.a.createElement("span",null,"总分(分)"),m.a.createElement("aside",null,zt))))),m.a.createElement("div",{className:T.a.right},m.a.createElement(w,{className:T.a.tabs,value:1,onChange:function(){return o(0)}}),m.a.createElement("section",{className:T.a.topWarp},m.a.createElement("div",{className:T.a.title},m.a.createElement("b",null),m.a.createElement("span",null,"抽题组卷"),m.a.createElement("div",null,"STEP2")),m.a.createElement("div",{className:T.a.source},m.a.createElement("b",null,"*"),m.a.createElement("span",null,"试题来源"),m.a.createElement("aside",null,m.a.createElement("div",{onClick:function(){return en("mine")}},m.a.createElement(S.a,{checked:null==C?void 0:C.includes("mine")}),m.a.createElement("span",{style:{color:null!=C&&C.includes("mine")?"#007DFE":"#666666"}},"仅我创建的")),m.a.createElement("div",{className:"mb20",onClick:function(){return en("teach_groups")}},m.a.createElement(S.a,{checked:null==C?void 0:C.includes("teach_groups")}),m.a.createElement("span",{style:{color:null!=C&&C.includes("teach_groups")?"#007DFE":"#666666"}},"教研共享")),m.a.createElement("div",{onClick:function(){return en("public")}},m.a.createElement(S.a,{checked:null==C?void 0:C.includes("public")}),m.a.createElement("span",{style:{color:null!=C&&C.includes("public")?"#007DFE":"#666666"}},"公共题库"))),m.a.createElement("aside",null,(null==C?void 0:C.includes("mine"))&&m.a.createElement("div",{style:{marginBottom:14},className:T.a.folder,onClick:function(){Tt(!0),Ye(!0),lt.current=Je,Dt((null==Pt?void 0:Pt.map((function(e){return e.count})).reduce((function(e,t){return e+t}),0))||0)}},m.a.createElement("img",{src:D.a}),m.a.createElement("span",null,"选择试题文件夹"),m.a.createElement(E.a,{title:"选中项仅包括该文件夹下的试题,不包括子文件夹,且系统取您选中的文件夹和考查范围中的试题的并集作为随机对象。"},m.a.createElement("img",{src:M.a}))),(null==C?void 0:C.includes("teach_groups"))&&m.a.createElement("div",{className:T.a.folder,onClick:function(){dt(!0),Ct.current=mt}},m.a.createElement("img",{src:G.a}),m.a.createElement("span",null,"选择教研团队")))),m.a.createElement("div",{className:T.a.times},m.a.createElement("b",null,"*"),m.a.createElement("span",null,"题目使用次数"),m.a.createElement("div",{className:T.a.maxTimesInputWrapper},"不超过",m.a.createElement(a.a,{className:T.a.maxTimesInput,value:re,onChange:function(e){if("number"==typeof e){if(oe(e),!Je.length&&!ze.length&&!mt.length)return;qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:mt,item_bank_quotes:e}),Ke.current=ze}},min:0,precision:0}),"次")),(null==C?void 0:C.includes("mine"))&&m.a.createElement("div",{className:T.a.choice},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,"已选文件夹")),m.a.createElement(q.a,{type:2,value:Pt,onChange:function(e){var t=Je.filter((function(t){return t!==e}));qt({source:C,group_ids:t,tag_discipline_ids:ze,teach_group_ids:mt}),Qe(t),lt.current=t}})),(null==C?void 0:C.includes("teach_groups"))&&m.a.createElement("div",{className:T.a.choice},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,"已选教研团队")),m.a.createElement(q.a,{icon:U.a,type:2,value:It,onChange:function(e){var t=mt.filter((function(t){return t!==e}));qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:t}),gt(t),Ct.current=t}})),m.a.createElement("div",{className:T.a.range},m.a.createElement("div",{className:T.a.name},m.a.createElement("b",null),m.a.createElement("span",null,"考察范围")),m.a.createElement("div",{onClick:function(){null!==Ve?(Ke.current=ze,ge(!0)):_.b.warn("考察范围没有知识点可以选择")},className:T.a.btn},m.a.createElement("img",{src:I.a})," 选择范围"),m.a.createElement("div",{className:T.a.name},m.a.createElement("b",{className:T.a.num}),m.a.createElement("span",null,"已选知识点")),m.a.createElement("div",{className:T.a.knWarp},null==rn?void 0:rn.map((function(e,t){return m.a.createElement(m.a.Fragment,{key:t},m.a.createElement("div",{className:T.a.kn},m.a.createElement("span",null,t+1)," ",m.a.createElement("span",null,null==e?void 0:e[0].parent_name)),m.a.createElement(q.a,{type:1,value:null==e?void 0:e.filter((function(e){return!!e.item_count})),onChange:function(e){var t=ze.filter((function(t){return t!==e}));qt({source:C,group_ids:Je,tag_discipline_ids:t,teach_group_ids:mt}),Fe(t),Ke.current=t}}))}))))),m.a.createElement(i.a,{loading:P,active:!0,paragraph:{rows:5}},Oe.map((function(e,t){return m.a.createElement($.a,{key:t,value:e,onChange:function(e){return function(e,t){var n,i,r=Object(J.cloneDeep)(Oe);r[t]=e;var o=Yt([r[t]]),a=null==o||null===(n=o.panel)||void 0===n||null===(i=n[0])||void 0===i?void 0:i.reduce((function(e,t){return e+t}),0);r[t].questionTotal=a,Ne(r);var s=document.getElementsByClassName("customError");null==s||s.forEach((function(e){var t;null==e||null===(t=e.classList)||void 0===t||t.remove("customError")}))}(e,t)}})})),m.a.createElement("div",{className:T.a.btns},m.a.createElement(r.a,{onClick:function(){o(0),document.body.scrollIntoView()}},"上一步"),m.a.createElement(r.a,{loading:V,onClick:function(){return Xt()}},"提交"),m.a.createElement(r.a,{loading:Z,onClick:function(){return Zt()},type:"primary"},"预览")))),m.a.createElement(k.a,{centered:!0,closable:!1,destroyOnClose:!0,className:T.a.modal,visible:me,title:null,width:"1200px",onOk:Gt,onCancel:function(){Fe(Ke.current),ge(!1),de("")}},m.a.createElement("div",{className:T.a.modalBody},m.a.createElement("div",{className:T.a.left},m.a.createElement("div",{className:T.a.title},m.a.createElement("img",{src:B.a}),m.a.createElement("span",null,"章节分布")),m.a.createElement("div",{className:T.a.l},null==Ae?void 0:Ae.map((function(e){var t,n=!1;he?null===(t=e.sub_disciplines)||void 0===t||t.forEach((function(e){var t;null===(t=e.tag_disciplines)||void 0===t||t.forEach((function(e){var t;n||(n=(null===(t=e.name)||void 0===t?void 0:t.includes(he))&&0!==e.item_count)}))})):n=!0;return m.a.createElement(m.a.Fragment,{key:e.id},!!e.item_count&&n&&m.a.createElement("div",{onClick:function(){return Ge(e.id)},className:"".concat(T.a.name," ").concat(e.id===Ve?T.a.active:"")},m.a.createElement("b",null),m.a.createElement("span",null,e.name)))})))),m.a.createElement("div",{className:T.a.right},m.a.createElement("div",{className:T.a.inputWarp},m.a.createElement(le,{onChange:function(e){return de(e.target.value)},placeholder:"请输入知识点",value:he})),m.a.createElement("div",{className:T.a.l},null==nn?void 0:nn.map((function(e,t){var n,i=Object(l.a)(Object(l.a)({},e),{},{tag_disciplines:null==e||null===(n=e.tag_disciplines)||void 0===n?void 0:n.filter((function(e){return 0!==e.item_count}))});return m.a.createElement(ee,{search:he,onChange:$t,key:e.id,value:ze,options:i})})))))),m.a.createElement(k.a,{centered:!0,title:"选择文件夹",visible:$e,width:718,destroyOnClose:!0,onCancel:function(){Qe(lt.current),Ye(!1),Dt(0)},footer:m.a.createElement("div",{style:{display:"flex",alignItems:"center"}},m.a.createElement("span",{style:{flex:"1",textAlign:"left"}},"已选",Je.length||0,"个文件夹,共(",jt||0,")道题"),m.a.createElement(r.a,{onClick:function(){Qe(lt.current),Dt(0),Ye(!1)}},"取消"),m.a.createElement(r.a,{type:"primary",onClick:function(){qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:mt}),lt.current=Je,Ye(!1)}},"确认"))},m.a.createElement("aside",{className:T.a.exportModal},Nt&&m.a.createElement(ae,{treeData:St,defaultValue:nt,value:Je,onChange:function(e,t){var n;Dt(null===(n=t.selectedNodes)||void 0===n?void 0:n.map((function(e){return e.count})).reduce((function(e,t){return e+t}),0)),Qe(e)}}))),m.a.createElement(k.a,{centered:!0,title:"选择教研团队",visible:ht,width:718,destroyOnClose:!0,onCancel:function(){gt(Ct.current),dt(!1)},onOk:function(){qt({source:C,group_ids:Je,tag_discipline_ids:ze,teach_group_ids:mt}),Ct.current=mt,dt(!1)}},m.a.createElement("aside",{className:T.a.teachModal},m.a.createElement("div",{className:T.a.head},m.a.createElement("div",{className:T.a.li}),m.a.createElement("div",{className:T.a.li},"团队名称"),m.a.createElement("div",{className:T.a.li},"共享题目数量")),m.a.createElement("div",{className:T.a.wraps},null==bt?void 0:bt.map((function(e){return m.a.createElement("div",{key:e.id,className:T.a.body},m.a.createElement("div",{className:T.a.li},m.a.createElement(S.a,{onChange:function(){var t=e.id,n=Object(O.a)(mt);mt.includes(t)?n=n.filter((function(e){return e!==t})):n.push(t),gt(n)},checked:null==mt?void 0:mt.includes(e.id)})),m.a.createElement("div",{title:e.name,className:T.a.li},e.name),m.a.createElement("div",{className:T.a.li},e.item_bank_count))}))))))},ue=h.a.TextArea;t.default=Object(v.a)((function(e){return{paperlibrary:e.paperlibrary,user:e.user,globalSetting:e.globalSetting}}))((function(e){e.paperlibrary,e.user,e.globalSetting;var t=e.dispatch,n=Object(f.useState)(0),d=Object(u.a)(n,2),y=d[0],x=d[1],C=c.a.useForm(),k=Object(u.a)(C,1)[0],S=Object(f.useState)({}),E=Object(u.a)(S,2),_=E[0],O=E[1],N=Object(f.useState)(!0),T=Object(u.a)(N,2),L=T[0],A=T[1],M=Object(f.useState)(null),j=Object(u.a)(M,2),D=j[0],P=j[1],I=Object(g.i)().id;console.log(I,"editId"),Object(f.useEffect)((function(){return t({type:"globalSetting/footerToggle",payload:!1}),function(){t({type:"globalSetting/footerToggle",payload:!0})}}),[]),Object(f.useEffect)((function(){return document.body.setAttribute("data-custom","initial"),function(){document.body.removeAttribute("data-custom")}}),[]);Object(f.useEffect)((function(){I?R():A(!1)}),[I]);var R=function(){var e=Object(s.a)(p.a.mark((function e(){var t,n,i,r,o,a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(te.a)("/api/examination_banks/".concat(I,"/edit_random_exam.json"),{method:"get",params:{}});case 2:null!=(t=e.sent)&&t.examination_bank&&(a={difficulty:null==t||null===(n=t.examination_bank)||void 0===n?void 0:n.difficulty,exam_notes:null==t||null===(i=t.examination_bank)||void 0===i?void 0:i.exam_notes,name:null==t||null===(r=t.examination_bank)||void 0===r?void 0:r.name,time:null==t||null===(o=t.examination_bank)||void 0===o?void 0:o.time},A(!1),O(Object(l.a)({},a)),k.setFieldsValue(Object(l.a)({},a)),P(Object(l.a)(Object(l.a)({},t),{},{id:I})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),B=function(){var e=Object(s.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t){e.next=3;break}return x(t),e.abrupt("return");case 3:return e.next=5,k.validateFields();case 5:x(t);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return m.a.createElement("section",{className:b.a.wrap},m.a.createElement(i.a,{loading:L,active:!0,paragraph:{rows:5}},m.a.createElement("div",{className:b.a.crumbs},m.a.createElement("b",null),m.a.createElement("span",{className:"current",onClick:function(){return v.d.push("/")}},"首页>"),m.a.createElement("span",{className:"current",onClick:function(){return v.d.push("/paperlibrary")}},"试卷与作业>"),m.a.createElement("span",{style:{color:"#bebebe"}},"随机试卷与作业")),0===y&&m.a.createElement(w,{value:y,onChange:B}),0===y&&m.a.createElement("section",{className:b.a.oneWrap},m.a.createElement("div",{className:b.a.title},m.a.createElement("b",null),m.a.createElement("span",null,"基本信息"),m.a.createElement("div",null,"STEP1")," "),m.a.createElement(c.a,{className:b.a.formWrap,form:k,layout:"horizontal",onValuesChange:function(e){O(Object(l.a)({},k.getFieldsValue()))}},m.a.createElement(c.a.Item,{label:"名称",name:"name",rules:[{required:!0,message:"名称不能为空"},{pattern:/^(?!(\s+$))/,message:"输入框不能全为空格"}]},m.a.createElement(h.a,{className:b.a.in,bordered:!1,placeholder:"请输入名称,最多60个字",maxLength:60})),m.a.createElement("div",{style:{position:"relative"}},m.a.createElement(c.a.Item,{label:"完成时长限制:",name:"time",rules:[{required:!0,message:"时长不能为空"}]},m.a.createElement(a.a,{min:1,parser:function(e){var t=parseInt(e);return Object(J.isNaN)(t)?"":t},max:9999,placeholder:"请输入时长",style:{width:190}})),m.a.createElement("span",{style:{position:"absolute",top:26,left:310}},"分钟")),m.a.createElement(c.a.Item,{label:"难度",name:"difficulty",rules:[{required:!0,message:"请选择难度"}]},m.a.createElement(o.a.Group,{style:{display:"flex",width:286,justifyContent:"space-between"},size:"large"},m.a.createElement(o.a.Button,{className:b.a.rb,value:1},"简单"),m.a.createElement(o.a.Button,{className:b.a.rb,value:2},"适中"),m.a.createElement(o.a.Button,{className:b.a.rb,value:3},"困难"))),m.a.createElement(c.a.Item,{label:"须知",name:"exam_notes"},m.a.createElement(ue,{rows:4,maxLength:300}))),m.a.createElement("div",{className:b.a.btns},m.a.createElement(r.a,{className:"mr40",onClick:function(){return v.d.push("/paperlibrary")}},"返回"),m.a.createElement(r.a,{type:"primary",onClick:Object(s.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.validateFields();case 2:x(1);case 3:case"end":return e.stop()}}),e)})))},"下一步"))),m.a.createElement(ce,{tabs:y,dispatch:t,editData:D,setFatherTabs:x,formValue:_})))}))},"E/GV": /*!*************************************************!*\ !*** ./src/assets/images/paper/swenjianjia.svg ***! \*************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/swenjianjia.1640bf70.svg"},ELLl: /*!*************************************************************!*\ !*** ./node_modules/codemirror/addon/edit/closebrackets.js ***! \*************************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function i(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(r),t.state.closeBrackets=null),n&&(o(i(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(r))}));var r={Backspace:function(t){var r=s(t);if(!r||t.getOption("disableInput"))return e.Pass;for(var o=i(r,"pairs"),a=t.listSelections(),c=0;c=0;c--){var h=a[c].head;t.replaceRange("",n(h.line,h.ch-1),n(h.line,h.ch+1),"+delete")}},Enter:function(t){var n=s(t),r=n&&i(n,"explode");if(!r||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a1&&d.indexOf(r)>=0&&t.getRange(n(b.line,b.ch-2),b)==r+r){if(b.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(b.line,b.ch-2))))return e.Pass;v="addFour"}else if(p){var C=0==b.ch?" ":t.getRange(n(b.line,b.ch-1),b);if(e.isWordChar(x)||C==r||e.isWordChar(C))return e.Pass;v="both"}else{if(!m||!(0===x.length||/\s/.test(x)||h.indexOf(x)>-1))return e.Pass;v="both"}else v=p&&c(t,b)?"both":d.indexOf(r)>=0&&t.getRange(b,n(b.line,b.ch+3))==r+r+r?"skipThree":"skip";if(u){if(u!=v)return e.Pass}else u=v}var w=l%2?a.charAt(l-1):r,k=l%2?r:a.charAt(l+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var i=0;i<3;i++)t.execCommand("goCharRight");else if("surround"==u){var r=t.getSelections();for(i=0;i0,{anchor:new n(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new n(o.head.line,o.head.ch+(a?1:-1))});t.setSelections(r)}else"both"==u?(t.replaceSelection(w+k,null),t.triggerElectric(w+k),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(w+w+w+w,"before"),t.execCommand("goCharRight"));var o,a}))}(r,t)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var i=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==i.length?i:null}function c(e,t){var i=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(i.type)&&i.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}(n(/*! ../../lib/codemirror */"VrN/"))},FTkQ: /*!***********************************************!*\ !*** ./src/assets/images/icons/tagDelete.png ***! \***********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABjUlEQVQ4T61VsUoDQRB9s+eVYifkUlqIWCW3sbBMqYUR0cbfUPETxPgZ2giigpZaCnKXpBK1sMydpIx25+7ISu5ILhsjclvuzLx5M292lmA57PtuF2gIYIMBSYBn3BiICAg1cF0GrqjVSvLhlL+IqtVNEDUZWLAlS+8IeAPzvtduXw77ZYAMiEjKI2LeY2AskQ2cAGaiEy8MDwnQxicL7Ep5bDL+xmqijahZDsODDHBQ5sVfmVn6xmDeMuWTESAGnqf1bBpz09MSsESx729r4DwfIIA6hPjUSt2AaP7Hztwj5nXHdd0vpR7yMQzsUOT7pwzsjgEKsVIKgiCu1Za1UvfGLhynXgqCp6hSkSxEYCn9jLq+/wJgcawk5l4KYECN3YBlCVLWo4GvhmGfgVlrj4ZAjX0KmBmZD8Owj4IAMQAsvGSrKKR1zet0QpsosZQrmvnRKsqksZlxnFWVJAkT3Y6MDbAmgDlFdGcdm8IH22Qp9OmltAtdDoPlWez6SpkWtmCHFTNCvQMN/scX8A1e4fnIOEHt8AAAAABJRU5ErkJggg=="},Gytx: /*!********************************************!*\ !*** ./node_modules/shallowequal/index.js ***! \********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(e,t,n,i){var r=n?n.call(i,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=l.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},c.setupPositionProbePattern=function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var i=-1;i<=7;i++)t+i<=-1||this.moduleCount<=t+i||(this.modules[e+n][t+i]=0<=n&&n<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=i&&i<=4)},c.getBestMaskPattern=function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=a.getLostPoint(this);(0==n||e>i)&&(e=i,t=n)}return t},c.createMovieClip=function(e,t,n){var i=e.createEmptyMovieClip(t,n);this.make();for(var r=0;r>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;n<18;n++){i=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}},c.setupTypeInfo=function(e,t){for(var n=this.errorCorrectLevel<<3|t,i=a.getBCHTypeInfo(n),r=0;r<15;r++){var o=!e&&1==(i>>r&1);r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(r=0;r<15;r++){o=!e&&1==(i>>r&1);r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!e},c.mapData=function(e,t){for(var n=-1,i=this.moduleCount-1,r=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(6==s&&s--;;){for(var l=0;l<2;l++)if(null==this.modules[i][s-l]){var c=!1;o>>r&1)),a.getMask(t,i,s-l)&&(c=!c),this.modules[i][s-l]=c,-1==--r&&(o++,r=7)}if((i+=n)<0||this.moduleCount<=i){i-=n,n=-n;break}}},l.PAD0=236,l.PAD1=17,l.createData=function(e,t,n){for(var i=r.getRSBlocks(e,t),s=new o,c=0;c8*h)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*h+")");for(s.getLengthInBits()+4<=8*h&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*h||(s.put(l.PAD0,8),s.getLengthInBits()>=8*h));)s.put(l.PAD1,8);return l.createBytes(s,i)},l.createBytes=function(e,t){for(var n=0,i=0,r=0,o=new Array(t.length),l=new Array(t.length),c=0;c=0?f.get(m):0}}var g=0;for(d=0;d=0;)t^=f.G15<=0;)t^=f.G18<>>=1;return t},getPatternPosition:function(e){return f.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case a:return(t+n)%2==0;case s:return t%2==0;case l:return n%3==0;case c:return(t+n)%3==0;case u:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case h:return t*n%2+t*n%3==0;case d:return(t*n%2+t*n%3)%2==0;case p:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new r([1],0),n=0;n5&&(n+=3+o-5)}for(i=0;i1&&void 0!==arguments[1]?arguments[1]:1,n=M.length,i=0;i1&&void 0!==arguments[1]&&arguments[1];return Object(E.a)(e).map((function(e,n){if(!s.isValidElement(e)||!e.type)return null;var i=e.type.isSelectOptGroup,r=e.key,o=e.props,a=o.children,l=Object(c.a)(o,["children"]);return t||!i?_(e):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(null===r?n:r,"__"),label:r},l),{},{options:O(a)})})).filter((function(e){return e}))}var N=n("2Qr1"),T=n("qNPg"),L=n("U8pU"),A=n("Kwbf"),M=n("WKfj");var j=function(e){var t=e.mode,n=e.options,i=e.children,r=e.backfill,o=e.allowClear,a=e.placeholder,l=e.getInputElement,c=e.showSearch,u=e.onSearch,h=e.defaultOpen,d=e.autoFocus,p=e.labelInValue,f=e.value,m=e.inputValue,g=e.optionLabelProp,v="multiple"===t||"tags"===t,y=void 0!==c?c:v||"combobox"===t,b=n||O(i);if(Object(A.a)("tags"!==t||b.every((function(e){return!e.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===t||"combobox"===t){var x=b.some((function(e){return e.options?e.options.some((function(e){return"number"==typeof("value"in e?e.value:e.key)})):"number"==typeof("value"in e?e.value:e.key)}));Object(A.a)(!x,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(A.a)("combobox"!==t||!g,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(A.a)("combobox"===t||!r,"`backfill` only works with `combobox` mode."),Object(A.a)("combobox"===t||!l,"`getInputElement` only work with `combobox` mode."),Object(A.b)("combobox"!==t||!l||!o||!a,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!y&&"combobox"!==t&&"tags"!==t&&Object(A.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(A.b)(!h||d,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=f){var C=Object(M.d)(f);Object(A.a)(!p||C.every((function(e){return"object"===Object(L.a)(e)&&("key"in e||"value"in e)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(A.a)(!v||Array.isArray(f),"`value` should be array when `mode` is `multiple` or `tags`")}if(i){var w=null;Object(E.a)(i).some((function(e){if(!s.isValidElement(e)||!e.type)return!1;var t=e.type;return!t.isSelectOption&&(t.isSelectOptGroup?!Object(E.a)(e.props.children).every((function(t){return!(s.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(w=t.type,!1)})):(w=t,!0))})),w&&Object(A.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(w.displayName||w.name||w,"`.")),Object(A.a)(void 0===m,"`inputValue` is deprecated, please use `searchValue` instead.")}},D=Object(T.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:O,flattenOptions:N.d,getLabeledValue:N.e,filterOptions:N.b,isValueDisabled:N.g,findValueOption:N.c,warningProps:j,fillOptionsWithMissingValue:N.a}),P=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(){var e;return Object(i.a)(this,n),(e=t.apply(this,arguments)).selectRef=s.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(r.a)(n,[{key:"render",value:function(){return s.createElement(D,Object.assign({ref:this.selectRef},this.props))}}]),n}(s.Component);P.Option=C,P.OptGroup=k;var I=P;t.c=I},M8RZ: /*!**********************************!*\ !*** ./src/components/modal.tsx ***! \**********************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! react-dom */"i8i4"),u=function(e){Object(o.a)(n,e);var t=Object(a.a)(n);function n(e){var r;Object(i.a)(this,n),r=t.call(this,e);var o=window.document;return r.node=o.createElement("div"),o.body.appendChild(r.node),r}return Object(r.a)(n,[{key:"render",value:function(){var e=this.props.children;return Object(c.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),n}(l.a.Component)},NvD2: /*!******************************************************!*\ !*** ./node_modules/rc-tree/es/utils/conductUtil.js ***! \******************************************************/ /*! exports provided: isCheckDisabled, conductCheck */ /*! exports used: conductCheck */function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n(/*! rc-util/es/warning */"Kwbf");function r(e,t){var n=new Set;return e.forEach((function(e){t.has(e)||n.add(e)})),n}function o(e){var t=e||{},n=t.disabled,i=t.disableCheckbox,r=t.checkable;return!(!n&&!i)||!1===r}function a(e,t,n,a){var s,l=[];s=a||o;var c=new Set(e.filter((function(e){var t=!!n[e];return t||l.push(e),t}))),u=new Map,h=0;return Object.keys(n).forEach((function(e){var t=n[e],i=t.level,r=u.get(i);r||(r=new Set,u.set(i,r)),r.add(t),h=Math.max(h,i)})),Object(i.a)(!l.length,"Tree missing follow keys: ".concat(l.slice(0,100).map((function(e){return"'".concat(e,"'")})).join(", "))),!0===t?function(e,t,n,i){for(var o=new Set(e),a=new Set,s=0;s<=n;s+=1){(t.get(s)||new Set).forEach((function(e){var t=e.key,n=e.node,r=e.children,a=void 0===r?[]:r;o.has(t)&&!i(n)&&a.filter((function(e){return!i(e.node)})).forEach((function(e){o.add(e.key)}))}))}for(var l=new Set,c=n;c>=0;c-=1){(t.get(c)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!i(n)&&e.parent&&!l.has(e.parent.key))if(i(e.parent.node))l.add(t.key);else{var r=!0,s=!1;(t.children||[]).filter((function(e){return!i(e.node)})).forEach((function(e){var t=e.key,n=o.has(t);r&&!n&&(r=!1),s||!n&&!a.has(t)||(s=!0)})),r&&o.add(t.key),s&&a.add(t.key),l.add(t.key)}}))}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(r(a,o))}}(c,u,h,s):function(e,t,n,i,o){for(var a=new Set(e),s=new Set(t),l=0;l<=i;l+=1){(n.get(l)||new Set).forEach((function(e){var t=e.key,n=e.node,i=e.children,r=void 0===i?[]:i;a.has(t)||s.has(t)||o(n)||r.filter((function(e){return!o(e.node)})).forEach((function(e){a.delete(e.key)}))}))}s=new Set;for(var c=new Set,u=i;u>=0;u-=1){(n.get(u)||new Set).forEach((function(e){var t=e.parent,n=e.node;if(!o(n)&&e.parent&&!c.has(e.parent.key))if(o(e.parent.node))c.add(t.key);else{var i=!0,r=!1;(t.children||[]).filter((function(e){return!o(e.node)})).forEach((function(e){var t=e.key,n=a.has(t);i&&!n&&(i=!1),r||!n&&!s.has(t)||(r=!0)})),i||a.delete(t.key),r&&s.add(t.key),c.add(t.key)}}))}return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(r(s,a))}}(c,t.halfCheckedKeys,u,h,s)}},O2Wb: /*!******************************************************************!*\ !*** ./src/components/Editor/NullChildEditor/index.less?modules ***! \******************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OLES: /*!*********************************************************!*\ !*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***! \*********************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";var i=n("U8pU"),r=n("VTBJ"),o=n("Ff2n"),a=n("q1tI"),s=n("uciX"),l=n("7ixt"),c=function(e){var t=e.overlay,n=e.prefixCls,i=e.id,r=e.overlayInnerStyle;return a.createElement("div",{className:"".concat(n,"-inner"),id:i,role:"tooltip",style:r},"function"==typeof t?t():t)},u=Object(a.forwardRef)((function(e,t){var n=e.overlayClassName,u=e.trigger,h=void 0===u?["hover"]:u,d=e.mouseEnterDelay,p=void 0===d?0:d,f=e.mouseLeaveDelay,m=void 0===f?.1:f,g=e.overlayStyle,v=e.prefixCls,y=void 0===v?"rc-tooltip":v,b=e.children,x=e.onVisibleChange,C=e.afterVisibleChange,w=e.transitionName,k=e.animation,S=e.placement,E=void 0===S?"right":S,_=e.align,O=void 0===_?{}:_,N=e.destroyTooltipOnHide,T=void 0!==N&&N,L=e.defaultVisible,A=e.getTooltipContainer,M=e.overlayInnerStyle,j=Object(o.a)(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),D=Object(a.useRef)(null);Object(a.useImperativeHandle)(t,(function(){return D.current}));var P=Object(r.a)({},j);"visible"in e&&(P.popupVisible=e.visible);var I=!1,R=!1;if("boolean"==typeof T)I=T;else if(T&&"object"===Object(i.a)(T)){var B=T.keepParent;I=!0===B,R=!1===B}return a.createElement(s.a,Object.assign({popupClassName:n,prefixCls:y,popup:function(){var t=e.arrowContent,n=void 0===t?null:t,i=e.overlay,r=e.id;return[a.createElement("div",{className:"".concat(y,"-arrow"),key:"arrow"},n),a.createElement(c,{key:"content",prefixCls:y,id:r,overlay:i,overlayInnerStyle:M})]},action:h,builtinPlacements:l.a,popupPlacement:E,ref:D,popupAlign:O,getPopupContainer:A,onPopupVisibleChange:x,afterPopupVisibleChange:C,popupTransitionName:w,popupAnimation:k,defaultPopupVisible:L,destroyPopupOnHide:I,autoDestroy:R,mouseLeaveDelay:m,popupStyle:g,mouseEnterDelay:p},P),b)}));t.a=u},OZM5: /*!*****************************************!*\ !*** ./node_modules/rc-tree/es/util.js ***! \*****************************************/ /*! exports provided: arrDel, arrAdd, posToArr, getPosition, isTreeNode, getDragNodesKeys, calcDropPosition, calcSelectedKeys, convertDataToTree, parseCheckedKeys, conductExpandParent, getDataAndAria */ /*! exports used: arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductExpandParent, getDataAndAria, getDragNodesKeys, getPosition, isTreeNode, parseCheckedKeys, posToArr */function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"k",(function(){return l})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return u})),n.d(t,"g",(function(){return h})),n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return p})),n.d(t,"j",(function(){return f})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return g}));var i=n(/*! @babel/runtime/helpers/esm/toConsumableArray */"KQm4"),r=n(/*! @babel/runtime/helpers/esm/typeof */"U8pU"),o=(n(/*! @babel/runtime/helpers/esm/objectWithoutProperties */"Ff2n"),n(/*! react */"q1tI"),n(/*! rc-util/es/warning */"Kwbf"));n(/*! ./TreeNode */"WaYH");function a(e,t){var n=e.slice(),i=n.indexOf(t);return i>=0&&n.splice(i,1),n}function s(e,t){var n=e.slice();return-1===n.indexOf(t)&&n.push(t),n}function l(e){return e.split("-")}function c(e,t){return"".concat(e,"-").concat(t)}function u(e){return e&&e.type&&e.type.isTreeNode}function h(e,t){var n=[e];return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.forEach((function(t){var i=t.key,r=t.children;n.push(i),e(r)}))}(t[e].children),n}function d(e,t){var n=e.clientY,i=t.selectHandle.getBoundingClientRect(),r=i.top,o=i.bottom,a=i.height,s=Math.max(.25*a,2);return n<=r+s?-1:n>=o-s?1:0}function p(e,t){if(e)return t.multiple?e.slice():e.length?[e[0]]:e}function f(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==Object(r.a)(e))return Object(o.a)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function m(e,t){var n=new Set;return(e||[]).forEach((function(e){!function e(i){if(!n.has(i)){var r=t[i];if(r){n.add(i);var o=r.parent;r.node.disabled||o&&e(o.key)}}}(e)})),Object(i.a)(n)}function g(e){var t={};return Object.keys(e).forEach((function(n){(n.startsWith("data-")||n.startsWith("aria-"))&&(t[n]=e[n])})),t}},Ot1p: /*!**************************************************************!*\ !*** ./src/components/markdown-editor/index.tsx + 6 modules ***! \**************************************************************/ /*! exports provided: default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/code-block/index.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/components/useInterval.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/util.js because of ./src/pages/tasks/index.jsx */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */ /*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/codemirror/lib/codemirror.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/qrcode.react/lib/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/uuid/dist/esm-browser/v4.js */function(e,t,n){"use strict";n("2qtc");var i=n("kLXV"),r=n("rAM+"),o=(n("miYZ"),n("tsqr")),a=n("9og8"),s=n("tJVT"),l=n("jrin"),c=n("WmNS"),u=n.n(c),h=n("q1tI"),d=n.n(h),p=n("VrN/"),f=n.n(p),m=n("bdgK"),g=(n("p77/"),n("Bd2K"),n("ELLl"),n("19Vz"),n("lZu9"),n("+NIl"),n("kSUc"),n("9Bee")),v=function(e){var t=e.value,n=void 0===t?"":t,i=(e.className,e.showTextOnly,e.showLines,e.style,Object(h.useMemo)((function(){return""}),[n]));return d.a.createElement(d.a.Fragment,null,d.a.createElement("div",{dangerouslySetInnerHTML:{__html:i}}))},y=(n("Q9mQ"),n("diRs")),b=n("0Owb"),x=(n("dejd"),n("C+DQ"),n("D1Df")),C=n.n(x),w=n("1vsH"),k=n("m3rI"),S=[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}];function E(e){var t=e.onActionCallback,n=e.title,i=e.icon,r=e.actionName,o=e.className,a=void 0===o?"":o,s=e.children;return d.a.createElement("a",{title:n,className:a,onClick:function(){t(r)}},d.a.createElement("i",{className:"md-iconfont ".concat(i)}),s)}var _=function(e){var t=e.watch,n=e.showNullButton,i=e.onActionCallback,r=e.fullScreen,o=e.insertTemp,a=e.hidetoolBar,s=e.uuid,l=e.setOpenPhones,c=Object(w.E)("_educoder_session_login"),u=Object(w.E)("_educoder_session"),h=[].concat(S,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},!a&&h.map((function(e,t){return d.a.createElement("li",{key:t},e.actionName?d.a.createElement(E,Object(b.a)({},e,{onActionCallback:i})):d.a.createElement("span",{className:"v-line"}))})),n?d.a.createElement("li",null,d.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:i},d.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,o&&d.a.createElement("li",null,d.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(o),onActionCallback:i},d.a.createElement("span",{className:"fill-tip"},"插入模板"))),d.a.createElement("li",null,d.a.createElement(y.a,{title:"打开手机扫一扫",content:d.a.createElement("div",null,d.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(k.a.API_SERVER)),d.a.createElement(C.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+u+"&key="+s+"&api="+encodeURIComponent(k.a.API_SERVER)}))},d.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return l(!0)}},"手机上传文件"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(E,{icon:"".concat(r?"icon-shrink":"icon-enlarge"),title:r?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:i})))},O=n("M8RZ"),N=(n("+L6B"),n("2/Rp")),T=(n("y8nQ"),n("Vl3Y")),L=(n("5NDa"),n("5rEg")),A={labelCol:{span:4},wrapperCol:{span:20}},M=function(e){var t=e.callback,n=e.onCancel;return d.a.createElement(T.a,Object(b.a)({},A,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)}}),d.a.createElement(T.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},d.a.createElement(L.a,null)),d.a.createElement(T.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},d.a.createElement(L.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))},j=n("7ahc"),D=n("k1fw"),P=(n("HmJG"),n("BjJ7")),I=T.a.useForm,R={width:280,marginRight:10},B={labelCol:{span:5},wrapperCol:{span:19}},z=function(e){var t=e.callback,n=e.onCancel,i=I(),r=Object(s.a)(i,1)[0],o=Object(h.useRef)();function a(e,t){r.setFieldsValue({src:"/api/attachments/".concat(e.id,"?type=").concat(e.content_type),type:t.type})}return d.a.createElement(T.a,Object(b.a)({form:r},B,{className:"upload-image-panel",onFinish:function(e){t(Object(D.a)(Object(D.a)({},e),{},{name:o.current}))}}),d.a.createElement(T.a.Item,{label:"文件地址",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(T.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}]},d.a.createElement(L.a,{style:R})),d.a.createElement(F,{onFileChange:function(e){var t=e.target.files[0];o.current=t.name,H(t,a)}}))),d.a.createElement(T.a.Item,{label:"文件描述",name:"alt"},d.a.createElement(L.a,{style:{width:264}})),d.a.createElement(T.a.Item,{style:{textAlign:"right"}},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))};function F(e){var t=e.onFileChange;return d.a.createElement("a",{className:"upload-button"},"本地上传",d.a.createElement("input",{type:"file",onChange:t}))}function H(e,t){if(!e)throw new String("没有文件");var n=new FormData;n.append("editormd-image-file",e),n.append("file_param_name","editormd-image-file"),n.append("byxhr","true");var i=new window.XMLHttpRequest;i.withCredentials=!0,i.addEventListener("load",(function(n){t(JSON.parse(n.target.responseText),e)}),!1),i.addEventListener("error",(function(e){console.error(e)}),!1),i.open("POST","".concat(P.a,"/api/attachments.json")),i.send(n)}n("giR+");var W,V,G=n("fyUT"),K=(n("7Kak"),n("9yH6")),U=K.a.Group,q={margin:"0 8px"},$=function(e){var t=e.callback,n=e.onCancel;return d.a.createElement(T.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)}},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:q},"单元格数:"),d.a.createElement("span",{style:q},"行数"),d.a.createElement(T.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},d.a.createElement(G.a,null)),d.a.createElement("span",{style:q},"列数"),d.a.createElement(T.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},d.a.createElement(G.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:q},"对齐方式:"),d.a.createElement(T.a.Item,{name:"align"},d.a.createElement(U,null,d.a.createElement(K.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(K.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(K.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(K.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(N.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(N.a,{type:"ghost",onClick:n},"取消")))},Y=n("ErOA"),X=n("7Cbv"),Z="------------",J={default:Z,left:":".concat(Z),center:":".concat(Z,":"),right:"".concat(Z,":")},Q=n("9VGf");function ee(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var te=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",ne=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ie=(W={},Object(l.a)(W,te+"-B","bold"),Object(l.a)(W,te+"-I","italic"),W),re=(V={},Object(l.a)(V,"link","添加链接"),Object(l.a)(V,"code-block","添加代码块"),Object(l.a)(V,"upload-image","添加文件"),Object(l.a)(V,"add-table","添加表格"),V);t.a=function(e){var t=e.defaultValue,n=void 0===t?"":t,c=e.onChange,p=e.width,y=void 0===p?"100%":p,b=e.height,x=void 0===b?400:b,C=e.miniToolbar,w=void 0!==C&&C,S=e.isFocus,E=void 0!==S&&S,N=e.watch,T=e.insertTemp,L=e.mode,A=void 0===L?"markdown":L,D=e.id,P=void 0===D?"markdown-editor-id":D,I=e.showResizeBar,R=void 0!==I&&I,B=e.noStorage,F=void 0!==B&&B,W=e.showNullButton,V=void 0!==W&&W,G=e.hidetoolBar,K=void 0!==G&&G,U=e.fullScreen,q=void 0!==U&&U,Z=e.onBlur,te=e.onCMBeforeChange,oe=e.onFullScreen,ae=e.className,se=void 0===ae?"":ae,le=e.disablePaste,ce=void 0!==le&&le,ue=e.placeholder,he=void 0===ue?"":ue,de=e.values,pe=void 0===de?"":de,fe=Object(h.useState)(null),me=Object(s.a)(fe,2),ge=me[0],ve=me[1],ye=Object(h.useState)(n),be=Object(s.a)(ye,2),xe=be[0],Ce=be[1],we=Object(h.useState)(N),ke=Object(s.a)(we,2),Se=ke[0],Ee=ke[1],_e=Object(h.useState)(q),Oe=Object(s.a)(_e,2),Ne=Oe[0],Te=Oe[1],Le=Object(h.useState)(""),Ae=Object(s.a)(Le,2),Me=Ae[0],je=Ae[1],De=Object(h.useState)(0),Pe=Object(s.a)(De,2),Ie=Pe[0],Re=Pe[1],Be=Object(h.useState)(x),ze=Object(s.a)(Be,2),Fe=ze[0],He=ze[1],We=Object(h.useState)(!1),Ve=Object(s.a)(We,2),Ge=(Ve[0],Ve[1]),Ke=Object(h.useRef)(Object(X.a)()),Ue=Object(h.useRef)(!1),qe=Object(h.useRef)(),$e=Object(h.useRef)(),Ye=Object(h.useRef)(),Xe=Object(h.useRef)(),Ze=Object(h.useRef)(),Je=function(){var e=Object(a.a)(u.a.mark((function e(){var t,n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(Y.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ke.current}});case 2:null!=(n=e.sent)&&null!==(t=n.attachments)&&void 0!==t&&t.length&&(console.log("cm:",ge,$e),n.attachments.map((function(e){e.content_type.indexOf("image")>-1?ge.replaceSelection("![,](/api/attachments/".concat(e.id,"?type=").concat(e.content_type,")")):e.content_type.indexOf("video")>-1?ge.replaceSelection('')):e.content_type.indexOf("pdf")>-1?ge.replaceSelection('
    ').concat(e.name,"")):ge.replaceSelection("[".concat(e.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")"))})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(h.useEffect)((function(){Ce(pe),null==ge||ge.setValue(pe)}),[pe]),Object(h.useEffect)((function(){null==oe||oe(Ne)}),[Ne]),Object(h.useEffect)((function(){if($e.current){var e=f.a.fromTextArea($e.current,{mode:A,lineNumbers:!w,lineWrapping:!0,value:n,autoCloseTags:!0,autoCloseBrackets:!0});function t(t,n){if(!ce){var i=n.clipboardData;if(i){var r=i.types.toString(),a=i.items;if("Files"===r||i.types.indexOf("Files")>-1){if(n.preventDefault(),"stex"==A)return;try{var s,l=a[1];"file"===(null===(s=a[0])||void 0===s?void 0:s.kind)&&(l=a[0]);var c=l.getAsFile(),u=c.name.split(".").pop();H(c,(function(t){var n,i,r;t.id?(null==c||null===(n=c.type)||void 0===n?void 0:n.indexOf("image"))>-1?e.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):(null==c||null===(i=c.type)||void 0===i?void 0:i.indexOf("video"))>-1?e.replaceSelection('')):(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?e.replaceSelection('').concat(c.name,"")):ne.includes(u)?e.replaceSelection('').concat(c.name,"")):e.replaceSelection("[".concat(c.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))}catch(n){o.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}n.preventDefault()}return E&&e.focus(),e.on("paste",t),e.on("dragleave",(function(e,t){Ye.current.classList.remove("mouse-hover-md")})),e.on("dragover",(function(e,t){Ye.current.classList.add("mouse-hover-md")})),e.on("drop",(function(t,n){var i;if(Ye.current.classList.add("mouse-hover-md"),(i=n.dataTransfer.files).length>0){n.preventDefault(),n.stopPropagation();for(var r=function(t){var n=i[t],r=n.name.split(".").pop();H(n,(function(t){var i,o,a;t.id?(null==n||null===(i=n.type)||void 0===i?void 0:i.indexOf("image"))>-1?e.replaceSelection("![,](/api/attachments/".concat(t.id,"?type=").concat(t.content_type,")")):(null==n||null===(o=n.type)||void 0===o?void 0:o.indexOf("video"))>-1?e.replaceSelection('')):(null==n||null===(a=n.type)||void 0===a?void 0:a.indexOf("pdf"))>-1?e.replaceSelection('').concat(n.name,"")):ne.includes(r)?e.replaceSelection('').concat(n.name,"")):e.replaceSelection("[".concat(n.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))},o=0;o0||i.target.offsetWidth>0)&&(Qe(),ge.setSize("100%","100%"),ge.refresh())}}catch(e){n.e(e)}finally{n.f()}}));return e.observe($e.current.parentElement),e}();return function(){e.unobserve($e.current.parentElement)}}}),[ge,Qe]),Object(h.useEffect)((function(){if(ge){for(var e=[],t=function(){var t=i[n],r=(o=Object(s.a)(t,2))[0],a=o[1],c=Object(l.a)({},r,(function(){et(a)}));e.push(c),ge.addKeyMap(c)},n=0,i=Object.entries(ie);n0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(P);e>=Ie+1e4&&(!t||t!==xe)&&(window.sessionStorage.setItem(P,xe),Ge(!0))}}),1e4),Object(h.useEffect)((function(){Ee(N)}),[ge,N]),Object(h.useEffect)((function(){ge&&E&&ge.focus()}),[ge,E]),Object(h.useEffect)((function(){if(Se&&ge){var e=ge.getScrollerElement();function t(e){var t=e.target;if(Ze.current){var n=t.scrollTop/t.scrollHeight;Ze.current.scrollTop=Ze.current.scrollHeight*n}}return e.addEventListener("scroll",t),function(){e.removeEventListener("scroll",t)}}}),[ge,Se]),Object(h.useEffect)((function(){if(ge&&te){function e(e,t){te(e,t)}return ge.on("beforeChange",e),function(){ge.off("beforeChange",e)}}}),[ge,te]),Object(h.useEffect)((function(){if(ge&&Z){function e(){Z(ge.getValue())}return ge.on("blur",e),function(){ge.off("blur",e)}}}),[ge,Z]),Object(h.useEffect)((function(){if(ge){function e(e){var t=e.getValue();Ce(t),Re((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),c&&c(t)}return ge.on("change",e),function(){ge.off("change",e)}}}),[ge,c]),Object(h.useEffect)((function(){ge&&(null==n?(ge.setValue(""),Ce("")):n!==ge.getValue()&&(ge.setValue(n),Ce(n),ge.setCursor(ge.lineCount(),0)))}),[ge,n]);var et=Object(h.useCallback)((function(e){var t=ge.getCursor(),n=ge.getSelection(),i=n.split("\n");switch(e){case"bold":return ge.replaceSelection("**"+n+"**"),""===n&&ge.setCursor(t.line,t.ch+2),ge.focus();case"italic":return ge.replaceSelection("*"+n+"*"),""===n&&ge.setCursor(t.line,t.ch+1),ge.focus();case"code":return ge.replaceSelection("`"+n+"`"),""===n&&ge.setCursor(t.line,t.ch+1),ge.focus();case"inline-latex":return ge.replaceSelection("`$$"+n+"$$`"),""===n&&ge.setCursor(t.line,t.ch+3),ge.focus();case"latex":return ge.replaceSelection("```latex\n"+n+"\n```"),ge.setCursor(t.line+1,n.length+1),ge.focus();case"line-break":return ge.replaceSelection("
    \n"),ge.focus();case"list-ul":return""===n?ge.replaceSelection("- "+n):ge.replaceSelection(i.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),ge.focus();case"list-ol":return""===n?ge.replaceSelection("1. "+n):ge.replaceSelection(i.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),ge.focus();case"add-null-ch":return""===n&&ge.setCursor(t.line,t.ch+1),ge.replaceSelection("▁"),ge.focus();case"inster-template-1":return""===n&&ge.setCursor(t.line,t.ch),ge.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),ge.focus();case"eraser":return ge.setValue(""),ge.focus();case"trigger-watch":return Ee(!Se),ge.focus();case"trigger-full-screen":return Te(!Ne),ge.focus();case"link":return void je("link");case"code-block":return void je("code-block");case"upload-image":return void je("upload-image");case"add-table":return void je("add-table");default:throw new Error}}),[ge,Se,Ne]),tt=Object(h.useCallback)((function(e){switch(je(""),Me){case"link":var t=e.title,n=e.link;return ge.replaceSelection("[".concat(t,"](").concat(n,")")),ge.focus();case"code-block":var i=e.language,r=e.content;return ge.replaceSelection(["```"+i,r,"```"].join("\n")),ge.focus();case"upload-image":var o=e.src,a=e.alt,s=e.name;return o.indexOf("type=image")>-1?ge.replaceSelection("![ ".concat(a||""," ]( ").concat(o,' "').concat(a||"",'" )')):o.indexOf("type=application/pdf")>-1?ge.replaceSelection('').concat(s,"")):ge.replaceSelection('').concat(s,"")),ge.focus();case"add-table":for(var l=e.row,c=e.col,u=e.align,h="\n",d=0;d300&&(i=300),He(x+i+"px")}}return e.addEventListener("mousedown",i),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),function(){e.removeEventListener("mousedown",i),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)}}}),[ge,Xe]),Object(h.useEffect)((function(){He(x)}),[x]);var rt={width:ee(y),height:ee(Fe)};Object(h.useMemo)((function(){if(Ie){var e=new Date(Ie),t=e.getHours(),n=e.getMinutes(),i=e.getSeconds();return n=n<10?"0"+n:n,i=i<10?"0"+i:i,"".concat(t=t<10?"0"+t:t,":").concat(n,":").concat(i)}return 0}),[Ie]);return d.a.createElement(h.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Ye},d.a.createElement("div",{className:"markdown-editor-container ".concat(se," ").concat(Se?"on-preview":""," ").concat(w?"mini":""," ").concat(Ne?"full-screen":""),style:rt},d.a.createElement(_,{insertTemp:T,watch:Se,fullScreen:Ne,showNullButton:V,onActionCallback:et,hidetoolBar:K,uuid:Ke.current,setOpenPhones:function(){Ue.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:$e,placeholder:he})),Se?d.a.createElement("div",{ref:Ze,className:"preview-container"},"stex"===A&&d.a.createElement(v,{value:xe}),"stex"!==A&&d.a.createElement(g.a,{edit:!0,value:xe,replaces:function(e,t){var n=ge.getValue();n=n.replace(e,t),Ce(n),null==ge||ge.setValue(n)}})):null))),R?d.a.createElement("a",{ref:Xe,className:"editor-resize"}):null,d.a.createElement(O.a,null,re[Me]?d.a.createElement(i.a,{centered:!0,title:re[Me],visible:!0,onCancel:it,footer:null},nt):null))}},PGNT: /*!********************************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/components/editor.less?modules ***! \********************************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={wrap:"wrap___orWmH",modal:"modal___142IN",titleWrap:"titleWrap___2UWGN",required:"required___lXOtq",title:"title___2wqMf",colorGray:"colorGray___3FkLm",choiceWrap:"choiceWrap___3pbic",answer:"answer___30LSv",activeAnswer:"activeAnswer___3ayAN",deleteIcon:"deleteIcon___2HHly",addIcon:"addIcon___29vcx",editorWrap:"editorWrap___ANVP6",htmlWrap:"htmlWrap___38sLf",radio:"radio___15wok",color333:"color333___sNPjh",color999:"color999___1ofkl",fold:"fold___6rnoE",head:"head___2muph"}},PsQE: /*!********************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepPreview/index.less?modules ***! \********************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___2PkN_",flex_space_between:"flex_space_between___36cDA",flex_box_vertical_center:"flex_box_vertical_center___2c88u",flex_box_center_end:"flex_box_center_end___14cXO",flex_box_column:"flex_box_column___3nalt",wrap:"wrap___3xZrs",left:"left___19hOK",title:"title___3Ti2k",total:"total___3MRC5",list:"list___3pdfL",name:"name___2IcTs",b:"b___2W0Sn",r:"r___2Tpj8",l:"l___1rMKQ",tag:"tag___jj2X5",right:"right___16831",examName:"examName___2TmgX",t:"t___1CJZd",num:"num___1qX6C",topWarp:"topWarp___3WuSr",head:"head___3z9Hq",so:"so___m2B6Z",btn:"btn___20VL7",content:"content___2tTuo",titleWrap:"titleWrap___1cYdQ",single:"single___1BKtz",analysis:"analysis___1qm4Y",text:"text___1JQUf",btnsElse:"btnsElse___2IzAs",btnsWrap:"btnsWrap___3ib37",btns:"btns___2DbBT",modalColumn:"modalColumn___1zs36",modalRow:"modalRow___14b2N",sup:"sup___1CIjI",popover:"popover___Mmcvb"}},QSKd: /*!********************************************!*\ !*** ./src/assets/images/paper/wenhao.svg ***! \********************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/wenhao.50b63ac4.svg"},"RZ/O": /*!****************************************!*\ !*** ./src/assets/images/paper/bi.svg ***! \****************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/bi.9c9b0364.svg"},SJMd: /*!****************************************************!*\ !*** ./node_modules/code-prettify/src/prettify.js ***! \****************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var e=window,t=["break,continue,do,else,for,if,return,while"],n=[[t,"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"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],i=[n,"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"],r=[n,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[n,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],a=[n,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",l=[t,"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"],c=[t,"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"],u=[t,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],h=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function d(e,t,n,i,r){if(n){var o={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:n,spans:null,basePos:t,decorations:null};i(o),r.push.apply(r,o.decorations)}}var p=/\S/;function f(e){for(var t=void 0,n=e.firstChild;n;n=n.nextSibling){var i=n.nodeType;t=1===i?t?e:n:3===i&&p.test(n.nodeValue)?e:t}return t===e?void 0:t}function m(e,t){var n,i={};!function(){for(var r=e.concat(t),o=[],a={},s=0,l=r.length;s=0;)i[u.charAt(h)]=c;var d=c[1],p=""+d;a.hasOwnProperty(p)||(o.push(d),a[p]=null)}o.push(/[\0-\uffff]/),n=function(e){for(var t=0,n=!1,i=!1,r=0,o=e.length;r122||(u<65||h>90||n.push([32|Math.max(65,h),32|Math.min(u,90)]),u<97||h>122||n.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}n.sort((function(e,t){return e[0]-t[0]||t[1]-e[1]}));var d=[],p=[];for(o=0;of[0]&&(f[1]+1>f[0]&&r.push("-"),r.push(l(f[1])))}return r.push("]"),r.join("")}function u(e){for(var i=e.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")),r=i.length,o=[],a=0,s=0;a=2&&"["===d?i[a]=c(h):"\\"!==d&&(i[a]=h.replace(/[a-zA-Z]/g,(function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"})))}return i.join("")}var h=[];for(r=0,o=e.length;r=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(g=!1,y="src"),g||(p[v]=y)}var k=u;if(u+=v.length,g){var S=b[1],E=v.indexOf(S),_=E+S.length;b[2]&&(E=(_=v.length-b[2].length)-S.length);var O=y.substring(5);d(l,s+k,v.substring(0,E),o,c),d(l,s+k+E,S,C(O,S),c),d(l,s+k+_,v.substring(_),o,c)}else c.push(s+k,y)}e.decorations=c};return o}function g(e){var t=[],n=[];e.tripleQuotedStrings?t.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&n.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var i=e.hashComments;i&&(e.cStyleComments?(i>1?t.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),n.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push(["com",/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(n.push(["com",/^\/\/[^\r\n]*/,null]),n.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var r=e.regexLiterals;if(r){var o=r>1?"":"\n\r",a=o?".":"[\\S\\s]",s="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+a+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+a+")*(?:\\x5D|$))+/";n.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+s+")")])}var l=e.types;l&&n.push(["typ",l]);var c=(""+e.keywords).replace(/^ | $/g,"");c.length&&n.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push(["pln",/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(u+="(?!s*/)"),n.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(u),null]),m(t,n)}var v=g({keywords:[i,o,r,a,s,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(e,t,n){for(var i=/(?:^|\s)nocode(?:\s|$)/,r=/\r\n?|\n/,o=e.ownerDocument,a=o.createElement("li");e.firstChild;)a.appendChild(e.firstChild);var s=[a];function l(e){var t=e.nodeType;if(1!=t||i.test(e.className)){if((3==t||4==t)&&n){var a=e.nodeValue,s=a.match(r);if(s){var u=a.substring(0,s.index);e.nodeValue=u;var h=a.substring(s.index+s[0].length);if(h)e.parentNode.insertBefore(o.createTextNode(h),e.nextSibling);c(e),u||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName)c(e),e.parentNode&&e.parentNode.removeChild(e);else for(var d=e.firstChild;d;d=d.nextSibling)l(d)}function c(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var t,n=function e(t,n){var i=n?t.cloneNode(!1):t,r=t.parentNode;if(r){var o=e(r,1),a=t.nextSibling;o.appendChild(i);for(var s=a;s;s=a)a=s.nextSibling,o.appendChild(s)}return i}(e.nextSibling,0);(t=n.parentNode)&&1===t.nodeType;)n=t;s.push(n)}for(var u=0;u=0;){var r=n[i];b.hasOwnProperty(r)?e.console&&console.warn("cannot override language handler %s",r):b[r]=t}}function C(e,t){return e&&b.hasOwnProperty(e)||(e=/^\s*=x&&(u+=2),s>=C&&(p+=2)}}finally{v&&(v.style.display=y)}}(t)}catch(t){e.console&&console.log(t&&t.stack||t)}}function k(e,t,n){var i=n||!1,r=t||null,o=document.createElement("div");return o.innerHTML="
    "+e+"
    ",o=o.firstChild,i&&y(o,i,!0),w({langExtension:r,numberLines:i,sourceNode:o,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),o.innerHTML}function S(t,n){var i=n||document.body,r=i.ownerDocument||document;function o(e){return i.getElementsByTagName(e)}for(var a=[o("pre"),o("code"),o("xmp")],s=[],l=0;l]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),x(m([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),x(m([],[["atv",/^[\s\S]+/]]),["uq.val"]),x(g({keywords:i,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),x(g({keywords:"null,true,false"}),["json"]),x(g({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),x(g({keywords:r,cStyleComments:!0}),["java"]),x(g({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),x(g({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),x(g({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),x(g({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),x(g({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),x(g({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),x(m([],[["str",/^[\s\S]+/]]),["regex"]);var E=e.PR={createSimpleLexer:m,registerLangHandler:x,sourceDecorator:g,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:k,prettyPrint:S},_=e.define;"function"==typeof _&&_.amd&&_("google-code-prettify",[],(function(){return E}))}()},"VrN/": /*!***************************************************!*\ !*** ./node_modules/codemirror/lib/codemirror.js ***! \***************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=i||r||o,s=a&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),C=h&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,l=!0);var w=y&&(c||h&&(null==C||C<12.11)),k=n||a&&s>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,_=function(e,t){var n=e.className,i=S(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function O(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return O(e).appendChild(t)}function T(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(P=function(e){try{e.select()}catch(e){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};function F(e,t){for(var n=0;n=t)return i+Math.min(a,t-r);if(r+=o-i,i=o+1,(r+=n-r%n)>=t)return i}}var U=[""];function q(e){for(;U.length<=e;)U.push($(U)+" ");return U[e]}function $(e){return e[e.length-1]}function Y(e,t){for(var n=[],i=0;i"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Q(e))||t.test(e):Q(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&ne.test(e)}function re(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var r=(t+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+i}}var ae=null;function se(e,t,n){var i;ae=null;for(var r=0;rt)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:ae=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:ae=r)}return null!=i?i:ae}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,i=/[Lb1n]/,r=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var c,u=a.length,h=[],d=0;d-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function fe(e,t){var n=de(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){pe(this,e,t)}}function be(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function xe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function we(e){be(e),xe(e)}function ke(e){return e.target||e.srcElement}function Se(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var Ee,_e,Oe=function(){if(a&&s<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==Ee){var t=T("span","​");N(e,T("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ee=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ee?T("span","​"):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Te(e){if(null!=_e)return _e;var t=N(e,document.createTextNode("AخA")),n=E(t,0,1).getBoundingClientRect(),i=E(t,1,2).getBoundingClientRect();return O(e),!(!n||n.left==n.right)&&(_e=i.right-n.right<3)}var Le,Ae=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Me=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},je="oncopy"in(Le=T("div"))||(Le.setAttribute("oncopy","return;"),"function"==typeof Le.oncopy),De=null,Pe={},Ie={};function Re(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pe[e]=t}function Be(e){if("string"==typeof e&&Ie.hasOwnProperty(e))e=Ie[e];else if(e&&"string"==typeof e.name&&Ie.hasOwnProperty(e.name)){var t=Ie[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ze(e,t){t=Be(t);var n=Pe[t.name];if(!n)return ze(e,"text/plain");var i=n(e,t);if(Fe.hasOwnProperty(t.name)){var r=Fe[t.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)i[a]=t.modeProps[a];return i}var Fe={};function He(e,t){R(t,Fe.hasOwnProperty(e)?Fe[e]:Fe[e]={})}function We(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Ve(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ge(e,t,n){return!e.startState||e.startState(t,n)}var Ke=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ue(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t=e.first&&tn?et(n,Ue(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?et(e.line,t):n<0?et(e.line,0):e}(t,Ue(e,t.line).text.length)}function lt(e,t){for(var n=[],i=0;i=this.string.length},Ke.prototype.sol=function(){return this.pos==this.lineStart},Ke.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ke.prototype.next=function(){if(this.post},Ke.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ke.prototype.skipToEnd=function(){this.pos=this.string.length},Ke.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ke.prototype.backUp=function(e){this.pos-=e},Ke.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},Ke.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ke.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ke.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ke.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,n,i){var r=[e.state.modeGen],o={};xt(e,t.text,e.doc.mode,n,(function(e,t){return r.push(e,t)}),o,i);for(var a=n.state,s=function(i){n.baseTokens=r;var s=e.state.overlays[i],l=1,c=0;n.state=!0,xt(e,t.text,s.mode,n,(function(e,t){for(var n=l;ce&&r.splice(l,1,e,r[l+1],i),l+=2,c=Math.min(e,i)}if(t)if(s.opaque)r.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&We(e.doc.mode,i.state),o=ht(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function pt(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new ut(i,!0,t);var o=function(e,t,n){for(var i,r,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=Ue(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof ct?c.lookAhead:0)<=o.modeFrontier))return s;var u=B(l.text,null,e.options.tabSize);(null==r||i>u)&&(r=s-1,i=u)}return r}(e,t,n),a=o>i.first&&Ue(i,o-1).stateAfter,s=a?ut.fromSaved(i,a,o):new ut(i,Ge(i.mode),o);return i.iter(o,t,(function(n){ft(e,n.text,s);var i=s.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&it.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,n){return t instanceof ct?new ut(e,We(e.mode,t.state),n,t.lookAhead):new ut(e,We(e.mode,t),n)},ut.prototype.save=function(e){var t=!1!==e?We(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var vt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function yt(e,t,n,i){var r,o,a=e.doc,s=a.mode,l=Ue(a,(t=st(a,t)).line),c=pt(e,t.line,n),u=new Ke(l.text,e.options.tabSize,c);for(i&&(o=[]);(i||u.pose.options.maxHighlightLength?(s=!1,a&&ft(e,t,i,h.pos),h.pos=t.length,l=null):l=bt(gt(n,h,i.state,d),o),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c=t:o.to>t);(i||(i=[])).push(new kt(a,o.from,s?null:o.to))}}return i}(n,r,a),l=function(e,t,n){var i;if(e)for(var r=0;r=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;bt)&&(!n||Mt(n,o.marker)<0)&&(n=o.marker)}return n}function Rt(e,t,n,i,r){var o=Ue(e,t),a=wt&&o.markedSpans;if(a)for(var s=0;s=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?tt(c.to,n)>=0:tt(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?tt(c.from,i)<=0:tt(c.from,i)<0)))return!0}}}function Bt(e){for(var t;t=Dt(e);)e=t.find(-1,!0).line;return e}function zt(e,t){var n=Ue(e,t),i=Bt(n);return n==i?t:Xe(i)}function Ft(e,t){if(t>e.lastLine())return t;var n,i=Ue(e,t);if(!Ht(e,i))return t;for(;n=Pt(i);)i=n.find(1,!0).line;return Xe(i)+1}function Ht(e,t){var n=wt&&t.markedSpans;if(n)for(var i=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Ut=function(e,t,n){this.text=e,Tt(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Nt(e)}Ut.prototype.lineNo=function(){return Xe(this)},ye(Ut);var $t={},Yt={};function Xt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:$t;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var n=L("span",null,null,l?"padding-right: .1px":null),i={pre:L("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o=r?t.rest[r-1]:t.line,a=void 0;i.pos=0,i.addToken=Qt,Te(e.display.measure)&&(a=ce(o,e.doc.direction))&&(i.addToken=en(i.addToken,a)),i.map=[],nn(o,i,dt(e,o,t!=e.display.externalMeasured&&Xe(o))),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=D(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=D(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Ne(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var s=i.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return fe(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=D(i.pre.className,i.textClass||"")),i}function Jt(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qt(e,t,n,i,r,o,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;rc&&h.from<=c);d++);if(h.to>=u)return e(n,i,r,o,a,s,l);e(n,i.slice(0,h.to-c),r,o,null,s,l),o=null,i=i.slice(h.to-c),c=h.to}}}function tn(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var a,s,l,c,u,h,d,p=r.length,f=0,m=1,g="",v=0;;){if(v==f){l=c=u=s="",d=null,h=null,v=1/0;for(var y=[],b=void 0,x=0;xf||w.collapsed&&C.to==f&&C.from==f)){if(null!=C.to&&C.to!=f&&v>C.to&&(v=C.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&C.from==f&&(u+=" "+w.startStyle),w.endStyle&&C.to==v&&(b||(b=[])).push(w.endStyle,C.to),w.title&&((d||(d={})).title=w.title),w.attributes)for(var k in w.attributes)(d||(d={}))[k]=w.attributes[k];w.collapsed&&(!h||Mt(h.marker,w)<0)&&(h=C)}else C.from>f&&v>C.from&&(v=C.from)}if(b)for(var S=0;S=p)break;for(var _=Math.min(p,v);;){if(g){var O=f+g.length;if(!h){var N=O>_?g.slice(0,_-f):g;t.addToken(t,N,a?a+l:l,u,f+N.length==v?c:"",s,d)}if(O>=_){g=g.slice(_-f),f=_;break}f=O,u=""}g=r.slice(o,o=n[m++]),a=Xt(n[m++],t.cm.options)}}else for(var T=1;Tn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Ln(e,t,n,i){return jn(e,Mn(e,t),n,i)}function An(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,i){var r,o=In(t.map,n,i),l=o.node,c=o.start,u=o.end,h=o.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&ie(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,r))}else{var p;c>0&&(h=i="right"),r=e.options.lineWrapping&&(p=l.getClientRects()).length>1?p["right"==i?p.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!r||!r.left&&!r.right)){var f=l.parentNode.getClientRects()[0];r=f?{left:f.left,right:f.left+ri(e.display),top:f.top,bottom:f.bottom}:Pn}for(var m=r.top-t.rect.top,g=r.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;bt)&&(r=(o=l-s)-1,t>=l&&(a="right")),null!=r){if(i=e[c+2],s==l&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)i=e[2+(c-=3)],a="left";if("right"==n&&r==l-s)for(;c=0&&(n=e[r]).left==n.right;r--);return n}function Bn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var h=se(s,l,c),d=ae,p=u(l,h,"before"==c);return null!=d&&(p.other=u(l,d,"before"!=c)),p}function $n(e,t){var n=0;t=st(e.doc,t),e.options.lineWrapping||(n=ri(e.display)*t.ch);var i=Ue(e.doc,t.line),r=Vt(i)+kn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Yn(e,t,n,i,r){var o=et(e,t,n);return o.xRel=r,i&&(o.outside=i),o}function Xn(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return Yn(i.first,0,null,-1,-1);var r=Ze(i,n),o=i.first+i.size-1;if(r>o)return Yn(i.first+i.size-1,Ue(i,o).text.length,null,1,1);t<0&&(t=0);for(var a=Ue(i,r);;){var s=ei(e,a,r,t,n),l=It(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==r)return c;a=Ue(i,r=c.line)}}function Zn(e,t,n,i){i-=Vn(t);var r=t.text.length,o=oe((function(t){return jn(e,n,t-1).bottom<=i}),r,0);return{begin:o,end:r=oe((function(t){return jn(e,n,t).top>i}),o,r)}}function Jn(e,t,n,i){return n||(n=Mn(e,t)),Zn(e,t,n,Gn(e,t,jn(e,n,i),"line").top)}function Qn(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function ei(e,t,n,i,r){r-=Vt(t);var o=Mn(e,t),a=Vn(t),s=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var h=(e.options.lineWrapping?ni:ti)(e,t,n,o,u,i,r);s=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,p,f=null,m=null,g=oe((function(t){var n=jn(e,o,t);return n.top+=a,n.bottom+=a,!!Qn(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(f=t,m=n),!0)}),s,l),v=!1;if(m){var y=i-m.left=x.bottom?1:0}return Yn(n,g=re(t.text,g,1),p,v,i-d)}function ti(e,t,n,i,r,o,a){var s=oe((function(s){var l=r[s],c=1!=l.level;return Qn(qn(e,et(n,c?l.to:l.from,c?"before":"after"),"line",t,i),o,a,!0)}),0,r.length-1),l=r[s];if(s>0){var c=1!=l.level,u=qn(e,et(n,c?l.from:l.to,c?"after":"before"),"line",t,i);Qn(u,o,a,!0)&&u.top>a&&(l=r[s-1])}return l}function ni(e,t,n,i,r,o,a){var s=Zn(e,t,i,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d=c||p.to<=l)){var f=jn(e,i,1!=p.level?Math.min(c,p.to)-1:Math.max(l,p.from)).right,m=fm)&&(u=p,h=m)}}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function ii(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Dn){Dn=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Dn.appendChild(document.createTextNode("x")),Dn.appendChild(T("br"));Dn.appendChild(document.createTextNode("x"))}N(e.measure,Dn);var n=Dn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),O(e.measure),n||1}function ri(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");N(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function oi(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+r,i[s]=o.clientWidth}return{fixedPos:ai(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function ai(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function si(e){var t=ii(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/ri(e.display)-3);return function(r){if(Ht(e.doc,r))return 0;var o=0;if(r.widgets)for(var a=0;a0&&(l=Ue(e.doc,c.line).text).length==c.ch){var u=B(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((o-En(e.display).left)/ri(e.display))-u))}return c}function ui(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;it)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)wt&&zt(e.doc,t)r.viewFrom?pi(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)pi(e);else if(t<=r.viewFrom){var o=fi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):pi(e)}else if(n>=r.viewTo){var a=fi(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):pi(e)}else{var s=fi(e,t,t,-1),l=fi(e,n,n+i,1);s&&l?(r.view=r.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):pi(e)}var c=r.externalMeasured;c&&(n=r.lineN&&t=i.viewTo)){var o=i.view[ui(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==F(a,n)&&a.push(n)}}}function pi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fi(e,t,n,i){var r,o=ui(e,t),a=e.display.view;if(!wt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;r=s+a[o].size-t,o++}else r=s-t;t+=r,n+=r}for(;zt(e.doc,n)!=n;){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function mi(e){for(var t=e.display.view,n=0,i=0;i=e.display.viewTo||s.to().linet||t==n&&a.to==t)&&(i(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}(m,n||0,null==i?d:i,(function(e,t,r,h){var g="ltr"==r,v=p(e,g?"left":"right"),y=p(t-1,g?"right":"left"),b=null==n&&0==e,x=null==i&&t==d,C=0==h,w=!m||h==m.length-1;if(y.top-v.top<=3){var k=(c?x:b)&&w,S=(c?b:x)&&C?s:(g?v:y).left,E=k?l:(g?y:v).right;u(S,v.top,E-S,v.bottom)}else{var _,O,N,T;g?(_=c&&b&&C?s:v.left,O=c?l:f(e,r,"before"),N=c?s:f(t,r,"after"),T=c&&x&&w?l:y.right):(_=c?f(e,r,"before"):s,O=!c&&b&&C?l:v.right,N=!c&&x&&w?s:y.left,T=c?f(t,r,"after"):l),u(_,v.top,O-_,v.bottom),v.bottom0?t.blinker=setInterval((function(){e.hasFocus()||Ei(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function wi(e){e.state.focused||(e.display.input.focus(),Si(e))}function ki(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ei(e))}),100)}function Si(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(fe(e,"focus",e,t),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Ci(e))}function Ei(e,t){e.state.delayingBlurEvent||(e.state.focused&&(fe(e,"blur",e,t),e.state.focused=!1,_(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function _i(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i.005||d<-.005)&&(Ye(r.line,l),Oi(r.line),r.rest))for(var p=0;pe.display.sizerWidth){var f=Math.ceil(c/ri(e.display));f>e.display.maxLineLength&&(e.display.maxLineLength=f,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}}function Oi(e){if(e.widgets)for(var t=0;t=a&&(o=Ze(t,Vt(Ue(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function Ti(e,t){var n=e.display,i=ii(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Nn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Sn(n),l=t.tops-i;if(t.topr+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=r&&(a.scrollTop=u)}var h=e.options.fixedGutter?0:n.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-h,p=On(e)-n.gutters.offsetWidth,f=t.right-t.left>p;return f&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.leftp+d-3&&(a.scrollLeft=t.right+(f?0:10)-p),a}function Li(e,t){null!=t&&(ji(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ai(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mi(e,t,n){null==t&&null==n||ji(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function ji(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Di(e,$n(e,t.from),$n(e,t.to),t.margin))}function Di(e,t,n,i){var r=Ti(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});Mi(e,r.scrollLeft,r.scrollTop)}function Pi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||lr(e,{top:t}),Ii(e,t,!0),n&&lr(e),ir(e,100))}function Ii(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Ri(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,hr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Bi(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+Sn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+_n(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zi=function(e,t,n){this.cm=n;var i=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),he(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),he(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},zi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zi.prototype.zeroWidthHack=function(){var e=y&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},zi.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,(function i(){var r=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)}))},zi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Fi=function(){};function Hi(e,t){t||(t=Bi(e));var n=e.display.barWidth,i=e.display.barHeight;Wi(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&_i(e),Wi(e,Bi(e)),n=e.display.barWidth,i=e.display.barHeight}function Wi(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Fi.prototype.update=function(){return{bottom:0,right:0}},Fi.prototype.setScrollLeft=function(){},Fi.prototype.setScrollTop=function(){},Fi.prototype.clear=function(){};var Vi={native:zi,null:Fi};function Gi(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&_(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vi[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Ri(e,t):Pi(e,t)}),e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Ki=0;function Ui(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ki},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function qi(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new or(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Yi(e){e.updatedDisplay=e.mustUpdate&&ar(e.cm,e.update)}function Xi(e){var t=e.cm,n=t.display;e.updatedDisplay&&_i(t),e.barMeasure=Bi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ln(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+_n(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-On(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!f){var o=T("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-kn(e.display))+"px;\n height: "+(t.bottom-t.top+_n(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=qn(e,t),l=n&&n!=t?qn(e,n):s,c=Ti(e,r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-i,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+i}),u=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=c.scrollTop&&(Pi(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(Ri(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(a=!0)),!a)break}return r}(t,st(i,e.scrollToPos.from),st(i,e.scrollToPos.to),e.scrollToPos.margin));var r=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(r)for(var a=0;a=e.display.viewTo)){var n=+new Date+e.options.workTime,i=pt(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(i.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?We(t.mode,i.state):null,l=ht(e,o,i,!0);s&&(i.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var h=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&dn)return ir(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Qi(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mi(e))return!1;dr(e)&&(pi(e),t.dims=oi(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),a=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),wt&&(o=zt(e.doc,o),a=Ft(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=on(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=on(e,t,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,ui(e,n)))),i.viewTo=n}(e,o,a),n.viewOffset=Vt(Ue(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=mi(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=M();if(!t||!A(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&A(e.display.lineDiv,i.anchorNode)&&(n.anchorNode=i.anchorNode,n.anchorOffset=i.anchorOffset,n.focusNode=i.focusNode,n.focusOffset=i.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var i=e.display,r=e.options.lineNumbers,o=i.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=i.view,u=i.viewFrom,h=0;h-1&&(p=!1),un(e,d,u,n)),p&&(O(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Qe(e.options,u)))),a=d.node.nextSibling}else{var f=vn(e,d,u,n);o.insertBefore(f,a)}u+=d.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=M()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&A(document.body,e.anchorNode)&&A(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),O(n.cursorDiv),O(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ir(e,400)),n.updateLineNumbers=null,!0}function sr(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=On(e))i&&(t.visible=Ni(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-Nn(e),n.top)}),t.visible=Ni(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ar(e,t))break;_i(e);var r=Bi(e);gi(e),Hi(e,r),ur(e,r),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function lr(e,t){var n=new or(e,t);if(ar(e,n)){_i(e),sr(e,n);var i=Bi(e);gi(e),Hi(e,i),ur(e,i),n.finish()}}function cr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ur(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+_n(e)+"px"}function hr(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=ai(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",a=0;as.clientWidth,u=s.scrollHeight>s.clientHeight;if(r&&c||o&&u){if(o&&y&&l)e:for(var d=t.target,p=a.view;d!=s;d=d.parentNode)for(var f=0;f=0&&tt(e,i.to())<=0)return n}return-1};var kr=function(e,t){this.anchor=e,this.head=t};function Sr(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort((function(e,t){return tt(e.from(),t.from())})),n=F(t,r);for(var o=1;o0:l>=0){var c=ot(s.from(),a.from()),u=rt(s.to(),a.to()),h=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new kr(h?u:c,h?c:u))}}return new wr(t,n)}function Er(e,t){return new wr([new kr(e,t||e)],0)}function _r(e){return e.text?et(e.from.line+e.text.length-1,$(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Or(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return _r(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=_r(t).ch-t.to.ch),et(n,i)}function Nr(e,t){for(var n=[],i=0;i1&&e.remove(s.line+1,f-1),e.insert(s.line+1,v)}ln(e,"change",e,t)}function Dr(e,t,n){!function e(i,r,o){if(i.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(zr(e.done),$(e.done)):e.done.length&&!$(e.done).ranges?$(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),$(e.done)):void 0}(r,r.lastOp==i)))a=$(o.changes),0==tt(t.from,t.to)&&0==tt(t.from,a.to)?a.to=_r(t):o.changes.push(Br(e,t));else{var l=$(r.done);for(l&&l.ranges||Wr(e.sel,r.done),o={changes:[Br(e,t)],generation:r.generation},r.done.push(o);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,a||fe(e,"historyAdded")}function Hr(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||function(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,$(r.done),t))?r.done[r.done.length-1]=t:Wr(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&zr(r.undone)}function Wr(e,t){var n=$(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Vr(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Gr(e){if(!e)return null;for(var t,n=0;n-1&&($(s)[h]=c[h],delete c[h])}}}return i}function qr(e,t,n,i){if(i){var r=e.anchor;if(n){var o=tt(t,r)<0;o!=tt(n,r)<0?(r=t,t=n):o!=tt(t,n)<0&&(t=n)}return new kr(r,t)}return new kr(n||t,t)}function $r(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Qr(e,new wr([qr(e.sel.primary(),t,n,r)],0),i)}function Yr(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(r&&(fe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var h=l.find(i<0?1:-1),d=void 0;if((i<0?u:c)&&(h=ao(e,h,-i,h&&h.line==t.line?o:null)),h&&h.line==t.line&&(d=tt(h,n))&&(i<0?d<0:d>0))return ro(e,h,t,i,r)}var p=l.find(i<0?-1:1);return(i<0?c:u)&&(p=ao(e,p,i,p.line==t.line?o:null)),p?ro(e,p,t,i,r):null}}return t}function oo(e,t,n,i,r){var o=i||1,a=ro(e,t,n,o,r)||!r&&ro(e,t,n,o,!0)||ro(e,t,n,-o,r)||!r&&ro(e,t,n,-o,!0);return a||(e.cantEdit=!0,et(e.first,0))}function ao(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?st(e,et(t.line-1)):null:n>0&&t.ch==(i||Ue(e,t.line)).text.length?t.line0)){var u=[l,1],h=tt(c.from,s.from),d=tt(c.to,s.to);(h<0||!a.inclusiveLeft&&!h)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)uo(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else uo(e,t)}}function uo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var n=Nr(e,t);Fr(e,t,n,e.cm?e.cm.curOp.id:NaN),fo(e,t,n,_t(e,t));var i=[];Dr(e,(function(e,n){n||-1!=F(i,e.history)||(yo(e.history,t),i.push(e.history)),fo(e,t,null,_t(e,t))}))}}function ho(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--p){var f=d(p);if(f)return f.v}}}}function po(e,t){if(0!=t&&(e.first+=t,e.sel=new wr(Y(e.sel.ranges,(function(e){return new kr(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){hi(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;ie.lastLine())){if(t.from.lineo&&(t={from:t.from,to:et(o,Ue(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=Nr(e,t)),e.cm?function(e,t,n){var i=e.doc,r=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=Xe(Bt(Ue(i,o.line))),i.iter(l,a.line+1,(function(e){if(e==r.maxLine)return s=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&ge(e),jr(i,t,n,si(e)),e.options.lineWrapping||(i.iter(l,o.line+t.text.length,(function(e){var t=Gt(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;i--){var r=Ue(e,i).stateAfter;if(r&&(!(r instanceof ct)||i+r.lookAhead1||!(this.children[0]instanceof xo))){var s=[];this.collapse(s),this.children=[new xo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=r.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=L("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Rt(e,t.line,t,n,o)||t.line!=n.line&&Rt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");wt=!0}o.addToHistory&&Fr(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Bt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Ye(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new kt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ht(e,t)&&Ye(t,0)})),o.clearOnEnter&&he(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ct=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)hi(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)di(c,u,"text");o.atomic&&no(c.doc),ln(c,"markerAdded",c,o)}return o}Eo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ui(e),ve(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&hi(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&no(e.doc)),e&&ln(e,"markerCleared",e,this,i,r),t&&qi(e),this.parent&&this.parent.clear()}},Eo.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r=0;l--)co(this,i[l]);s?Jr(this,s):this.cm&&Ai(this.cm)})),undo:nr((function(){ho(this,"undo")})),redo:nr((function(){ho(this,"redo")})),undoSelection:nr((function(){ho(this,"undo",!0)})),redoSelection:nr((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=st(this,e),t=st(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;ie)return t=e,!0;e-=o,++n})),st(this,et(n,t))},indexFromPos:function(e){var t=(e=st(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),eo(t.doc,Er(n,n)),d)for(var p=0;p=0;t--)mo(e.doc,"",i[t].from,i[t].to,"+delete");Ai(e)}))}function Jo(e,t,n){var i=re(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Qo(e,t,n){var i=Jo(e,t.ch,n);return null==i?null:new et(t.line,i,n<0?"after":"before")}function ea(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var o=ce(n,t.doc.direction);if(o){var a,s=r<0?$(o):o[0],l=r<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Mn(t,n);a=r<0?n.text.length-1:0;var u=jn(t,c,a).top;a=oe((function(e){return jn(t,c,e).top==u}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Jo(n,a,1))}else a=r<0?s.to:s.from;return new et(i,a,l)}}return new et(i,r<0?n.text.length:0,r<0?"before":"after")}Vo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Vo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Vo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Vo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Vo.default=y?Vo.macDefault:Vo.pcDefault;var ta={selectAll:so,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),W)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var n=Ue(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)r=new et(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),et(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var a=Ue(e.doc,r.line-1).text;a&&(r=new et(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),et(r.line-1,a.length-1),r,"+transpose"))}n.push(new kr(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return Qi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i-1&&(tt((r=c.ranges[r]).from(),t)<0||t.xRel>0)&&(tt(r.to(),t)>0||t.xRel<0)?function(e,t,n,i){var r=e.display,o=!1,c=er(e,(function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,pe(r.wrapper.ownerDocument,"mouseup",c),pe(r.wrapper.ownerDocument,"mousemove",u),pe(r.scroller,"dragstart",h),pe(r.scroller,"drop",c),o||(be(t),i.addNew||$r(e.doc,n,null,null,i.extend),l&&!d||a&&9==s?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return o=!0};l&&(r.scroller.draggable=!0),e.state.draggingText=c,c.copy=!i.moveOnDrag,r.scroller.dragDrop&&r.scroller.dragDrop(),he(r.wrapper.ownerDocument,"mouseup",c),he(r.wrapper.ownerDocument,"mousemove",u),he(r.scroller,"dragstart",h),he(r.scroller,"drop",c),ki(e),setTimeout((function(){return r.input.focus()}),20)}(e,i,t,o):function(e,t,n,i){var r=e.display,o=e.doc;be(t);var a,s,l=o.sel,c=l.ranges;if(i.addNew&&!i.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new kr(n,n)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(a=new kr(n,n)),n=ci(e,t,!0,!0),s=-1;else{var u=va(e,n,i.unit);a=i.extend?qr(a,u.anchor,u.head,i.extend):u}i.addNew?-1==s?(s=c.length,Qr(o,Sr(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==i.unit&&!i.extend?(Qr(o,Sr(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Xr(o,s,a,V):(s=0,Qr(o,new wr([a],0),V),l=o.sel);var h=n;function d(t){if(0!=tt(h,t))if(h=t,"rectangle"==i.unit){for(var r=[],c=e.options.tabSize,u=B(Ue(o,n.line).text,n.ch,c),d=B(Ue(o,t.line).text,t.ch,c),p=Math.min(u,d),f=Math.max(u,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Ue(o,m).text,y=K(v,p,c);p==f?r.push(new kr(et(m,y),et(m,y))):v.length>y&&r.push(new kr(et(m,y),et(m,K(v,f,c))))}r.length||r.push(new kr(n,n)),Qr(o,Sr(e,l.ranges.slice(0,s).concat(r),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,C=va(e,t,i.unit),w=x.anchor;tt(C.anchor,w)>0?(b=C.head,w=ot(x.from(),C.anchor)):(b=C.anchor,w=rt(x.to(),C.head));var k=l.ranges.slice(0);k[s]=function(e,t){var n=t.anchor,i=t.head,r=Ue(e.doc,n.line);if(0==tt(n,i)&&n.sticky==i.sticky)return t;var o=ce(r);if(!o)return t;var a=se(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=se(o,i.ch,i.sticky),h=u-a||(i.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=o[c+(l?-1:0)],p=l==(1==d.level),f=p?d.from:d.to,m=p?"after":"before";return n.ch==f&&n.sticky==m?t:new kr(new et(n.line,f,m),i)}(e,new kr(st(o,w),b)),Qr(o,Sr(e,k,s),V)}}var p=r.wrapper.getBoundingClientRect(),f=0;function m(t){e.state.selectingText=!1,f=1/0,t&&(be(t),r.input.focus()),pe(r.wrapper.ownerDocument,"mousemove",g),pe(r.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=er(e,(function(t){0!==t.buttons&&Se(t)?function t(n){var a=++f,s=ci(e,n,!0,"rectangle"==i.unit);if(s)if(0!=tt(s,h)){e.curOp.focus=M(),d(s);var l=Ni(r,o);(s.line>=l.to||s.linep.bottom?20:0;c&&setTimeout(er(e,(function(){f==a&&(r.scroller.scrollTop+=c,t(n))})),50)}}(t):m(t)})),v=er(e,m);e.state.selectingText=v,he(r.wrapper.ownerDocument,"mousemove",g),he(r.wrapper.ownerDocument,"mouseup",v)}(e,i,t,o)}(t,i,o,e):ke(e)==n.scroller&&be(e):2==r?(i&&$r(t.doc,i),setTimeout((function(){return n.input.focus()}),20)):3==r&&(k?t.display.input.onContextMenu(e):ki(t)))}}function va(e,t,n){if("char"==n)return new kr(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new kr(et(t.line,0),st(e.doc,et(t.line+1,0)));var i=n(e,t);return new kr(i.from,i.to)}function ya(e,t,n,i){var r,o;if(t.touches)r=t.touches[0].clientX,o=t.touches[0].clientY;else try{r=t.clientX,o=t.clientY}catch(e){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&be(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ve(e,n))return Ce(t);o-=s.top-a.viewOffset;for(var l=0;l=r)return fe(e,n,e,Ze(e.doc,o),e.display.gutterSpecs[l].className,t),Ce(t)}}function ba(e,t){return ya(e,t,"gutterClick",!0)}function xa(e,t){wn(e.display,t)||function(e,t){return!!ve(e,"gutterContextMenu")&&ya(e,t,"gutterContextMenu",!1)}(e,t)||me(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Ca(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Fn(e)}ma.prototype.compare=function(e,t,n){return this.time+400>e&&0==tt(t,this.pos)&&n==this.button};var wa={toString:function(){return"CodeMirror.Init"}},ka={},Sa={};function Ea(e,t,n){if(!t!=!(n&&n!=wa)){var i=e.display.dragFunctions,r=t?he:pe;r(e.display.scroller,"dragstart",i.start),r(e.display.scroller,"dragenter",i.enter),r(e.display.scroller,"dragover",i.over),r(e.display.scroller,"dragleave",i.leave),r(e.display.scroller,"drop",i.drop)}}function _a(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(_(e.display.wrapper,"CodeMirror-wrap"),Kt(e)),li(e),hi(e),Fn(e),setTimeout((function(){return Hi(e)}),100)}function Oa(e,t){var n=this;if(!(this instanceof Oa))return new Oa(e,t);this.options=t=t?R(t):{},R(ka,t,!1);var i=t.value;"string"==typeof i?i=new Ao(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var r=new Oa.inputStyles[t.inputStyle](this),o=this.display=new gr(e,i,r,t);for(var c in o.wrapper.CodeMirror=this,Ca(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Gi(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",er(e,ga)),he(t.scroller,"dblclick",a&&s<11?er(e,(function(t){if(!me(e,t)){var n=ci(e,t);if(n&&!ba(e,t)&&!wn(e.display,t)){be(t);var i=e.findWordAt(n);$r(e.doc,i.anchor,i.head)}}})):function(t){return me(e,t)||be(t)}),he(t.scroller,"contextmenu",(function(t){return xa(e,t)})),he(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||xa(e,n)}));var n,i={end:0};function r(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(i=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,i=t.top-e.top;return n*n+i*i>400}he(t.scroller,"touchstart",(function(r){if(!me(e,r)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(r)&&!ba(e,r)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!wn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!i.prev||o(i,i.prev)?new kr(s,s):!i.prev.prev||o(i,i.prev.prev)?e.findWordAt(s):new kr(et(s.line,0),st(e.doc,et(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),be(n)}r()})),he(t.scroller,"touchcancel",r),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Pi(e,t.scroller.scrollTop),Ri(e,t.scroller.scrollLeft,!0),fe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return Cr(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return Cr(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){me(e,t)||we(t)},over:function(t){me(e,t)||(function(e,t){var n=ci(e,t);if(n){var i=document.createDocumentFragment();yi(e,n,i),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,i)}}(e,t),we(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Mo<100))we(t);else if(!me(e,t)&&!wn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=T("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(e,t)},drop:er(e,jo),leave:function(t){me(e,t)||Do(e)}};var l=t.input.getField();he(l,"keyup",(function(t){return ha.call(e,t)})),he(l,"keydown",er(e,ua)),he(l,"keypress",er(e,da)),he(l,"focus",(function(t){return Si(e,t)})),he(l,"blur",(function(t){return Ei(e,t)}))}(this),Ro(),Ui(this),this.curOp.forceUpdate=!0,Pr(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Si(n)}),20):Ei(this),Sa)Sa.hasOwnProperty(c)&&Sa[c](this,t[c],wa);dr(this),t.finishInit&&t.finishInit(this);for(var u=0;u150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?B(Ue(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,h+="\t";if(da,l=Ae(t),c=null;if(s&&i.ranges.length>1)if(La&&La.text.join("\n")==t){if(i.ranges.length%La.text.length==0){c=[];for(var u=0;u=0;d--){var p=i.ranges[d],f=p.from(),m=p.to();p.empty()&&(n&&n>0?f=et(f.line,f.ch-n):e.state.overwrite&&!s?m=et(m.line,Math.min(Ue(o,m.line).text.length,m.ch+$(l).length)):s&&La&&La.lineWise&&La.text.join("\n")==l.join("\n")&&(f=m=et(f.line,0)));var g={from:f,to:m,text:c?c[d%c.length]:l,origin:r||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};co(e.doc,g),ln(e,"inputRead",e,g)}t&&!s&&Da(e,t),Ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ja(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qi(t,(function(){return Ma(t,n,0,null,"paste")})),!0}function Da(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Ta(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ue(e.doc,r.head.line).text.slice(0,r.head.ch))&&(a=Ta(e,r.head.line,"smart"));a&&ln(e,"electricInput",e,r.head.line)}}}function Pa(e){for(var t=[],n=[],i=0;i0?0:-1));a=isNaN(u)?null:new et(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=r?function(e,t,n,i){var r=ce(t,e.doc.direction);if(!r)return Qo(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=se(r,n.ch,n.sticky),a=r[o];if("ltr"==e.doc.direction&&a.level%2==0&&(i>0?a.to>n.ch:a.from=a.from&&d>=u.begin)){var p=h?"before":"after";return new et(n.line,d,p)}}var f=function(e,t,i){for(var o=function(e,t){return t?new et(n.line,l(e,1),"before"):new et(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?i.begin:l(i.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==g||i>0&&g==t.text.length||!(m=f(i>0?0:r.length-1,i,c(g)))?null:m}(e.cm,s,t,n):Qo(s,t,n);if(null==a){if(o||(c=t.line+l)=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(s=Ue(e,c))))return!1;t=ea(r,e.cm,s,t.line,l)}else t=a;return!0}if("char"==i||"codepoint"==i)c();else if("column"==i)c(!0);else if("word"==i||"group"==i)for(var u=null,h="group"==i,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var f=s.text.charAt(t.ch)||"\n",m=ee(f,d)?"w":h&&"\n"==f?"n":!h||/\s/.test(f)?null:"p";if(!h||p||m||(m="s"),u&&u!=m){n<0&&(n=1,c(),t.sticky="after");break}if(m&&(u=m),n>0&&!c(!p))break}var g=oo(e,t,o,a,!0);return nt(o,g)&&(g.hitSide=!0),g}function za(e,t,n,i){var r,o,a=e.doc,s=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ii(e.display),3);r=(n>0?t.bottom:t.top)+n*c}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,r)).outside;){if(n<0?r<=0:r>=a.height){o.hitSide=!0;break}r+=5*n}return o}var Fa=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ha(e,t){var n=An(e,t.line);if(!n||n.hidden)return null;var i=Ue(e.doc,t.line),r=Tn(n,i,t.line),o=ce(i,e.doc.direction),a="left";o&&(a=se(o,t.ch)%2?"right":"left");var s=In(r.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Wa(e,t){return t&&(e.bad=!0),e}function Va(e,t,n){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[n]))return Wa(e.clipPos(et(e.display.viewTo-1)),!0);t=null,n=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var r=0;r=t.display.viewTo||o.line=t.display.viewFrom&&Ha(t,r)||{node:l[0].measure.map[2],offset:0},u=o.linei.firstLine()&&(a=et(a.line-1,Ue(i.doc,a.line-1).length)),s.ch==Ue(i.doc,s.line).text.length&&s.liner.viewTo-1)return!1;a.line==r.viewFrom||0==(e=ui(i,a.line))?(t=Xe(r.view[0].line),n=r.view[0].node):(t=Xe(r.view[e].line),n=r.view[e-1].node.nextSibling);var l,c,u=ui(i,s.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=Xe(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;for(var h=i.doc.splitLines(function(e,t,n,i,r){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(e){e&&(c(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,d=t.getAttribute("cm-marker");if(d){var p=e.findMarks(et(i,0),et(r+1,0),(g=+d,function(e){return e.id==g}));return void(p.length&&(o=p[0].find(0))&&u(qe(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&c();for(var m=0;m1&&d.length>1;)if($(h)==$(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var p=0,f=0,m=h[0],g=d[0],v=Math.min(m.length,g.length);pa.ch&&y.charCodeAt(y.length-f-1)==b.charCodeAt(b.length-f-1);)p--,f++;h[h.length-1]=y.slice(0,y.length-f).replace(/^\u200b+/,""),h[0]=h[0].slice(p).replace(/\u200b+$/,"");var C=et(t,p),w=et(l,d.length?$(d).length-f:0);return h.length>1||h[0]||tt(C,w)?(mo(i.doc,h,C,w,"+input"),!0):void 0},Fa.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fa.prototype.reset=function(){this.forceCompositionEnd()},Fa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fa.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Fa.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qi(this.cm,(function(){return hi(e.cm)}))},Fa.prototype.setUneditable=function(e){e.contentEditable="false"},Fa.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||er(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Fa.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Fa.prototype.onContextMenu=function(){},Fa.prototype.resetPosition=function(){},Fa.prototype.needsContentAttribute=!0;var Ka=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};Ka.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function o(e){if(!me(i,e)){if(i.somethingSelected())Aa({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Pa(i);Aa({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,W):(n.prevInput="",r.value=t.text.join("\n"),P(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),he(r,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),he(r,"paste",(function(e){me(i,e)||ja(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),he(r,"cut",o),he(r,"copy",o),he(e.scroller,"paste",(function(t){if(!wn(e,t)&&!me(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,r.dispatchEvent(o)}})),he(e.lineSpace,"selectstart",(function(t){wn(e,t)||be(t)})),he(r,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),he(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Ka.prototype.createField=function(e){this.wrapper=Ra(),this.textarea=this.wrapper.firstChild},Ka.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ka.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=vi(e);if(e.options.moveInputWithCursor){var r=qn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},Ka.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ka.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},Ka.prototype.getField=function(){return this.textarea},Ka.prototype.supportsTouch=function(){return!1},Ka.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ka.prototype.blur=function(){this.textarea.blur()},Ka.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ka.prototype.receivedFocus=function(){this.slowPoll()},Ka.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Ka.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Ka.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Me(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===r||y&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,r.length);l1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},Ka.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ka.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},Ka.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=ci(n,e),c=i.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&er(n,Qr)(n.doc,Er(o),W);var u,d=r.style.cssText,p=t.wrapper.style.cssText,f=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),i.input.focus(),l&&window.scrollTo(null,u),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=v,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),a&&s>=9&&g(),k){we(e);var m=function(){pe(window,"mouseup",m),setTimeout(v,20)};he(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=r.selectionStart){var e=n.somethingSelected(),o="​"+(e?r.value:"");r.value="⇚",r.value=o,t.prevInput=e?"":"​",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,r.style.cssText=d,a&&s<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==t.prevInput?er(n,so)(n):e++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},Ka.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Ka.prototype.setUneditable=function(){},Ka.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=wa&&r(e,t,n)}:r)}e.defineOption=n,e.Init=wa,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Lr(e)}),!0),n("indentUnit",2,Lr,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ar(e),Fn(e),hi(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(et(i,o))}i++}));for(var r=n.length-1;r>=0;r--)mo(e.doc,t,n[r],et(n[r].line,n[r].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=wa&&e.refresh()})),n("specialCharPlaceholder",Jt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ca(e),mr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Xo(t),r=n!=wa&&Xo(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,_a,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=pr(t,e.options.lineNumbers),mr(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?ai(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Hi(e)}),!0),n("scrollbarStyle","native",(function(e){Gi(e),Hi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=pr(e.options.gutters,t),mr(e)}),!0),n("firstLineNumber",1,mr,!0),n("lineNumberFormatter",(function(e){return e}),mr,!0),n("showCursorWhenSelecting",!1,gi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Ei(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ea),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gi,!0),n("singleCursorHeightPerLine",!0,gi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ar,!0),n("addModeClass",!1,Ar,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ar,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Oa),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var i=this.options,r=i[e];i[e]==n&&"mode"!=e||(i[e]=n,t.hasOwnProperty(e)&&er(this,t[e])(this,n,r),fe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Ta(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&Ai(this));else{var o=r.from(),a=r.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Xr(this.doc,i,new kr(o,c[i].to()),W)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=st(this.doc,e);var t,n=dt(this,Ue(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]o&&(e=o,r=!0),i=Ue(this.doc,e)}else i=e;return Gn(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-Vt(i):0)},defaultTextHeight:function(){return ii(this.display)},defaultCharWidth:function(){return ri(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o,a,s,l=this.display,c=(e=qn(this,st(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==i)c=e.top;else if("above"==i||"near"==i){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==r?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?u=0:"middle"==r&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Ti(o,a)).scrollTop&&Pi(o,s.scrollTop),null!=s.scrollLeft&&Ri(o,s.scrollLeft))},triggerOnKeyDown:tr(ua),triggerOnKeyPress:tr(da),triggerOnKeyUp:ha,triggerOnMouseDown:tr(ga),execCommand:function(e){if(ta.hasOwnProperty(e))return ta[e].call(null,this)},triggerElectric:tr((function(e){Da(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=st(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;i.5||this.options.lineWrapping)&&li(this),fe(this,"refresh",this)})),swapDoc:tr((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Pr(this,e),Fn(this),this.display.input.reset(),Mi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,o){e.registerHelper(t,i,o),n[t]._global.push({pred:r,val:o})}}(Oa);var Ua="iter insert remove copy getEditor constructor".split(" ");for(var qa in Ao.prototype)Ao.prototype.hasOwnProperty(qa)&&F(Ua,qa)<0&&(Oa.prototype[qa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ao.prototype[qa]));return ye(Ao),Oa.inputStyles={textarea:Ka,contenteditable:Fa},Oa.defineMode=function(e){Oa.defaults.mode||"null"==e||(Oa.defaults.mode=e),Re.apply(this,arguments)},Oa.defineMIME=function(e,t){Ie[e]=t},Oa.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Oa.defineMIME("text/plain","null"),Oa.defineExtension=function(e,t){Oa.prototype[e]=t},Oa.defineDocExtension=function(e,t){Ao.prototype[e]=t},Oa.fromTextArea=function(e,t){if((t=t?R(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=M();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=s.getValue()}var r;if(e.form&&(he(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var a=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(pe(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var s=Oa((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=pe,e.on=he,e.wheelEventPixels=xr,e.Doc=Ao,e.splitLines=Ae,e.countColumn=B,e.findColumn=K,e.isWordChar=Q,e.Pass=H,e.signal=fe,e.Line=Ut,e.changeEnd=_r,e.scrollbarModel=Vi,e.Pos=et,e.cmpPos=tt,e.modes=Pe,e.mimeModes=Ie,e.resolveMode=Be,e.getMode=ze,e.modeExtensions=Fe,e.extendMode=He,e.copyState=We,e.startState=Ge,e.innerMode=Ve,e.commands=ta,e.keyMap=Vo,e.keyName=Yo,e.isModifierKey=qo,e.lookupKey=Uo,e.normalizeKeyMap=Ko,e.StringStream=Ke,e.SharedTextMarker=Oo,e.TextMarker=Eo,e.LineWidget=wo,e.e_preventDefault=be,e.e_stopPropagation=xe,e.e_stop=we,e.addClass=j,e.contains=A,e.rmClass=_,e.keyNames=zo}(Oa),Oa.version="5.58.2",Oa}()},WaYH: /*!*********************************************************!*\ !*** ./node_modules/rc-tree/es/TreeNode.js + 1 modules ***! \*********************************************************/ /*! exports provided: InternalTreeNode, default */ /*! exports used: default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/contextTypes.js because of ./node_modules/rc-tree/es/Tree.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/util.js because of ./node_modules/antd/es/table/hooks/useSelection.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tree/es/utils/treeUtil.js because of ./node_modules/antd/es/table/hooks/useSelection.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,n){"use strict";var i=n("rePB"),r=n("Ff2n"),o=n("VTBJ"),a=n("1OyB"),s=n("vuIU"),l=n("JX7q"),c=n("Ji7U"),u=n("LK+K"),h=n("q1tI"),d=n("TSYQ"),p=n.n(d),f=n("sboe"),m=n("OZM5"),g=function(e){var t=e.prefixCls,n=e.level,r=e.isStart,o=e.isEnd;if(!n)return null;for(var a="".concat(t,"-indent-unit"),s=[],l=0;l1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&N[n])return N[n];var i=window.getComputedStyle(e),r=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),o=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),a=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),s=O.map((function(e){return"".concat(e,":").concat(i.getPropertyValue(e))})).join(";"),l={sizingStyle:s,paddingSize:o,borderSize:a,boxSizing:r};return t&&n&&(N[n]=l),l}var L,A=n("Gytx"),M=n.n(A);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(L||(L={}));var j=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var o;return Object(r.a)(this,n),(o=t.call(this,e)).nextFrameActionId=void 0,o.resizeFrameId=void 0,o.textArea=void 0,o.saveTextArea=function(e){o.textArea=e},o.handleResize=function(e){var t=o.state.resizeStatus,n=o.props,i=n.autoSize,r=n.onResize;t===L.NONE&&("function"==typeof r&&r(e),i&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var e=o.props.autoSize;if(e&&o.textArea){var t=e.minRows,n=e.maxRows,i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;C||((C=document.createElement("textarea")).setAttribute("tab-index","-1"),C.setAttribute("aria-hidden","true"),document.body.appendChild(C)),e.getAttribute("wrap")?C.setAttribute("wrap",e.getAttribute("wrap")):C.removeAttribute("wrap");var r=T(e,t),o=r.paddingSize,a=r.borderSize,s=r.boxSizing,l=r.sizingStyle;C.setAttribute("style","".concat(l,";").concat(_)),C.value=e.value||e.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,d=C.scrollHeight;if("border-box"===s?d+=a:"content-box"===s&&(d-=o),null!==n||null!==i){C.value=" ";var p=C.scrollHeight-o;null!==n&&(u=p*n,"border-box"===s&&(u=u+o+a),d=Math.max(u,d)),null!==i&&(h=p*i,"border-box"===s&&(h=h+o+a),c=d>h?"":"hidden",d=Math.min(h,d))}return{height:d,minHeight:u,maxHeight:h,overflowY:c,resize:"none"}}(o.textArea,!1,t,n);o.setState({textareaStyles:i,resizeStatus:L.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:L.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:L.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var e=o.props,t=e.prefixCls,n=void 0===t?"rc-textarea":t,r=e.autoSize,a=e.onResize,s=e.className,h=e.disabled,d=o.state,p=d.textareaStyles,f=d.resizeStatus,m=Object(k.a)(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),g=E()(n,s,Object(u.a)({},"".concat(n,"-disabled"),h));"value"in m&&(m.value=m.value||"");var v=Object(c.a)(Object(c.a)(Object(c.a)({},o.props.style),p),f===L.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(w,{onResize:o.handleResize,disabled:!(r||a)},l.createElement("textarea",Object(i.a)({},m,{className:g,style:v,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:L.NONE},o}return Object(o.a)(n,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&M()(e.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),n}(l.Component),D=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(e){var i;Object(r.a)(this,n),(i=t.call(this,e)).resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(e){i.resizableTextArea=e},i.handleChange=function(e){var t=i.props.onChange;i.setValue(e.target.value,(function(){i.resizableTextArea.resizeTextarea()})),t&&t(e)},i.handleKeyDown=function(e){var t=i.props,n=t.onPressEnter,r=t.onKeyDown;13===e.keyCode&&n&&n(e),r&&r(e)};var o=void 0===e.value||null===e.value?e.defaultValue:e.value;return i.state={value:o},i}return Object(o.a)(n,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(j,Object(i.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),n}(l.Component);t.default=D},YBdh: /*!*******************************************!*\ !*** ./src/assets/images/paper/xiren.svg ***! \*******************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/xiren.a6554bc1.svg"},ZW9T: /*!************************************************************!*\ !*** ./src/components/monaco-editor/index.jsx + 1 modules ***! \************************************************************/ /*! exports provided: getLanguageByMirrorName, default, DiffEditor */ /*! exports used: DiffEditor, default */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */ /*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var i=n("k1fw"),r=(n("miYZ"),n("tsqr")),o=n("rAM+"),a=n("tJVT"),s=n("PpiC"),l=n("q1tI"),c=n.n(l),u=n("bdgK");function h(e,t,n,r,o){var a=t.getWordUntilPosition(n),s={startLineNumber:n.lineNumber,endLineNumber:n.lineNumber,startColumn:a.startColumn,endColumn:a.endColumn},l=r.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}}));return o.map((function(e){l.push(Object(i.a)(Object(i.a)({},e),{},{range:s}))})),l}n("LvDl");function d(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function p(){}var f={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var n=0;n0||i.target.offsetWidth>0)&&K.current.instance.layout()}}catch(e){n.e(e)}finally{n.f()}}))).observe(G.current),e}();return J(!0),function(){var e=K.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),K.current.subscription&&K.current.subscription.dispose(),P&&window.removeEventListener("paste",ee),n.unobserve(G.current)}}catch(e){}}))}),[]),Object(l.useEffect)((function(){if(K.current.instance&&Z)return document.addEventListener("keydown",te,!1),function(){document.removeEventListener("keydown",te)}}),[A,Z]),Object(l.useEffect)((function(){var e=K.current.instance;if(e&&Z){var t=m(C);g.editor.setModelLanguage(e.getModel(),t),console.log("language:",C,e.getModel(),t)}}),[C,Z]),Object(l.useEffect)((function(){K.current.instance&&Z&&g.editor.setTheme(T)}),[T,Z]),Object(l.useEffect)((function(){var e=K.current.instance;e&&Z&&(e.updateOptions(Object(i.a)({},E)),setTimeout((function(){e.getModel().updateOptions(Object(i.a)({},E))}),200))}),[JSON.stringify(E),Z]),Object(l.useEffect)((function(){var e=K.current.instance;e&&Z&&e.layout()}),[f,y,Z]);var re=Object(l.useState)(d(f)),oe=Object(a.a)(re,2),ae=oe[0],se=(oe[1],Object(l.useState)(d(y))),le=Object(a.a)(se,2),ce=le[0],ue=le[1],he=Object(i.a)(Object(i.a)({},k),{},{width:ae,height:ce});return c.a.createElement("div",{className:"my-monaco-editor",ref:G,style:he})};function v(e){var t=e.width,r=void 0===t?"100%":t,s=e.height,h=void 0===s?"100%":s,p=e.original,f=e.modified,m=e.language,v=e.options,y=void 0===v?{}:v,b=Object(l.useRef)(),x=Object(l.useState)(null),C=Object(a.a)(x,2),w=C[0],k=C[1];Object(l.useEffect)((function(){b.current&&n.e(/*! import() | monaco-editor */27).then(n.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){var t=(g=e).editor.createDiffEditor(b.current,Object(i.a)(Object(i.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},y),{},{wordWrap:!0}));k(t);var n=function(e){var t;return b.current&&(t=new u.default((function(t){var n,i=Object(o.a)(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&e.layout()}}catch(e){i.e(e)}finally{i.f()}}))).observe(b.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),n.unobserve(b.current)}}))}),[]),Object(l.useEffect)((function(){w&&w.setModel({original:g.editor.createModel(p,m),modified:g.editor.createModel(f,m)})}),[p,f,m,w]);var S={width:d(r),height:d(h)};return c.a.createElement("div",{className:"my-diff-editor",ref:b,style:S})}},ZpRC: /*!*************************************************************************!*\ !*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***! \*************************************************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";function i(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function r(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function o(e,t){if(e.clientHeightt||o>e&&a=t&&s>=n?o-e-i:a>t&&sn?a-t+r:0}var s=function(e,t){var n=window,r=t.scrollMode,s=t.block,l=t.inline,c=t.boundary,u=t.skipOverflowHiddenElements,h="function"==typeof c?c:function(e){return e!==c};if(!i(e))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,p=[],f=e;i(f)&&h(f);){if((f=f.parentElement)===d){p.push(f);break}null!=f&&f===document.body&&o(f)&&!o(document.documentElement)||null!=f&&o(f,u)&&p.push(f)}for(var m=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),x=b.height,C=b.width,w=b.top,k=b.right,S=b.bottom,E=b.left,_="start"===s||"nearest"===s?w:"end"===s?S:w+x/2,O="center"===l?E+C/2:"end"===l?k:E,N=[],T=0;T=0&&E>=0&&S<=g&&k<=m&&w>=D&&S<=I&&E>=R&&k<=P)return N;var B=getComputedStyle(L),z=parseInt(B.borderLeftWidth,10),F=parseInt(B.borderTopWidth,10),H=parseInt(B.borderRightWidth,10),W=parseInt(B.borderBottomWidth,10),V=0,G=0,K="offsetWidth"in L?L.offsetWidth-L.clientWidth-z-H:0,U="offsetHeight"in L?L.offsetHeight-L.clientHeight-F-W:0;if(d===L)V="start"===s?_:"end"===s?_-g:"nearest"===s?a(y,y+g,g,F,W,y+_,y+_+x,x):_-g/2,G="start"===l?O:"center"===l?O-m/2:"end"===l?O-m:a(v,v+m,m,z,H,v+O,v+O+C,C),V=Math.max(0,V+y),G=Math.max(0,G+v);else{V="start"===s?_-D-F:"end"===s?_-I+W+U:"nearest"===s?a(D,I,M,F,W+U,_,_+x,x):_-(D+M/2)+U/2,G="start"===l?O-R-z:"center"===l?O-(R+j/2)+K/2:"end"===l?O-P+H+K:a(R,P,j,z,H+K,O,O+C,C);var q=L.scrollLeft,$=L.scrollTop;_+=$-(V=Math.max(0,Math.min($+V,L.scrollHeight-M+U))),O+=q-(G=Math.max(0,Math.min(q+G,L.scrollWidth-j+K)))}N.push({el:L,top:V,left:G})}return N};function l(e){return e===Object(e)&&0!==Object.keys(e).length}t.a=function(e,t){var n=!e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(n?[]:s(e,t));if(!n){var i=function(e){return!1===e?{block:"end",inline:"nearest"}:l(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var i=e.el,r=e.top,o=e.left;i.scroll&&n?i.scroll({top:r,left:o,behavior:t}):(i.scrollTop=r,i.scrollLeft=o)}))}(s(e,i),i.behavior)}}},aRTE: /*!*****************************************************!*\ !*** ./node_modules/qr.js/lib/ErrorCorrectLevel.js ***! \*****************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports={L:1,M:0,Q:3,H:2}},bT9E: /*!*****************************************!*\ !*** ./node_modules/rc-util/es/omit.js ***! \*****************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function r(e,t){var n=Object(i.a)({},e);return Array.isArray(t)&&t.forEach((function(e){delete n[e]})),n}},c5Ni: /*!******************************************************!*\ !*** ./node_modules/codemirror/theme/blackboard.css ***! \******************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},dQei: /*!****************************************!*\ !*** ./node_modules/qr.js/lib/math.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){for(var n={glog:function(e){if(e<1)throw new Error("glog("+e+")");return n.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return n.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},i=0;i<8;i++)n.EXP_TABLE[i]=1<1?s-1:0),c=1;c1?n-1:0),o=1;o=0)return parseInt(t.slice(t.indexOf("e-")+2),10);var n=0;return t.indexOf(".")>=0&&(n=t.length-t.indexOf(".")-1),n},i.getInputDisplayValue=function(e){var t,n=e||i.state,r=n.focused,o=n.inputValue,a=n.value;null==(t=r?o:i.toPrecisionAsStep(a))&&(t="");var s=i.formatWrapper(t);return C(i.props.decimalSeparator)&&(s=s.toString().replace(".",i.props.decimalSeparator)),s},i.recordCursorPosition=function(){try{i.cursorStart=i.input.selectionStart,i.cursorEnd=i.input.selectionEnd,i.currentValue=i.input.value,i.cursorBefore=i.input.value.substring(0,i.cursorStart),i.cursorAfter=i.input.value.substring(i.cursorEnd)}catch(e){}},i.restoreByAfter=function(e){if(void 0===e)return!1;var t=i.input.value,n=t.lastIndexOf(e);if(-1===n)return!1;var r=i.cursorBefore.length;return i.lastKeyCode===f.a.DELETE&&i.cursorBefore.charAt(r-1)===e[0]?(i.fixCaret(r,r),!0):n+e.length===t.length&&(i.fixCaret(n,n),!0)},i.partRestoreByAfter=function(e){return void 0!==e&&Array.prototype.some.call(e,(function(t,n){var r=e.substring(n);return i.restoreByAfter(r)}))},i.isNotCompleteNumber=function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},i.stop=function(){i.autoStepTimer&&clearTimeout(i.autoStepTimer)},i.down=function(e,t,n){i.pressingUpOrDown=!0,i.step("down",e,t,n)},i.up=function(e,t,n){i.pressingUpOrDown=!0,i.step("up",e,t,n)},i.saveInput=function(e){i.input=e};var r=e.value;void 0===r&&(r=e.defaultValue),i.state={focused:e.autoFocus};var a=i.getValidValue(i.toNumber(r));return i.state=g(g({},i.state),{},{inputValue:i.toPrecisionAsStep(a),value:a}),i}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.value,i=t.onChange,r=t.max,o=t.min,a=this.state.focused;if(e){if(!w(e.value,n)||!w(e.max,r)||!w(e.min,o)){var s,l=a?n:this.getValidValue(n);s=this.pressingUpOrDown?l:this.inputting?this.rawInput:this.toPrecisionAsStep(l),this.setState({value:l,inputValue:s})}var c="value"in this.props?n:this.state.value;"max"in this.props&&e.max!==r&&"number"==typeof c&&c>r&&i&&i(r),"min"in this.props&&e.min!==o&&"number"==typeof c&&c1&&void 0!==arguments[1]?arguments[1]:this.props.min,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props.max,i=parseFloat(e);return isNaN(i)?e:(in&&(i=n),i)}},{key:"setValue",value:function(e,t){var n=this.props.precision,i=this.isNotCompleteNumber(parseFloat(e))?null:parseFloat(e),r=this.state.value,o=void 0===r?null:r,a=this.state.inputValue,s=void 0===a?null:a,l="number"==typeof i?i.toFixed(n):"".concat(i),c=i!==o||l!=="".concat(s);return"value"in this.props?(s=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:s},t)):this.setState({value:i,inputValue:this.toPrecisionAsStep(e)},t),c&&this.props.onChange(i),i}},{key:"getMaxPrecision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.props,i=n.precision,r=n.step;if(C(i))return i;var o=this.getPrecision(t),a=this.getPrecision(r),s=this.getPrecision(e);return e?Math.max(s,o+a):o+a}},{key:"getPrecisionFactor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=this.getMaxPrecision(e,t);return Math.pow(10,n)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(e){return this.props.formatter?this.props.formatter(e):e}},{key:"toPrecisionAsStep",value:function(e){if(this.isNotCompleteNumber(e)||""===e)return e;var t=Math.abs(this.getMaxPrecision(e));return isNaN(t)?e.toString():Number(e).toFixed(t)}},{key:"toNumber",value:function(e){var t=this.props.precision,n=this.state.focused,i=e&&e.length>16&&n;return this.isNotCompleteNumber(e)||i?e:C(t)?Math.round(e*Math.pow(10,t))/Math.pow(10,t):Number(e)}},{key:"upStep",value:function(e,t){var n=this.props.step,i=this.getPrecisionFactor(e,t),r=Math.abs(this.getMaxPrecision(e,t)),o=((i*e+i*n*t)/i).toFixed(r);return this.toNumber(o)}},{key:"downStep",value:function(e,t){var n=this.props.step,i=this.getPrecisionFactor(e,t),r=Math.abs(this.getMaxPrecision(e,t)),o=((i*e-i*n*t)/i).toFixed(r);return this.toNumber(o)}},{key:"step",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;this.stop(),t&&(t.persist(),t.preventDefault());var o=this.props;if(!o.disabled){var a=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(a)){var s=this["".concat(e,"Step")](a,i),l=s>o.max||so.max?s=o.max:s=f)||o||a,q=(F||0===F)&&(isNaN(F)||Number(F)<=m)||o||a,$=p()("".concat(n,"-handler"),"".concat(n,"-handler-up"),Object(r.a)({},"".concat(n,"-handler-up-disabled"),U)),Y=p()("".concat(n,"-handler"),"".concat(n,"-handler-down"),Object(r.a)({},"".concat(n,"-handler-down-disabled"),q)),X=s?{onTouchStart:U?y:this.up,onTouchEnd:this.stop}:{onMouseDown:U?y:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Z=s?{onTouchStart:q?y:this.down,onTouchEnd:this.stop}:{onMouseDown:q?y:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return h.a.createElement("div",{className:W,style:g,title:v,onMouseEnter:x,onMouseLeave:C,onMouseOver:w,onMouseOut:k,onFocus:function(){return null},onBlur:function(){return null}},h.a.createElement("div",{className:"".concat(n,"-handler-wrap")},h.a.createElement("span",Object.assign({unselectable:"on"},X,{role:"button","aria-label":"Increase Value","aria-disabled":U,className:$}),c||h.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-up-inner"),onClick:b})),h.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Decrease Value","aria-disabled":q,className:Y}),u||h.a.createElement("span",{unselectable:"on",className:"".concat(n,"-handler-down-inner"),onClick:b}))),h.a.createElement("div",{className:"".concat(n,"-input-wrap")},h.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":m,"aria-valuemax":f,"aria-valuenow":F,required:S,type:O,placeholder:N,onPaste:I,onClick:E,onMouseUp:this.onMouseUp,className:"".concat(n,"-input"),tabIndex:_,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:G?this.onKeyDown:y,onKeyUp:G?this.onKeyUp:y,autoFocus:D,maxLength:j,readOnly:a,disabled:o,max:f,min:m,step:M,name:P,title:v,id:T,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(K),pattern:A,inputMode:L,onInput:R},V))))}}]),n}(h.a.Component);k.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:x,min:-x,step:1,style:{},onChange:y,onKeyDown:y,onPressEnter:y,onFocus:y,onBlur:y,parser:function(e){return e.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var S=k;t.a=S},"e+RI": /*!************************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/AddTags/index.less?modules ***! \************************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={btn:"btn___35XHi",s1:"s1___yzdGB",s2:"s2___3kxXm",btnDisabled:"btnDisabled___lI9pA",btn2:"btn2___2KLJQ"}},"eS0+": /*!************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/List/index.tsx ***! \************************************************************************************/ /*! exports provided: ListGroup, default */ /*! exports used: default */function(e,t,n){"use strict";n(/*! antd/es/input-number/style */"giR+");var i=n(/*! antd/es/input-number */"fyUT"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties */"PpiC"),a=(n(/*! antd/es/select/style */"OaEy"),n(/*! antd/es/select */"2fM7")),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! ./index.less?modules */"2sxD"),u=n.n(c),h=n(/*! @/assets/images/paper/sc.svg */"51dB"),d=n.n(h),p=n(/*! @/assets/images/paper/sm.svg */"5MlY"),f=n.n(p),m=n(/*! @/assets/images/paper/up.svg */"lnNo"),g=n.n(m),v=n(/*! @/assets/images/paper/xiren.svg */"YBdh"),y=n.n(v),b=n(/*! lodash */"LvDl"),x=n(/*! classnames */"TSYQ"),C=n.n(x),w=(a.a.Option,function(e){var t=parseInt(e);return Object(b.isNaN)(t)?0:t}),k=function(e){var t,n,a=e.index,c=e.value,h=void 0===c?[]:c,d=e.onChange,p=e.type,f=e.disabled,m=void 0!==f&&f,v=e.expansion,y=void 0===v||v,x=(Object(o.a)(e,["index","value","onChange","type","disabled","expansion"]),Object(s.useState)(!0)),C=Object(r.a)(x,2),k=C[0],S=C[1],E=function(e,t){var n=Object(b.cloneDeep)(h);n.difficulties[t].num=e,console.log(n,444),d(n)};return console.log("---111-",h),l.a.createElement("div",{className:u.a.ListGroup,style:{borderWidth:a?1:0}},l.a.createElement("div",{className:u.a.a},a+1),l.a.createElement("div",{"data-type":"width",className:u.a.b},null==h?void 0:h.name),l.a.createElement("div",{className:u.a.c},null==h||null===(t=h.difficulties)||void 0===t?void 0:t.map((function(e,t){return l.a.createElement("div",{key:t,style:{display:k?"flex":t?"none":"flex"},className:u.a.c1},l.a.createElement("span",{style:{color:"#777777",marginRight:5}},"难度"),1===e.difficulty&&l.a.createElement("span",{className:u.a.radio},"简单"),2===e.difficulty&&l.a.createElement("span",{className:u.a.radio},"适中"),3===e.difficulty&&l.a.createElement("span",{className:u.a.radio},"困难"),l.a.createElement("span",{style:{color:"#777777",marginRight:5,marginLeft:50}},"抽题数量"),0===a&&0===t?l.a.createElement("div",{id:"".concat(p,"_sum")},l.a.createElement(i.a,{disabled:m,parser:w,onChange:function(e){return E(e,t)},min:0,max:null==e?void 0:e.count,value:(null==e?void 0:e.num)||0,style:{width:66}}),l.a.createElement("span",{style:{display:"none"}},"请输入数量")):l.a.createElement(i.a,{disabled:m,parser:w,onChange:function(e){return E(e,t)},min:0,max:null==e?void 0:e.count,value:(null==e?void 0:e.num)||0,style:{width:66}}),l.a.createElement("span",{style:{marginLeft:5}},"/",null==e?void 0:e.count))}))),l.a.createElement("div",{style:{display:1!==(null==h||null===(n=h.difficulties)||void 0===n?void 0:n.length)&&y?"block":"none"},onClick:function(){return S(!k)},className:u.a.d},k?"收起":"展开",l.a.createElement("img",{style:{marginTop:-2,transform:k?"rotate(0deg)":"rotate(180deg)"},src:g.a,className:"ml5"})))};t.a=function(e){var t,n,a=e.value,c=void 0===a?[]:a,h=e.onChange,p=e.listClassName,m=e.disabled,v=void 0!==m&&m,x=e.expansion,S=void 0===x||x,E=(Object(o.a)(e,["value","onChange","listClassName","disabled","expansion"]),Object(s.useState)(!0)),_=Object(r.a)(E,2),O=_[0],N=_[1],T=function(e){var t,n=e.score||0,i=[];return null==e||null===(t=e.item_banks)||void 0===t||t.forEach((function(e){var t;null==e||null===(t=e.tag_disciplines)||void 0===t||t.forEach((function(e){var t;null==e||null===(t=e.difficulties)||void 0===t||t.forEach((function(e){e.num&&i.push(e.num)}))}))})),i.reduce((function(e,t){return e+t}),0)*n},L=function(e,t,n){var i=Object(b.cloneDeep)(c);i.item_banks[t].tag_disciplines[n]=e;var r=T(i);i.scoreTotal=r,console.log(i,"newValue"),h(i)};return l.a.createElement("div",{className:C()(u.a.list,p)},l.a.createElement("div",{className:u.a.head},l.a.createElement("div",{className:u.a.name},l.a.createElement("b",null),l.a.createElement("span",null,null===(t=[{type:"SINGLE",name:"单选题"},{type:"MULTIPLE",name:"多选题"},{type:"COMPLETION",name:"填空题"},{type:"JUDGMENT",name:"判断题"},{type:"SUBJECTIVE",name:"简答题"},{type:"PROGRAM",name:"编程题"},{type:"PRACTICAL",name:"实训题"},{type:"PHOTOGRAPH",name:"拍照上传题"},{type:"FILEUPLOAD",name:"文件上传题"},{type:"COMBINATION",name:"接龙题"}].find((function(e){return e.type===(null==c?void 0:c.item_type)})))||void 0===t?void 0:t.name)),l.a.createElement("div",{className:u.a.right},S&&l.a.createElement("div",{onClick:function(){return N(!O)},className:"current c-light-primary mb10"},O?"收起":"展开",l.a.createElement("img",{style:{marginTop:-2,transform:O?"rotate(0deg)":"rotate(180deg)"},src:g.a,className:"ml5"})),l.a.createElement("div",null,l.a.createElement("img",{src:d.a}),l.a.createElement("span",{className:"ml10 mr20"},"总分",c.scoreTotal,"分"),l.a.createElement("img",{className:"mr10",src:f.a}),l.a.createElement("span",null,"COMBINATION"===(null==c?void 0:c.item_type)?"每小题":"每题"),l.a.createElement("div",{id:"".concat(null==c?void 0:c.item_type,"_score")},l.a.createElement(i.a,{disabled:v,parser:w,min:0,onChange:function(e){var t=Object(b.cloneDeep)(c);t.score=e;var n=T(t);t.scoreTotal=n,h(t)},value:c.score,style:{margin:"0 5px"}}),l.a.createElement("span",{style:{display:"none"}},"请输入每题分数")),l.a.createElement("span",null,"分")))),l.a.createElement("div",{className:u.a.body,style:{display:O?"block":"none"}},null==c||null===(n=c.item_banks)||void 0===n?void 0:n.map((function(e,t){var n;return l.a.createElement(l.a.Fragment,{key:t},l.a.createElement("div",{className:u.a.top},l.a.createElement("img",{src:y.a}),l.a.createElement("span",null,"课程/章节"),l.a.createElement("b",null),l.a.createElement("aside",null,null==e?void 0:e.disciplines,"/",null==e?void 0:e.sub_discipline)),l.a.createElement("div",{className:u.a.bottom},l.a.createElement("div",{className:u.a.l},"知识点"),l.a.createElement("div",{className:u.a.r},null==e||null===(n=e.tag_disciplines)||void 0===n?void 0:n.map((function(e,n){return l.a.createElement(k,{expansion:S,disabled:v,type:null==c?void 0:c.item_type,key:"".concat(t,"-").concat(n),value:e,index:n,onChange:function(e){return L(e,t,n)}})})))))}))))}},exQ7: /*!****************************************!*\ !*** ./src/assets/images/paper/te.svg ***! \****************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/te.6f9c0684.svg"},f4xo: /*!********************************************!*\ !*** ./node_modules/qr.js/lib/8BitByte.js ***! \********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){var i=n(/*! ./mode */"nVVt");function r(e){this.mode=i.MODE_8BIT_BYTE,this.data=e}r.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.length,i=t.length;if(1!==Math.abs(n-i))return{add:!1,key:null};function r(e,t){var n=new Map;e.forEach((function(e){n.set(e,!0)}));var i=t.filter((function(e){return!n.has(e)}));return 1===i.length?i[0]:null}return n ").concat(t);return t}(L)),u.createElement("div",{role:"tree"},u.createElement("input",{style:_,disabled:!1===T||d,tabIndex:!1!==T?P:null,onKeyDown:I,onFocus:R,onBlur:B,value:"",onChange:O})),u.createElement(x.a,Object.assign({},W,{data:he,itemKey:j,height:C,fullHeight:!1,virtual:k,itemHeight:w,prefixCls:"".concat(n,"-list"),ref:V}),(function(e){var t=e.pos,n=e.data,i=n.key,r=Object(b.a)(n,["key"]),o=e.isStart,a=e.isEnd,s=Object(v.e)(i,t);delete r.children;var l=Object(v.f)(s,de);return u.createElement(S,Object.assign({},r,l,{active:L&&i===L.data.key,pos:t,data:e.data,isStart:o,isEnd:a,motion:g,motionNodes:i===N?re:null,motionType:le,onMotionStart:F,onMotionEnd:ue,treeNodeRequiredProps:de,onMouseMove:function(){z(null)}}))})))}));D.displayName="NodeList";var P=D,I=n("NvD2"),R=function(e){Object(l.a)(n,e);var t=Object(c.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.apply(this,arguments)).destroyed=!1,e.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},e.listRef=u.createRef(),e.onNodeDragStart=function(t,n){var i=e.state,r=i.expandedKeys,o=i.keyEntities,a=e.props.onDragStart,s=n.props.eventKey;e.dragNode=n;var l=Object(g.b)(r,s);e.setState({dragging:!0,dragNodesKeys:Object(g.g)(s,o)}),e.setExpandedKeys(l),a&&a({event:t,node:Object(v.b)(n.props)})},e.onNodeDragEnter=function(t,n){var i=e.state,r=i.expandedKeys,a=i.keyEntities,s=i.dragNodesKeys,l=e.props.onDragEnter,c=n.props,u=c.pos,h=c.eventKey;if(e.dragNode&&-1===s.indexOf(h)){var d=Object(g.c)(t,n);e.dragNode.props.eventKey!==h||0!==d?setTimeout((function(){e.setState({dragOverNodeKey:h,dropPosition:d}),e.delayedDragEnterLogic||(e.delayedDragEnterLogic={}),Object.keys(e.delayedDragEnterLogic).forEach((function(t){clearTimeout(e.delayedDragEnterLogic[t])})),e.delayedDragEnterLogic[u]=window.setTimeout((function(){if(e.state.dragging){var i=Object(o.a)(r),s=a[h];s&&(s.children||[]).length&&(i=Object(g.a)(r,h)),"expandedKeys"in e.props||e.setExpandedKeys(i),l&&l({event:t,node:Object(v.b)(n.props),expandedKeys:i})}}),400)}),0):e.setState({dragOverNodeKey:"",dropPosition:null})}},e.onNodeDragOver=function(t,n){var i=e.state.dragNodesKeys,r=e.props.onDragOver,o=n.props.eventKey;if(-1===i.indexOf(o)){if(e.dragNode&&o===e.state.dragOverNodeKey){var a=Object(g.c)(t,n);if(a===e.state.dropPosition)return;e.setState({dropPosition:a})}r&&r({event:t,node:Object(v.b)(n.props)})}},e.onNodeDragLeave=function(t,n){var i=e.props.onDragLeave;e.setState({dragOverNodeKey:""}),i&&i({event:t,node:Object(v.b)(n.props)})},e.onNodeDragEnd=function(t,n){var i=e.props.onDragEnd;e.setState({dragOverNodeKey:""}),e.cleanDragState(),i&&i({event:t,node:Object(v.b)(n.props)}),e.dragNode=null},e.onNodeDrop=function(t,n){var i=e.state,r=i.dragNodesKeys,o=void 0===r?[]:r,a=i.dropPosition,s=e.props.onDrop,l=n.props,c=l.eventKey,u=l.pos;if(e.setState({dragOverNodeKey:""}),e.cleanDragState(),-1===o.indexOf(c)){var h=Object(g.k)(u),p={event:t,node:Object(v.b)(n.props),dragNode:e.dragNode?Object(v.b)(e.dragNode.props):null,dragNodesKeys:o.slice(),dropPosition:a+Number(h[h.length-1]),dropToGap:!1};0!==a&&(p.dropToGap=!0),s&&s(p),e.dragNode=null}else Object(d.a)(!1,"Can not drop to dragNode(include it's children node)")},e.cleanDragState=function(){e.state.dragging&&e.setState({dragging:!1})},e.onNodeClick=function(t,n){var i=e.props.onClick;i&&i(t,n)},e.onNodeDoubleClick=function(t,n){var i=e.props.onDoubleClick;i&&i(t,n)},e.onNodeSelect=function(t,n){var i=e.state.selectedKeys,r=e.state.keyEntities,o=e.props,a=o.onSelect,s=o.multiple,l=n.selected,c=n.key,u=!l,h=(i=u?s?Object(g.a)(i,c):[c]:Object(g.b)(i,c)).map((function(e){var t=r[e];return t?t.node:null})).filter((function(e){return e}));e.setUncontrolledState({selectedKeys:i}),a&&a(i,{event:"select",selected:u,node:n,selectedNodes:h,nativeEvent:t.nativeEvent})},e.onNodeCheck=function(t,n,i){var r,a=e.state,s=a.keyEntities,l=a.checkedKeys,c=a.halfCheckedKeys,u=e.props,h=u.checkStrictly,d=u.onCheck,p=n.key,f={event:"check",node:n,checked:i,nativeEvent:t.nativeEvent};if(h){var m=i?Object(g.a)(l,p):Object(g.b)(l,p);r={checked:m,halfChecked:Object(g.b)(c,p)},f.checkedNodes=m.map((function(e){return s[e]})).filter((function(e){return e})).map((function(e){return e.node})),e.setUncontrolledState({checkedKeys:m})}else{var v=Object(I.a)([].concat(Object(o.a)(l),[p]),!0,s),y=v.checkedKeys,b=v.halfCheckedKeys;if(!i){var x=new Set(y);x.delete(p);var C=Object(I.a)(Array.from(x),{checked:!1,halfCheckedKeys:b},s);y=C.checkedKeys,b=C.halfCheckedKeys}r=y,f.checkedNodes=[],f.checkedNodesPositions=[],f.halfCheckedKeys=b,y.forEach((function(e){var t=s[e];if(t){var n=t.node,i=t.pos;f.checkedNodes.push(n),f.checkedNodesPositions.push({node:n,pos:i})}})),e.setUncontrolledState({checkedKeys:y},!1,{halfCheckedKeys:b})}d&&d(r,f)},e.onNodeLoad=function(t){return new Promise((function(n){e.setState((function(i){var r=i.loadedKeys,o=void 0===r?[]:r,a=i.loadingKeys,s=void 0===a?[]:a,l=e.props,c=l.loadData,u=l.onLoad,h=t.key;return c&&-1===o.indexOf(h)&&-1===s.indexOf(h)?(c(t).then((function(){var i=e.state,r=i.loadedKeys,o=i.loadingKeys,a=Object(g.a)(r,h),s=Object(g.b)(o,h);u&&u(a,{event:"load",node:t}),e.setUncontrolledState({loadedKeys:a}),e.setState({loadingKeys:s}),n()})),{loadingKeys:Object(g.a)(s,h)}):{}}))}))},e.onNodeMouseEnter=function(t,n){var i=e.props.onMouseEnter;i&&i({event:t,node:n})},e.onNodeMouseLeave=function(t,n){var i=e.props.onMouseLeave;i&&i({event:t,node:n})},e.onNodeContextMenu=function(t,n){var i=e.props.onRightClick;i&&(t.preventDefault(),i({event:t,node:n}))},e.onFocus=function(){var t=e.props.onFocus;e.setState({focused:!0}),t&&t.apply(void 0,arguments)},e.onBlur=function(){var t=e.props.onBlur;e.setState({focused:!1}),e.onActiveChange(null),t&&t.apply(void 0,arguments)},e.getTreeNodeRequiredProps=function(){var t=e.state;return{expandedKeys:t.expandedKeys||[],selectedKeys:t.selectedKeys||[],loadedKeys:t.loadedKeys||[],loadingKeys:t.loadingKeys||[],checkedKeys:t.checkedKeys||[],halfCheckedKeys:t.halfCheckedKeys||[],dragOverNodeKey:t.dragOverNodeKey,dropPosition:t.dropPosition,keyEntities:t.keyEntities}},e.setExpandedKeys=function(t){var n=e.state.treeData,i=Object(v.d)(n,t);e.setUncontrolledState({expandedKeys:t,flattenNodes:i},!0)},e.onNodeExpand=function(t,n){var i=e.state.expandedKeys,r=e.state.listChanging,o=e.props,a=o.onExpand,s=o.loadData,l=n.key,c=n.expanded;if(!r){var u=i.indexOf(l),h=!c;if(Object(d.a)(c&&-1!==u||!c&&-1===u,"Expand state not sync with index check"),i=h?Object(g.a)(i,l):Object(g.b)(i,l),e.setExpandedKeys(i),a&&a(i,{node:n,expanded:h,nativeEvent:t.nativeEvent}),h&&s){var p=e.onNodeLoad(n);p&&p.then((function(){var t=Object(v.d)(e.state.treeData,i);e.setUncontrolledState({flattenNodes:t})}))}}},e.onListChangeStart=function(){e.setUncontrolledState({listChanging:!0})},e.onListChangeEnd=function(){setTimeout((function(){e.setUncontrolledState({listChanging:!1})}))},e.onActiveChange=function(t){var n=e.state.activeKey,i=e.props.onActiveChange;n!==t&&(e.setState({activeKey:t}),null!==t&&e.scrollTo({key:t}),i&&i(t))},e.getActiveItem=function(){var t=e.state,n=t.activeKey,i=t.flattenNodes;return null===n?null:i.find((function(e){return e.data.key===n}))||null},e.offsetActiveKey=function(t){var n=e.state,i=n.flattenNodes,r=n.activeKey,o=i.findIndex((function(e){return e.data.key===r}));-1===o&&t<0&&(o=i.length);var a=i[o=(o+t+i.length)%i.length];if(a){var s=a.data.key;e.onActiveChange(s)}else e.onActiveChange(null)},e.onKeyDown=function(t){var n=e.state,i=n.activeKey,o=n.expandedKeys,a=n.checkedKeys,s=e.props,l=s.onKeyDown,c=s.checkable,u=s.selectable;switch(t.which){case h.a.UP:e.offsetActiveKey(-1),t.preventDefault();break;case h.a.DOWN:e.offsetActiveKey(1),t.preventDefault()}var d=e.getActiveItem();if(d&&d.data){var p=e.getTreeNodeRequiredProps(),f=!1===d.data.isLeaf||!!(d.data.children||[]).length,m=Object(v.b)(Object(r.a)(Object(r.a)({},Object(v.f)(i,p)),{},{data:d.data,active:!0}));switch(t.which){case h.a.LEFT:f&&o.includes(i)?e.onNodeExpand({},m):d.parent&&e.onActiveChange(d.parent.data.key),t.preventDefault();break;case h.a.RIGHT:f&&!o.includes(i)?e.onNodeExpand({},m):d.children&&d.children.length&&e.onActiveChange(d.children[0].data.key),t.preventDefault();break;case h.a.ENTER:case h.a.SPACE:!c||m.disabled||!1===m.checkable||m.disableCheckbox?c||!u||m.disabled||!1===m.selectable||e.onNodeSelect({},m):e.onNodeCheck({},m,!a.includes(i))}}l&&l(t)},e.setUncontrolledState=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var o=!1,a=!0,s={};Object.keys(t).forEach((function(n){n in e.props?a=!1:(o=!0,s[n]=t[n])})),!o||n&&!a||e.setState(Object(r.a)(Object(r.a)({},s),i))}},e.scrollTo=function(t){e.listRef.current.scrollTo(t)},e}return Object(s.a)(n,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var e,t=this.state,n=t.focused,r=t.flattenNodes,o=t.keyEntities,a=t.dragging,s=t.activeKey,l=this.props,c=l.prefixCls,h=l.className,d=l.style,p=l.showLine,v=l.focusable,y=l.tabIndex,b=void 0===y?0:y,x=l.selectable,C=l.showIcon,w=l.icon,k=l.switcherIcon,S=l.draggable,E=l.checkable,_=l.checkStrictly,O=l.disabled,N=l.motion,T=l.loadData,L=l.filterTreeNode,A=l.height,M=l.itemHeight,j=l.virtual,D=l.titleRender,I=l.onContextMenu,R=Object(g.f)(this.props);return u.createElement(m.a.Provider,{value:{prefixCls:c,selectable:x,showIcon:C,icon:w,switcherIcon:k,draggable:S,checkable:E,checkStrictly:_,disabled:O,keyEntities:o,loadData:T,filterTreeNode:L,titleRender:D,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},u.createElement("div",{className:f()(c,h,(e={},Object(i.a)(e,"".concat(c,"-show-line"),p),Object(i.a)(e,"".concat(c,"-focused"),n),Object(i.a)(e,"".concat(c,"-active-focused"),null!==s),e))},u.createElement(P,Object.assign({ref:this.listRef,prefixCls:c,style:d,data:r,disabled:O,selectable:x,checkable:!!E,motion:N,dragging:a,height:A,itemHeight:M,virtual:j,focusable:v,focused:n,tabIndex:b,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:I},this.getTreeNodeRequiredProps(),R))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n,o=t.prevProps,a={prevProps:e};function s(t){return!o&&t in e||o&&o[t]!==e[t]}if(s("treeData")?n=e.treeData:s("children")&&(Object(d.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=Object(v.c)(e.children)),n){a.treeData=n;var l=Object(v.a)(n);a.keyEntities=Object(r.a)(Object(i.a)({},N,L),l.keyEntities)}var c,u=a.keyEntities||t.keyEntities;if(s("expandedKeys")||o&&s("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!o&&e.defaultExpandParent?Object(g.e)(e.expandedKeys,u):e.expandedKeys;else if(!o&&e.defaultExpandAll){var h=Object(r.a)({},u);delete h[N],a.expandedKeys=Object.keys(h).map((function(e){return h[e].key}))}else!o&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?Object(g.e)(e.defaultExpandedKeys,u):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,n||a.expandedKeys){var p=Object(v.d)(n||t.treeData,a.expandedKeys||t.expandedKeys);a.flattenNodes=p}if((e.selectable&&(s("selectedKeys")?a.selectedKeys=Object(g.d)(e.selectedKeys,e):!o&&e.defaultSelectedKeys&&(a.selectedKeys=Object(g.d)(e.defaultSelectedKeys,e))),e.checkable)&&(s("checkedKeys")?c=Object(g.j)(e.checkedKeys)||{}:!o&&e.defaultCheckedKeys?c=Object(g.j)(e.defaultCheckedKeys)||{}:n&&(c=Object(g.j)(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),c)){var f=c,m=f.checkedKeys,y=void 0===m?[]:m,b=f.halfCheckedKeys,x=void 0===b?[]:b;if(!e.checkStrictly){var C=Object(I.a)(y,!0,u);y=C.checkedKeys,x=C.halfCheckedKeys}a.checkedKeys=y,a.halfCheckedKeys=x}return s("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),n}(u.Component);R.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},R.TreeNode=w.a;var B=R;t.b=B},k4n4: /*!***************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/AddTags/index.tsx ***! \***************************************************************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),r=n(/*! react */"q1tI"),o=n.n(r),a=n(/*! ./index.less?modules */"e+RI"),s=n.n(a),l=n(/*! @/assets/images/icons/tagDelete.png */"FTkQ"),c=n.n(l),u=n(/*! @/assets/images/paper/swenjianjia.svg */"E/GV"),h=n.n(u);t.a=function(e){var t=e.type,n=void 0===t?1:t,a=e.value,l=void 0===a?[]:a,u=e.onChange,d=e.disabled,p=void 0!==d&&d,f=e.icon,m=Object(r.useState)(),g=Object(i.a)(m,2),v=(g[0],g[1],function(e){u(e)});return 1===n?o.a.createElement("div",null,null==l?void 0:l.map((function(e,t){return o.a.createElement("div",{key:t,className:p?"".concat(s.a.btn," ").concat(s.a.btnDisabled):s.a.btn},o.a.createElement("span",{className:s.a.s1},e.name),o.a.createElement("img",{src:c.a,className:s.a.s2,onClick:function(){return v(e.id)}}))}))):o.a.createElement("div",null,null==l?void 0:l.map((function(e,t){return o.a.createElement("div",{key:t,className:s.a.btn2},o.a.createElement("span",{className:s.a.s1},o.a.createElement("img",{src:f||h.a}),e.name),o.a.createElement("img",{src:c.a,className:s.a.s2,onClick:function(){return v(e.id)}}))})))}},kSUc: /*!***************************************************!*\ !*** ./src/components/markdown-editor/index.less ***! \***************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},kqOp: /*!***********************************************!*\ !*** ./src/components/Editor/NullMDEditor.js ***! \***********************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),r=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),s=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),l=n(/*! react */"q1tI"),c=n.n(l),u=n(/*! ../markdown-editor */"Ot1p"),h=function(e){Object(a.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(r.a)(this,n);for(var i=arguments.length,o=new Array(i),a=0;a` "'(~:]+/,p=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,m=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;function g(e,t,n){return t.f=t.inline=n,n(e,t)}function v(e,t,n){return t.f=t.block=n,n(e,t)}function y(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==x){var n=r;if(!n){var o=e.innerMode(i,t.htmlState);n="xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText}n&&(t.f=S,t.block=b,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function b(i,r){var a,d=i.column()===r.indentation,m=!(a=r.prevLine.stream)||!/\S/.test(a.string),v=r.indentedCode,y=r.prevLine.hr,b=!1!==r.list,x=(r.listStack[r.listStack.length-1]||0)+3;r.indentedCode=!1;var k=r.indentation;if(null===r.indentationDiff&&(r.indentationDiff=r.indentation,b)){for(r.list=null;k=4&&(v||r.prevLine.fencedCodeEnd||r.prevLine.header||m))return i.skipToEnd(),r.indentedCode=!0,o.code;if(i.eatSpace())return null;if(d&&r.indentation<=x&&(_=i.match(u))&&_[1].length<=6)return r.quote=0,r.header=_[1].length,r.thisLine.header=!0,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,w(r);if(r.indentation<=x&&i.eat(">"))return r.quote=d?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),i.eatSpace(),w(r);if(!E&&!r.setext&&d&&r.indentation<=x&&(_=i.match(l))){var O=_[1]?"ol":"ul";return r.indentation=k+i.current().length,r.list=!0,r.quote=0,r.listStack.push(r.indentation),r.em=!1,r.strong=!1,r.code=!1,r.strikethrough=!1,n.taskLists&&i.match(c,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+O]),w(r)}return d&&r.indentation<=x&&(_=i.match(p,!0))?(r.quote=0,r.fencedEndRE=new RegExp(_[1]+"+ *$"),r.localMode=n.fencedCodeBlockHighlighting&&function(n){if(e.findModeByName){var i=e.findModeByName(n);i&&(n=i.mime||i.mimes[0])}var r=e.getMode(t,n);return"null"==r.name?null:r}(_[2]||n.fencedCodeBlockDefaultMode),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=C,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,w(r)):r.setext||!(S&&b||r.quote||!1!==r.list||r.code||E||f.test(i.string))&&(_=i.lookAhead(1))&&(_=_.match(h))?(r.setext?(r.header=r.setext,r.setext=0,i.skipToEnd(),n.highlightFormatting&&(r.formatting="header")):(r.header="="==_[0].charAt(0)?1:2,r.setext=r.header),r.thisLine.header=!0,r.f=r.inline,w(r)):E?(i.skipToEnd(),r.hr=!0,r.thisLine.hr=!0,o.hr):"["===i.peek()?g(i,r,N):g(i,r,r.inline)}function x(t,n){var o=i.token(t,n.htmlState);if(!r){var a=e.innerMode(i,n.htmlState);("xml"==a.mode.name&&null===a.state.tagStart&&!a.state.context&&a.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)&&(n.f=S,n.block=b,n.htmlState=null)}return o}function C(e,t){var i,r=t.listStack[t.listStack.length-1]||0,a=t.indentation=e.quote?t.push(o.formatting+"-"+e.formatting[i]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(o.linkHref,"url"):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.emoji&&t.push(o.emoji),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,"link"),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+"-"+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+"-"+e.quote):t.push(o.quote+"-"+n.maxBlockquoteDepth)),!1!==e.list){var r=(e.listStack.length-1)%3;r?1===r?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function k(e,t){if(e.match(d,!0))return w(t)}function S(t,r){var a=r.text(t,r);if(void 0!==a)return a;if(r.list)return r.list=null,w(r);if(r.taskList)return" "===t.match(c,!0)[1]?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,w(r);if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),w(r);var s=t.next();if(r.linkTitle){r.linkTitle=!1;var l=s;"("===s&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(u),!0))return o.linkHref}if("`"===s){var h=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=r.code||r.quote&&1!=d){if(d==r.code){var p=w(r);return r.code=0,p}return r.formatting=h,w(r)}return r.code=d,w(r)}if(r.code)return w(r);if("\\"===s&&(t.next(),n.highlightFormatting)){var f=w(r),g=o.formatting+"-escape";return f?f+" "+g:g}if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),w(r);if("["===s&&r.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),w(r);if("]"===s&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var f=w(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=_,f}if("["===s&&!r.image)return r.linkText&&t.match(/^.*?\]/)||(r.linkText=!0,n.highlightFormatting&&(r.formatting="link")),w(r);if("]"===s&&r.linkText){n.highlightFormatting&&(r.formatting="link");var f=w(r);return r.linkText=!1,r.inline=r.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?_:S,f}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=E,n.highlightFormatting&&(r.formatting="link"),(f=w(r))?f+=" ":f="",f+o.linkInline;if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return r.f=r.inline=E,n.highlightFormatting&&(r.formatting="link"),(f=w(r))?f+=" ":f="",f+o.linkEmail;if(n.xml&&"<"===s&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=t.string.indexOf(">",t.pos);if(-1!=y){var b=t.string.substring(t.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(b)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(i),v(t,r,x)}if(n.xml&&"<"===s&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";if("*"===s||"_"===s){for(var C=1,k=1==t.pos?" ":t.string.charAt(t.pos-2);C<3&&t.eat(s);)C++;var O=t.peek()||" ",N=!/\s/.test(O)&&(!m.test(O)||/\s/.test(k)||m.test(k)),T=!/\s/.test(k)&&(!m.test(k)||/\s/.test(O)||m.test(O)),L=null,A=null;if(C%2&&(r.em||!N||"*"!==s&&T&&!m.test(k)?r.em!=s||!T||"*"!==s&&N&&!m.test(O)||(L=!1):L=!0),C>1&&(r.strong||!N||"*"!==s&&T&&!m.test(k)?r.strong!=s||!T||"*"!==s&&N&&!m.test(O)||(A=!1):A=!0),null!=A||null!=L)return n.highlightFormatting&&(r.formatting=null==L?"strong":null==A?"em":"strong em"),!0===L&&(r.em=s),!0===A&&(r.strong=s),p=w(r),!1===L&&(r.em=!1),!1===A&&(r.strong=!1),p}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return w(r);t.backUp(1)}if(n.strikethrough)if("~"===s&&t.eatWhile(s)){if(r.strikethrough)return n.highlightFormatting&&(r.formatting="strikethrough"),p=w(r),r.strikethrough=!1,p;if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),w(r)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return w(r);t.backUp(2)}if(n.emoji&&":"===s&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){r.emoji=!0,n.highlightFormatting&&(r.formatting="emoji");var M=w(r);return r.emoji=!1,M}return" "===s&&(t.match(/^ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),w(r)}function E(e,t){if(">"===e.next()){t.f=t.inline=S,n.highlightFormatting&&(t.formatting="link");var i=w(t);return i?i+=" ":i="",i+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function _(e,t){if(e.eatSpace())return null;var i,r=e.next();return"("===r||"["===r?(t.f=t.inline=(i="("===r?")":"]",function(e,t){if(e.next()===i){t.f=t.inline=S,n.highlightFormatting&&(t.formatting="link-string");var r=w(t);return t.linkHref=!1,r}return e.match(O[i]),t.linkHref=!0,w(t)}),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,w(t)):"error"}var O={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function N(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=T,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,w(t)):g(e,t,S)}function T(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=L,n.highlightFormatting&&(t.formatting="link");var i=w(t);return t.linkText=!1,i}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function L(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=S,o.linkHref+" url")}var A={startState:function(){return{f:b,prevLine:{stream:null},thisLine:{stream:null},block:b,htmlState:null,indentation:0,inline:S,text:k,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(i,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=x)){var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=n,t.indentationDiff=null,n>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==x?{state:e.htmlState,mode:i}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:A}},indent:function(t,n,r){return t.block==x&&i.indent?i.indent(t.htmlState,n,r):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,n,r):e.Pass},blankLine:y,getType:w,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return A}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(n(/*! ../../lib/codemirror */"VrN/"),n(/*! ../xml/xml */"1eCo"),n(/*! ../meta */"8EBN"))},lnNo: /*!****************************************!*\ !*** ./src/assets/images/paper/up.svg ***! \****************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports=n.p+"static/up.69f3b3fd.svg"},m3fD: /*!*********************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/index.less?modules ***! \*********************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___1w3aZ",flex_space_between:"flex_space_between___26eB1",flex_box_vertical_center:"flex_box_vertical_center___LffUi",flex_box_center_end:"flex_box_center_end___2AiD3",flex_box_column:"flex_box_column___hZDm1",wrap:"wrap___3Du1e",btns:"btns___35pkF",crumbs:"crumbs___3CPsi",oneWrap:"oneWrap___3F99r",title:"title___2n1na",formWrap:"formWrap___3CHwR",rb:"rb___19sZ1"}},nVVt: /*!****************************************!*\ !*** ./node_modules/qr.js/lib/mode.js ***! \****************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8}},osHv: /*!********************************************************!*\ !*** ./node_modules/codemirror/addon/fold/xml-fold.js ***! \********************************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){!function(e){"use strict";var t=e.Pos;function n(e,t){return e.line-t.line||e.ch-t.ch}var i="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r=new RegExp("<(/?)(["+i+"]["+i+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function o(e,t,n,i){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function a(e,n){var i=e.cm.getTokenTypeAt(t(e.line,n));return i&&/\btag\b/.test(i)}function s(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(s(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function h(e){for(;;){r.lastIndex=e.ch;var t=r.exec(e.text);if(!t){if(s(e))continue;return}if(a(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(a(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}function p(e,n){for(var i=[];;){var r,o=h(e),a=e.line,s=e.ch-(o?o[0].length:0);if(!o||!(r=c(e)))return;if("selfClose"!=r)if(o[1]){for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!n||n==o[2]))return{tag:o[2],from:t(a,s),to:t(e.line,e.ch)}}else i.push(o[2])}}function f(e,n){for(var i=[];;){var r=d(e);if(!r)return;if("selfClose"!=r){var o=e.line,a=e.ch,s=u(e);if(!s)return;if(s[1])i.push(s[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==s[2]){i.length=l;break}if(l<0&&(!n||n==s[2]))return{tag:s[2],from:t(e.line,e.ch),to:t(o,a)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,i){for(var r=new o(e,i.line,0);;){var a=h(r);if(!a||r.line!=i.line)return;var s=c(r);if(!s)return;if(!a[1]&&"selfClose"!=s){var l=t(r.line,r.ch),u=p(r,a[2]);return u&&n(u.from,l)>0?{from:l,to:u.from}:null}}})),e.findMatchingTag=function(e,i,r){var a=new o(e,i.line,i.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var s=c(a),l=s&&t(a.line,a.ch),h=s&&u(a);if(s&&h&&!(n(a,i)>0)){var d={from:t(a.line,a.ch),to:l,tag:h[2]};return"selfClose"==s?{open:d,close:null,at:"open"}:h[1]?{open:f(a,h[2]),close:d,at:"close"}:{open:d,close:p(a=new o(e,l.line,l.ch,r),h[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n,i){for(var r=new o(e,t.line,t.ch,n);;){var a=f(r,i);if(!a)break;var s=p(new o(e,t.line,t.ch,n),a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,n,i){return p(new o(e,t.line,t.ch,i?{from:0,to:i}:null),n)}}(n(/*! ../../lib/codemirror */"VrN/"))},p5ED: /*!*********************************************!*\ !*** ./src/components/PreviewAll/index.tsx ***! \*********************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";n(/*! antd/es/button/style */"+L6B");var i=n(/*! antd/es/button */"2/Rp"),r=(n(/*! antd/es/tooltip/style */"5Dmo"),n(/*! antd/es/tooltip */"3S7+")),o=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),a=n(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=n(/*! react */"q1tI"),l=n.n(s),c=n(/*! ./index.less?modules */"vHTk"),u=n.n(c),h=n(/*! @ant-design/icons */"yEEn"),d=n(/*! @/components/monaco-editor */"ZW9T"),p=n(/*! @/utils/util */"1vsH");t.a=function(e){var t=e.name,n=e.data,c=(e.theme,e.type),f=e.filename,m=e.monacoEditor,g=e.className,v=e.style,y=e.close,b=e.onClose,x=e.hasMask,C=Object(s.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),w=Object(a.a)(C,2),k=(w[0],w[1],Object(s.useState)("")),S=Object(a.a)(k,2),E=(S[0],S[1]),_=Object(s.useRef)();f&&(m.filename=f),Object(s.useEffect)((function(){var e,t,n=null===(e=document.cookie)||void 0===e||null===(t=e.replace(/\s/g,""))||void 0===t?void 0:t.split(";");null==n||n.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&E(t[1])}))}),[]);var O=function(){n.startsWith("http")||n.startsWith("/")?N():Object(p.x)(f||"educoder",n,f)},N=function(){Object(p.v)(f||t,n)};return console.log("data:",n,"fileanme:",f," name:",t),l.a.createElement("div",{style:Object(o.a)({},v||{}),className:"".concat(x&&u.a.bgBlack," ").concat(c?u.a.wrp:"hide")},y&&l.a.createElement("div",{className:u.a.close,ref:_},l.a.createElement(r.a,{title:"点击下载此文件",getPopupContainer:function(){return _.current}},l.a.createElement("span",{onClick:N},l.a.createElement("i",{className:"icon-quxiaozhiding"}))),l.a.createElement(r.a,{title:"关闭",getPopupContainer:function(){return _.current}},l.a.createElement("span",{className:"",onClick:b},l.a.createElement("i",{className:"icon-guanbi1"})))),l.a.createElement("div",{className:"".concat(u.a[g]," ").concat(g," ").concat(u.a.monaco," ").concat("txt"===c?"show":"hide")},"txt"===c&&l.a.createElement(d.b,m)),"audio"===c&&l.a.createElement("audio",{src:"".concat(null!=n&&n.startsWith("/")||(null==n?void 0:n.indexOf("https://"))>-1?n:"data:audio/mp3;base64,").concat(n),autoPlay:!0}),"video"===c&&l.a.createElement(l.a.Fragment,null,null!=n&&n.startsWith("/")?l.a.createElement("video",{controls:!0,src:"".concat(n),autoPlay:!0}):l.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(n),autoPlay:!0})),"html"===c&&l.a.createElement("iframe",{src:n+"&disposition=inline"}),"pdf"===c&&l.a.createElement("embed",{className:u.a.embed,src:n}),"pdfeditor"===c&&l.a.createElement("div",null,l.a.createElement("iframe",{src:"https://a1office.co/solutions/editor/pdf-editor/查重文档1-8839d79b81e8bda0d298ca058913ab88.pdf"}),l.a.createElement("div",{style:{position:"absolute",left:"1px",top:"1px",width:180,height:60,background:"#f9f9f9"}})),"image"===c&&l.a.createElement(l.a.Fragment,null,l.a.createElement("img",{src:"".concat(null!=n&&n.startsWith("/")||(null==n?void 0:n.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(n)})),"other"===c&&l.a.createElement("div",null,l.a.createElement(i.a,{type:"primary",size:"large",onClick:O},l.a.createElement(h.a,null),"点击下载")),("download"===c||"office"===c)&&l.a.createElement(i.a,{type:"primary",size:"large",onClick:O},l.a.createElement(h.a,null),"点击下载"))}},"p77/": /*!****************************************************!*\ !*** ./node_modules/codemirror/lib/codemirror.css ***! \****************************************************/ /*! no static exports found */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){},"rAM+": /*!*******************************************************************************************************************!*\ !*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***! \*******************************************************************************************************************/ /*! exports provided: default */ /*! exports used: default */function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function r(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=Object(i.a)(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},rUJ1: /*!********************************************!*\ !*** ./node_modules/marked/src/helpers.js ***! \********************************************/ /*! no static exports found */ /*! exports used: escape */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){const n=/[&<>"']/,i=/[&<>"']/g,r=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,a={"&":"&","<":"<",">":">",'"':""","'":"'"},s=e=>a[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(l,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const u=/(^|[^\[])\^/g;const h=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const p={},f=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,g=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(e,t){p[" "+e]||(f.test(e)?p[" "+e]=e+"/":p[" "+e]=y(e,"/",!0));const n=-1===(e=p[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(g,"$1")+t:e+t}function y(e,t,n){const i=e.length;if(0===i)return"";let r=0;for(;r(i=(i=i.source||i).replace(u,"$1"),e=e.replace(t,i),n),getRegex:()=>new RegExp(e,t)};return n},cleanUrl:function(e,t,n){if(e){let e;try{e=decodeURIComponent(c(n)).replace(h,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!d.test(n)&&(n=v(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n},resolveUrl:v,noopTest:{exec:function(){}},merge:function(e){let t,n,i=1;for(;i{let i=!1,r=t;for(;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"}).split(/ \|/);let i=0;if(n.length>t)n.splice(t);else for(;n.length20?(u.b.warn("填空题标准答案不能为空/不能超过20个!"),!1):{name:a,analysis:h,standard_answers:e,is_ordered:O})):(u.b.info("请您输入题干"),!1)},H=function(){s(""),d(""),x([]),N(!1)},V=function(e,t,n){S("");var i=b.slice();i[e][t]=n,x(i)},G=function(e){var t=b.slice();t[e]=[].concat(Object(P.a)(t[e]),[""]),x(t)},K=function(e,t){var n=b.slice();if(!n[e][t])return n[e]=n[e].filter((function(e,n){return n!==t})),void x(n);p.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:W.a.modal,onOk:function(){n[e]=n[e].filter((function(e,n){return n!==t})),x(n)}})},U=function(e){p.a.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"确认要删除这个参考答案吗?",className:W.a.modal,onOk:function(){var t=b.slice();t=b.filter((function(t,n){return e!==n})),x(t)}})};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement("div",null,y.a.createElement(B.a,{id:"completion-question-tittle",placeholder:"请您输入题目",height:155,defaultValue:a,onChange:function(e){return s(e)},showNullButton:!0,onPlaceholderChange:function(e,t,n){var i=b.slice();if(t&&i.splice(e,t),n)for(var r=0;r1&&y.a.createElement("span",null,y.a.createElement(D.a,{checked:O,onChange:function(e){return N(e.target.checked)},className:"".concat(W.a.color333," font14")},"多个填空的答案有顺序要求"),y.a.createElement("span",{className:"".concat(W.a.color999," font12")},"(选中,每个填空的答案顺序必须与参考答案一致)"))),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:h,onChange:function(e){return d(e)}}))},G=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(V)),K=function(e,t){e.globalSetting,e.loading;var n=e.editData,i=(e.dispatch,e.onRef,e.isEdit),r=(Object(I.a)(e,["globalSetting","loading","editData","dispatch","onRef","isEdit"]),Object(v.useState)()),o=Object(f.a)(r,2),a=o[0],s=o[1],c=Object(v.useState)(""),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)(""),g=Object(f.a)(m,2),b=g[0],x=g[1];Object(v.useEffect)((function(){if(n&&i){p(null==n?void 0:n.name),x(null==n?void 0:n.analysis);var e=null==n?void 0:n.choices.find((function(e){return e.is_answer}));s("正确"===e.choice_text?"0":"1")}}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:C,Clear:w}}));var C=function(){return d?a?{name:d,choices:[{choice_text:"正确",is_answer:"0"===a?1:0},{choice_text:"错误",is_answer:"1"===a?1:0}],analysis:b}:(u.b.info("请先点击选择本选择题的正确选项"),!1):(u.b.info("请您输入题干"),!1)},w=function(){p(""),x(""),s("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:d,onChange:function(e){return p(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),y.a.createElement(l.a.Group,{buttonStyle:"solid",value:a,onChange:function(e){return s(e.target.value)}},y.a.createElement(l.a.Button,{value:"0",className:"".concat(W.a.radio," mr40")},"正确"),y.a.createElement(l.a.Button,{value:"1",className:W.a.radio},"错误")),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:b,onChange:function(e){return x(e)}}))},U=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(K)),q=["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"],$=function(e,t){var n=e.editData,i=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),o=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)([])),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)(),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)([]),g=Object(f.a)(m,2),b=g[0],x=g[1],C=Object(v.useState)(""),w=Object(f.a)(C,2),S=w[0],E=w[1],_=Object(v.useState)(""),O=Object(f.a)(_,2),N=O[0],T=O[1];Object(v.useEffect)((function(){l(["","","",""])}),[]),Object(v.useEffect)((function(){if(n&&i){E(null==n?void 0:n.name),T(null==n?void 0:n.analysis),l(null==n?void 0:n.choices.map((function(e){return e.choice_text})));var e=[];null==n||n.choices.map((function(t,n){t.is_answer&&e.push(n)})),x(e)}}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:L,Clear:A}}));var L=function(){if(!S)return u.b.info("请您输入题干"),!1;var e=s.findIndex((function(e){return!e}));if(e>-1)return u.b.info("请先输入 ".concat(q[e]," 选项的内容")),!1;if(!b.length)return u.b.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),!1;if(b.length<2)return u.b.info("多选题最小正确选项为2个"),!1;var t=s.map((function(e,t){return{choice_text:e,is_answer:b.includes(t)?1:0}}));return{name:S,choices:t,analysis:N}},A=function(){l(["","","",""]),E(""),T(""),x("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:S,onChange:function(e){return E(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),s.map((function(e,t){return y.a.createElement("div",{className:W.a.choiceWrap,key:t},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(b.includes(t)?W.a.activeAnswer:""),onClick:function(){b.includes(t)?x(b.filter((function(e){return e!==t}))):x([].concat(Object(P.a)(b),[t]))}},q[t])),y.a.createElement("div",{className:W.a.editorWrap},d===t?y.a.createElement(R.a,{id:"single-question-option-".concat(t),watch:!0,height:155,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){s[t]=e,l(s)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return p(t)}},y.a.createElement(k.a,{value:e}))),t>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){l(s.filter((function(e,n){return n!==t}))),b.includes(t)?x(b.filter((function(e){return e!==t}))):x([].concat(Object(P.a)(b),[t]))}})),t<7&&t===s.length-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return l([].concat(Object(P.a)(s),[""]))}})))})),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:N,onChange:function(e){return T(e)}}))},Y=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)($)),X=["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"],Z=function(e,t){var n=e.editData,i=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),o=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)([])),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)(),h=Object(f.a)(c,2),d=h[0],p=h[1],m=Object(v.useState)(),g=Object(f.a)(m,2),b=g[0],x=g[1],C=Object(v.useState)(""),w=Object(f.a)(C,2),S=w[0],E=w[1],_=Object(v.useState)(""),O=Object(f.a)(_,2),N=O[0],T=O[1];Object(v.useEffect)((function(){l(["","","",""])}),[]),Object(v.useEffect)((function(){n&&i&&(E(null==n?void 0:n.name),T(null==n?void 0:n.analysis),l(null==n?void 0:n.choices.map((function(e){return e.choice_text}))),x(null==n?void 0:n.choices.findIndex((function(e){return e.is_answer}))))}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:L,Clear:A}}));var L=function(){if(!S)return u.b.info("请您输入题干"),!1;var e=s.findIndex((function(e){return!e}));if(e>-1)return u.b.info("请先输入 ".concat(X[e]," 选项的内容")),!1;if(console.log("activeAnswer: ",b),"number"!=typeof b)return u.b.info("请设置本题的正确答案,点击选项A/B...即可完成设置"),!1;var t=s.map((function(e,t){return{choice_text:e,is_answer:b===t?1:0}}));return{name:S,choices:t,analysis:N}},A=function(){l(["","","",""]),E(""),T(""),x("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:S,onChange:function(e){return E(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),s.map((function(e,t){return y.a.createElement("div",{className:W.a.choiceWrap,key:t},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(b===t?W.a.activeAnswer:""),onClick:function(){return x(t)}},X[t])),y.a.createElement("div",{className:W.a.editorWrap},d===t?y.a.createElement(R.a,{id:"single-question-option-".concat(t),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:e,onChange:function(e){s[t]=e,l(s)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return p(t)}},y.a.createElement(k.a,{value:e}))),t>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){l(s.filter((function(e,n){return n!==t}))),t===b&&x(null)}})),t<7&&t===s.length-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return l([].concat(Object(P.a)(s),[""]))}})))})),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:N,onChange:function(e){return T(e)}}))},J=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(Z)),Q=function(e,t){var n=e.editData,i=(e.globalSetting,e.loading,e.dispatch,e.onRef,e.isEdit),r=(Object(I.a)(e,["editData","globalSetting","loading","dispatch","onRef","isEdit"]),Object(v.useState)("")),o=Object(f.a)(r,2),a=o[0],s=o[1],l=Object(v.useState)(""),c=Object(f.a)(l,2),h=c[0],d=c[1],p=Object(v.useState)(""),m=Object(f.a)(p,2),g=m[0],b=m[1];Object(v.useEffect)((function(){var e;n&&i&&(s(null==n?void 0:n.name),d(null==n?void 0:n.analysis),b(null==n||null===(e=n.answer_texts)||void 0===e?void 0:e[0]))}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:x,Clear:C}}));var x=function(){return a?g?{name:a,answer_texts:[g],analysis:h}:(u.b.info("请您输入参考答案"),!1):(u.b.info("请您输入题干"),!1)},C=function(){s(""),d(""),b("")};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"single-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:a,onChange:function(e){return s(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"参考答案:")),y.a.createElement(R.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"请您输入参考答案",defaultValue:g,onChange:function(e){return b(e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:h,onChange:function(e){return d(e)}}))},ee=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(Q)),te=n("k1fw"),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"],ie=function(e,t){e.globalSetting,e.loading,e.dispatch;var n=e.editData,i=(e.onRef,e.isEdit),o=(Object(I.a)(e,["globalSetting","loading","dispatch","editData","onRef","isEdit"]),Object(v.useState)("")),a=Object(f.a)(o,2),s=a[0],l=a[1],c=Object(v.useState)([]),h=Object(f.a)(c,2),d=h[0],p=h[1];console.log(d),Object(v.useEffect)((function(){var e;if(n&&i){l(null==n?void 0:n.name);var t=null==n||null===(e=n.sub_item_banks)||void 0===e?void 0:e.map((function(e){var t,n,i;return Object(te.a)(Object(te.a)({},e),{},{id:e.id,open:!1,qusList:null==e||null===(t=e.choices)||void 0===t?void 0:t.map((function(e){return e.choice_text})),activeQusEditor:null,qusAnswer:null===(n=[null==e||null===(i=e.choices)||void 0===i?void 0:i.findIndex((function(e){return e.is_answer}))])||void 0===n?void 0:n.filter((function(e){return-1!==e}))})}));p(t)}}),[n]),Object(v.useImperativeHandle)(t,(function(){return{onSave:m,Clear:g}}));var m=function(){if(!s)return u.b.info("请您输入题干"),!1;if(0===d.length)return u.b.info("请您添加小题"),!1;for(var e=0;e-1)return u.b.info("请先输入第".concat(e+1,"小题").concat(ne[i],"选项的内容")),!1;if(null==n||!n.qusAnswer.length)return u.b.info("请设置第".concat(e+1,"小题的正确答案,点击选项A/B...即可完成设置")),!1}var r=d.map((function(e){return{id:e.id>1?e.id:null,name:e.name,item_type:e.item_type,analysis:e.analysis,choices:e.qusList.map((function(t,n){return{choice_text:t,is_answer:e.qusAnswer[0]===n?1:0}}))}}));return{name:s,sub_item_banks:r}},g=function(){l(""),p([])},b=function(e,t,n){var i,r=Object(A.cloneDeep)(d);("open"===e&&(r[t].open=!r[t].open),"delete"===e&&r.splice(t,1),"value"===e&&(r[t].name=n),"answer"===e&&(r[t].qusAnswer=[n]),"edit"===e&&(r[t].activeQusEditor=n),"details"===e&&(r[t].qusList[r[t].activeQusEditor]=n),"addQus"===e&&(r[t].qusList=r[t].qusList.concat("")),"deleteQus"===e)&&(r[t].qusList=r[t].qusList.filter((function(e,t){return t!==n})),r[t].qusAnswer=null===(i=r[t].qusAnswer)||void 0===i?void 0:i.filter((function(e){return e!==n})));"analysis"===e&&(r[t].analysis=n),p(r)};return y.a.createElement("section",{className:W.a.wrap},y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"题干:")),y.a.createElement(R.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"请您输入题干",defaultValue:s,onChange:function(e){return l(e)}}),null==d?void 0:d.map((function(e,t){var n;return y.a.createElement("div",{className:W.a.fold,key:e.id},y.a.createElement("div",{onClick:function(){return b("open",t)},className:W.a.head},y.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:e.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),y.a.createElement("span",null,"第",t+1,"小题(单选题)"),y.a.createElement("b",{style:{visibility:"hidden"},onClick:function(e){e.stopPropagation(),b("delete",t)},className:"iconfont icon-shanchu8"})),y.a.createElement("div",{className:"mb10",style:{display:e.open?"block":"none"}},y.a.createElement(R.a,{watch:!0,height:155,placeholder:"请您输入题干",defaultValue:null==e?void 0:e.name,onChange:function(e){return b("value",t,e)}}),y.a.createElement("p",{className:W.a.titleWrap},y.a.createElement("span",{className:W.a.required},"*"),y.a.createElement("span",{className:W.a.title},"答案选项:",y.a.createElement("span",{className:W.a.colorGray},"点击选项可设置正确答案"))),null==e||null===(n=e.qusList)||void 0===n?void 0:n.map((function(n,i){var o,a;return y.a.createElement("div",{className:W.a.choiceWrap,key:i},y.a.createElement(r.a,{title:"点击设置为标准答案",placement:"left"},y.a.createElement("div",{className:"".concat(W.a.answer," ").concat(null!=e&&null!==(o=e.qusAnswer)&&void 0!==o&&o.includes(i)?W.a.activeAnswer:""),onClick:function(){return b("answer",t,i)}},ne[i])),y.a.createElement("div",{className:W.a.editorWrap},(null==e?void 0:e.activeQusEditor)===i?y.a.createElement(R.a,{id:"single-question-option-".concat(i),watch:!0,height:155,isFocus:!0,placeholder:"请您输入选项",defaultValue:n,onChange:function(e){return b("details",t,e)}}):y.a.createElement("div",{className:W.a.htmlWrap,onClick:function(){return b("edit",t,i)}},y.a.createElement(k.a,{value:n}))),i>1&&y.a.createElement(r.a,{title:"删除"},y.a.createElement("i",{className:"".concat(W.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return b("deleteQus",t,i)}})),i<7&&i===(null==e||null===(a=e.qusList)||void 0===a?void 0:a.length)-1&&y.a.createElement(r.a,{title:"新增参考答案"},y.a.createElement("i",{className:"".concat(W.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return b("addQus",t)}})))})),y.a.createElement("p",{className:"mb10 mt10"},y.a.createElement("span",{className:W.a.title},"题目解析:")),y.a.createElement(R.a,{id:"single-question-answer",watch:!0,height:155,placeholder:"请您输入题目解析",defaultValue:e.analysis,onChange:function(e){return b("analysis",t,e)}})))})))},re=Object(E.a)((function(e){var t=e.loading;return{globalSetting:e.globalSetting,loading:t.effects}}),null,null,{forwardRef:!0})(Object(v.forwardRef)(ie));t.a=function(e){var t,n,m,b,C,O,T,M,D=e.data,P=e.submit,I=e.goBack,R=e.loading,B=e.onTypeScore,z=e.editPreview,F=void 0!==z&&z,H=e.onSkipExamination,W=e.selectValue,V=e.onExchange,K=Object(v.useRef)(),q=Object(v.useRef)(Object(A.debounce)((function(){return le()}),100,{leading:!0,trailing:!0})),$=Object(v.useState)(null),X=Object(f.a)($,2),Z=X[0],Q=X[1],te=Object(v.useState)(!1),ne=Object(f.a)(te,2),ie=ne[0],oe=ne[1],ae=Object(S.i)();Object(v.useEffect)((function(){return window.addEventListener("scroll",null==q?void 0:q.current),function(){window.removeEventListener("scroll",null==q?void 0:q.current)}}),[]),Object(v.useEffect)((function(){oe(!0)}),[]),Object(v.useEffect)((function(){var e,t,n,i,r=null===(e=document.getElementById("examName"))||void 0===e||null===(t=e.getElementsByClassName("ant-pagination-options-quick-jumper"))||void 0===t||null===(n=t[0])||void 0===n||null===(i=n.childNodes)||void 0===i?void 0:i[2];r&&(r.nodeValue="份")}),[D]);var se=function(e){var t=parseInt(e);return isNaN(t)?"":t};var le=function(){var e,t,n,i,r=document.getElementById("preview_btns"),o=document.getElementById("preview_btns_else");n=0,i=0,document.body&&(n=document.body.scrollTop),document.documentElement&&(i=document.documentElement.scrollTop),(n-i>0?n:i)+("CSS1Compat"==document.compatMode?document.documentElement.clientHeight:document.body.clientHeight)>=(e=0,t=0,document.body&&(e=document.body.scrollHeight),document.documentElement&&(t=document.documentElement.scrollHeight),(e-t>0?e:t)-68)?(r.style.visibility="hidden",o.style.visibility="visible"):(r.style.visibility="visible",o.style.visibility="hidden")},ce=["容易","简单","适中","困难"],ue=function(e){var t;return y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",null==e||null===(t=e.answer_texts)||void 0===t?void 0:t[0]),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==e?void 0:e.discipline_name,"/").concat(null==e?void 0:e.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name)))},he=["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"],de=function(e){console.log(e,"key"),H(e-1)},pe=function(){return y.a.createElement(y.a.Fragment,null,y.a.createElement(a.a,{color:"#55575D",overlayClassName:x.a.popover,visible:ie,getPopupContainer:function(e){return null==e?void 0:e.parentNode},content:"如您对此份试题满意,可将此份试题保存为固定试卷"},y.a.createElement(s.a,{onMouseEnter:function(){return oe(!0)},onMouseLeave:function(){return oe(!1)},onClick:function(){var e,t;t="",p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"保存试卷",content:y.a.createElement("div",{className:x.a.modalColumn},y.a.createElement("div",{style:{color:"#676A6C",display:"flex"},className:"font14 mt20"},y.a.createElement("img",{style:{marginRight:5},src:j.a}),"保存后单独生成一份人工组卷类型的固定试卷。"),y.a.createElement("div",{className:x.a.modalRow,style:{marginTop:20}},y.a.createElement("sup",{className:x.a.sup},"*"),y.a.createElement("span",{style:{flexShrink:0}},"试卷名称:"),y.a.createElement(c.a,{placeholder:"请输入试卷名称",min:0,maxLength:60,defaultValue:t,onChange:function(e){t=e.target.value}}))),okText:"确认",cancelText:"取消",onOk:(e=Object(h.a)(g.a.mark((function e(){var n,i,r,o,a;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=3;break}return u.b.warn("试卷名称不能为空"),e.abrupt("return",Promise.reject());case 3:return i=[],r=[],o=[],null==D||null===(n=D.questionList)||void 0===n||n.forEach((function(e){var t;null===(t=e.questions)||void 0===t||t.forEach((function(t){i.push(t.id),r.push(e.questions_score/e.questions_count),"COMBINATION"===e.type&&o.push({id:t.id,sub_item_bank_ids:t.sub_item_banks.map((function(e){return e.id}))})}))})),console.log("-----",o),a={item_bank_ids:i,item_bank_scores:r,name:t,combination_item_banks:o},e.next=11,P(a);case 11:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})}},"保存")),y.a.createElement(s.a,{onClick:function(){document.body.scrollIntoView(),I()}},"返回"),y.a.createElement(s.a,{loading:R,onClick:function(){return P()},type:"primary"},"提交"))},fe=function(){var e;return y.a.createElement(y.a.Fragment,null,y.a.createElement(s.a,{onClick:I},"返回"),W>0&&y.a.createElement(s.a,{onClick:function(){return de(W)},type:"primary"},"上一份"),W<(null==D||null===(e=D.exam)||void 0===e?void 0:e.total_num)-1&&y.a.createElement(s.a,{onClick:function(){return de(W+2)}},"下一份"))},me=function(){var e=Object(h.a)(g.a.mark((function e(t,n){var i,r,o,a,s,l,c,h,d,p;return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(i=K.current)||void 0===i?void 0:i.onSave();case 2:if(r=e.sent){e.next=5;break}return e.abrupt("return");case 5:return o={question_score:n.score,analysis:r.analysis},console.log(r,"editorData"),"SINGLE"!==t&&"MULTIPLE"!==t&&"JUDGMENT"!==t||(s=[],l=[],o.question_type="JUDGMENT"===t?2:1,o.question_title=null==r?void 0:r.name,null==r||null===(a=r.choices)||void 0===a||a.forEach((function(e,t){s.push(e.choice_text),null!=e&&e.is_answer&&l.push(t+1)})),o.question_choices=s,o.standard_answers=l),"COMPLETION"===t&&(o.is_ordered=r.is_ordered,o.question_title=null==r?void 0:r.name,o.question_type=3,h=[],null==r||null===(c=r.standard_answers)||void 0===c||c.forEach((function(e,t){h.push({choice_id:e.position,answer_text:e.answer_text})})),o.standard_answers=h),"SUBJECTIVE"===t&&(o.question_title=null==r?void 0:r.name,o.question_type=3,o.standard_answers=null==r?void 0:r.answer_texts),"COMBINATION"===t&&(o.question_title=null==r?void 0:r.name,o.question_type=7,o.sub_questions=null==r||null===(d=r.sub_item_banks)||void 0===d?void 0:d.map((function(e,t){return{id:e.id,question_title:e.name,question_type:1,question_choices:e.choices.map((function(e){return e.choice_text})),standard_answers:[e.choices.findIndex((function(e){return e.is_answer}))+1],analysis:e.analysis}})),delete o.analysis),e.next=13,Object(_.a)("/api/exercise_questions/".concat(n.id,".json"),{method:"put",body:o});case 13:0===(null==(p=e.sent)?void 0:p.status)&&(u.b.success("编辑成功"),de(W+1)),Q(null);case 16:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();console.log(function(){for(var e=[],t=0;t<(null==D||null===(n=D.exam)||void 0===n?void 0:n.total_num);t++){var n;e.push({})}return e}(),"data");var ge=null==D||null===(t=D.questionList)||void 0===t?void 0:t.reduce((function(e,t){return e+t.questions_score}),0),ve=F&&1!==(null==D||null===(n=D.exam)||void 0===n?void 0:n.exercise_status);return y.a.createElement("section",{className:x.a.wrap},y.a.createElement("div",{id:"id_left_preview",className:x.a.left,onMouseEnter:function(e){document.getElementById("id_left_preview").style.overflowY="auto"},onMouseLeave:function(e){document.getElementById("id_left_preview").style.overflowY="hidden"}},y.a.createElement("div",{className:x.a.title},y.a.createElement("div",null,y.a.createElement("b",null),y.a.createElement("span",null,"答题卡"))),y.a.createElement("div",{className:x.a.total},y.a.createElement("div",null,y.a.createElement("img",{src:N.a}),y.a.createElement("span",null,"题数(道)"),y.a.createElement("aside",null,null==D?void 0:D.all_questions_count)),y.a.createElement("div",{className:"mr30 ml30"},y.a.createElement("img",{src:L.a}),y.a.createElement("span",null,"总分(分)"),y.a.createElement("aside",null,ge)),y.a.createElement("div",null,y.a.createElement("img",{src:w.a}),y.a.createElement("span",null,"时长(分)"),y.a.createElement("aside",null,null==D||null===(m=D.exam)||void 0===m?void 0:m.time))),null==D||null===(b=D.questionList)||void 0===b?void 0:b.map((function(e,t){var n;return y.a.createElement("div",{className:x.a.list,key:t},y.a.createElement("div",{className:x.a.name},y.a.createElement("b",null),y.a.createElement("span",null,e.name)),y.a.createElement("aside",null,y.a.createElement("div",null,"共",y.a.createElement("span",{className:x.a.b},e.questions_count),"题 ",y.a.createElement("span",{className:x.a.l},"|"),"共",y.a.createElement("span",{className:x.a.r},e.questions_score),"分"),y.a.createElement("div",{className:x.a.answerSheet},null==e||null===(n=e.questions)||void 0===n?void 0:n.map((function(e,t){return y.a.createElement("div",{onClick:function(){var t="Anchor_".concat(e.id),n=document.getElementById(t);n&&setTimeout((function(){return n.scrollIntoView({block:"center",behavior:"smooth"})}))},key:e.id,className:x.a.tag},t+1)})))))}))),y.a.createElement("div",{className:x.a.right},y.a.createElement("div",{className:x.a.examName,id:"examName"},y.a.createElement("div",{className:x.a.name},y.a.createElement(r.a,{title:null==D||null===(C=D.exam)||void 0===C?void 0:C.name,getPopupContainer:function(e){return e.parentNode}},y.a.createElement("span",{className:x.a.t},null==D||null===(O=D.exam)||void 0===O?void 0:O.name))),F?y.a.createElement(i.a,{showTotal:function(e){return y.a.createElement("span",{style:{color:"#656F87",fontSize:14}},"共计",y.a.createElement("span",{className:"c-light-primary"},e),"份试卷")},total:null==D||null===(T=D.exam)||void 0===T?void 0:T.total_num,pageSize:1,current:W+1,showSizeChanger:!1,onChange:de,showQuickJumper:!0,hideOnSinglePage:!1}):y.a.createElement(s.a,{onClick:function(){var e,t=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认更换预览中的所有试题吗?",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(e=Object(h.a)(g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.update({cancelButtonProps:{disabled:!0}}),e.next=3,V();case 3:t.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成整张试题");case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},type:"primary"},"随机更换")),y.a.createElement("div",{className:x.a.topWarp},null==D||null===(M=D.questionList)||void 0===M?void 0:M.map((function(e,t){var n,i;return y.a.createElement(y.a.Fragment,{key:t},y.a.createElement("div",{className:x.a.head,style:0===t?{border:0,marginTop:-16}:{}},y.a.createElement("div",{className:x.a.name},y.a.createElement("b",null),y.a.createElement("span",null,e.name)),y.a.createElement("div",{className:x.a.so},"共",y.a.createElement("span",{className:x.a.b},e.questions_count," "),"题 ","COMBINATION"===e.type&&"(包含".concat(null==e||null===(n=e.questions)||void 0===n?void 0:n.map((function(e){var t;return null==e||null===(t=e.sub_item_banks)||void 0===t?void 0:t.length})).reduce((function(e,t){return e+t})),"小题)"),y.a.createElement("span",{className:x.a.l},"|"),"共",y.a.createElement("span",{className:x.a.r},e.questions_score),"分"),!F&&y.a.createElement("div",{className:x.a.btn},y.a.createElement(s.a,{onClick:function(){!function(e){console.log("---",e);var t=[];e.questions.map((function(e){return null==e?void 0:e.sub_item_banks.map((function(e){t.push(e)}))}));var n,i=0;i="COMBINATION"===e.type?e.questions_score/t.length:e.questions_score/e.questions_count,p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"分数设置",content:y.a.createElement("div",{className:x.a.modalColumn},y.a.createElement("div",{className:x.a.modalRow,style:{justifyContent:"flex-start"}},y.a.createElement("sup",{className:x.a.sup},"*"),y.a.createElement("span",null,null==e?void 0:e.name,"COMBINATION"===(null==e?void 0:e.type)&&"中的每小题",":"),y.a.createElement(d.a,{min:1,parser:se,defaultValue:i,onChange:function(e){i=e}}),y.a.createElement("span",{className:"ml5"},"分/题"))),okText:"确认",cancelText:"取消",onOk:(n=Object(h.a)(g.a.mark((function n(){var r,o;return g.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i){n.next=3;break}return u.b.warn("分数不能为空或为0"),n.abrupt("return",Promise.reject());case 3:"COMBINATION"===e.type?(r={type:null==e?void 0:e.type,score:i,scoreTotal:i*(null==t?void 0:t.length)},B(r)):(o={type:null==e?void 0:e.type,score:i,scoreTotal:i*e.questions_count},B(o));case 4:case"end":return n.stop()}}),n)}))),function(){return n.apply(this,arguments)})})}(e)},type:"primary",ghost:!0,className:"mr20"},"设置得分"),y.a.createElement(s.a,{onClick:function(){return r=null===(n=(t=e).questions)||void 0===n?void 0:n.map((function(e){return e.id})),o=t.name,void(a=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:"确认更换".concat(o,"中的所有试题吗?"),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(i=Object(h.a)(g.a.mark((function e(){return g.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a.update({cancelButtonProps:{disabled:!0}}),e.next=3,V({seleted_item_bank_ids:r},{type:t.type});case 3:a.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成".concat(o,"试题"));case 5:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})}));var t,n,i,r,o,a},type:"primary",ghost:!0},"随机更换"))),null==e||null===(i=e.questions)||void 0===i?void 0:i.map((function(t,n){return Z===t.id?y.a.createElement("div",{id:"Anchor_".concat(t.id),className:x.a.content,style:{padding:0,marginTop:10},key:t.id},y.a.createElement("div",{style:{float:"right",marginTop:-6}},y.a.createElement(s.a,{onClick:function(){return Q(null)},className:"mr20",type:"primary",ghost:!0},"取消"),y.a.createElement(s.a,{onClick:function(){return me(null==e?void 0:e.type,t)},type:"primary"},"保存")),function(e,t){if(console.log(e,222),"SINGLE"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(J,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("MULTIPLE"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(Y,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("JUDGMENT"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(U,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("COMPLETION"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(G,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("SUBJECTIVE"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(ee,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));if("COMBINATION"===t)return y.a.createElement(y.a.Fragment,null,y.a.createElement(re,{ref:K,editData:e,isEdit:!0}),y.a.createElement(o.a,null));var n;"PROGRAM"===t&&E.d.push("/problems/".concat(null==e||null===(n=e.program_attr)||void 0===n?void 0:n.identifier,"/edit?type=exercises&express_id=").concat(ae.categoryId,"&question_id=").concat(null==e?void 0:e.id,"&score=").concat(null==e?void 0:e.score,"&callback_url=").concat(location.pathname,"&select=").concat(W,"&exercise=true"))}(t,e.type)):y.a.createElement("div",{id:"Anchor_".concat(t.id),className:x.a.content,key:t.id},y.a.createElement("div",{className:x.a.titleWrap},y.a.createElement(k.a,{style:{paddingRight:10},className:x.a.titleHtml,value:n+1+"、"+"".concat("combination"===(null==t?void 0:t.item_type)?"(题干)":"")+t.name}),F&&y.a.createElement(s.a,{disabled:ve,onClick:function(){Z?u.b.warn("先保存或取消当前正在编辑的试题"):Q(t.id)},type:"primary",className:"mr20",style:{marginLeft:"auto"},ghost:!0},"编辑"),y.a.createElement(s.a,{disabled:ve,onClick:function(){return function(e,t,n,i){var r,o,a=null===(r=i.questions)||void 0===r?void 0:r.map((function(e){return e.id})),s="default",c=p.a.confirm({icon:null,className:"custom-modal-divider",centered:!0,title:"温馨提示",content:y.a.createElement("div",null,y.a.createElement("p",null,"系统按以下规则为您更换该试题"),y.a.createElement("div",null,y.a.createElement("span",null,"使用频度:"),y.a.createElement(l.a.Group,{defaultValue:s,onChange:function(e){s=e.target.value}},y.a.createElement(l.a,{value:"default"},"不设定"),y.a.createElement(l.a,{value:"high"},"使用次数高"),y.a.createElement(l.a,{value:"low"},"使用次数低")))),cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"确认",cancelText:"取消",onOk:(o=Object(h.a)(g.a.mark((function i(){return g.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return c.update({cancelButtonProps:{disabled:!0}}),i.next=3,V({single_question_id:e,seleted_item_bank_ids:a,type:s},{type:t,index:n});case 3:c.update({cancelButtonProps:{disabled:!1}}),u.b.success("已重新随机生成试题");case 5:case"end":return i.stop()}}),i)}))),function(){return o.apply(this,arguments)})})}(t.id,e.type,n,e)},type:"primary",ghost:!0},"换一题")),("SINGLE"===e.type||"JUDGMENT"===e.type||"MULTIPLE"===e.type)&&(c=t,f=[],y.a.createElement(y.a.Fragment,null,y.a.createElement("aside",{className:x.a.single},null==c||null===(d=c.choices)||void 0===d?void 0:d.map((function(e,t){return e.is_answer&&f.push(he[t]),y.a.createElement("ul",{key:t},y.a.createElement("li",null,he[t],"、"),y.a.createElement("li",null,y.a.createElement(k.a,{value:e.choice_text})))}))),y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",f.join(""),y.a.createElement("span",{className:"ml30"},"难度:",ce[c.difficulty])),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:c.analysis?c.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==c?void 0:c.discipline_name,"/").concat(null==c?void 0:c.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==c?void 0:c.tag_discipline_name))))),"COMPLETION"===e.type&&function(e){var t,n=null==e||null===(t=e.standard_answer)||void 0===t?void 0:t.map((function(e){var t;return"答案(填空".concat(e.position,"):").concat(null==e||null===(t=e.answer_text)||void 0===t?void 0:t.join("、"))}));return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",n),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==e?void 0:e.discipline_name,"/").concat(null==e?void 0:e.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name))))}(t),"SUBJECTIVE"===e.type&&ue(t),"FILEUPLOAD"===e.type&&ue(t),"PHOTOGRAPH"===e.type&&ue(t),"PROGRAM"===e.type&&function(e){var t;return y.a.createElement("div",{className:x.a.analysis},y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"预期输出:"),y.a.createElement(k.a,{value:null==e||null===(t=e.program_attr)||void 0===t?void 0:t.description})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==e?void 0:e.discipline_name,"/").concat(null==e?void 0:e.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==e?void 0:e.tag_discipline_name)))}(t),"COMBINATION"===e.type&&(i=t,r=n,y.a.createElement("div",null,null==i||null===(a=i.sub_item_banks)||void 0===a?void 0:a.map((function(e,t){var n,o=[];return y.a.createElement(y.a.Fragment,null,y.a.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333"}},r+1+"."+(t+1),"(单选题)",e.name),y.a.createElement("aside",{className:x.a.single},null==e||null===(n=e.choices)||void 0===n?void 0:n.map((function(e,t){return e.is_answer&&o.push(he[t]),y.a.createElement("ul",{key:t},y.a.createElement("li",null,he[t],"、"),y.a.createElement("li",null,y.a.createElement(k.a,{value:e.choice_text})))}))),y.a.createElement("div",{className:x.a.analysis},y.a.createElement("div",null,"正确答案:",o.join(""),y.a.createElement("span",{className:"ml30"},"难度:",ce[e.difficulty])),y.a.createElement("aside",null,y.a.createElement("span",{className:x.a.text},"解析:"),y.a.createElement(k.a,{value:e.analysis?e.analysis:"暂无解析"})),y.a.createElement("ul",null,y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#007AFF",marginRight:10}},"方向&课程:"),"".concat(null==i?void 0:i.discipline_name,"/").concat(null==i?void 0:i.sub_discipline_name)),y.a.createElement("li",null,y.a.createElement("span",{style:{color:"#5AB891",marginRight:10}},"知识点:"),null==i?void 0:i.tag_discipline_name))))})))),y.a.createElement("div",null));var i,r,a,c,d,f})))}))),y.a.createElement("div",{className:x.a.btnsElse,id:"preview_btns_else"},F?fe():pe()),y.a.createElement("div",{className:x.a.btnsWrap,id:"preview_btns"},y.a.createElement("div",{className:x.a.btns},F?fe():pe()))))}},sboe: /*!*************************************************!*\ !*** ./node_modules/rc-tree/es/contextTypes.js ***! \*************************************************/ /*! exports provided: TreeContext */ /*! exports used: TreeContext */function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var i=n(/*! react */"q1tI"),r=i.createContext(null)},tmPe: /*!***************************************************************************************************!*\ !*** ./src/pages/Paperlibrary/Random/AddAndEdit/components/StepTwo/CustomTree/index.less?modules ***! \***************************************************************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={flex_box_center:"flex_box_center___ivyUy",flex_space_between:"flex_space_between___1h8Qq",flex_box_vertical_center:"flex_box_vertical_center___3eC95",flex_box_center_end:"flex_box_center_end___nrhvX",flex_box_column:"flex_box_column___2po4_",customTree:"customTree___1LpRW",name:"name___17ZTs"}},vHTk: /*!******************************************************!*\ !*** ./src/components/PreviewAll/index.less?modules ***! \******************************************************/ /*! no static exports found */ /*! exports used: default */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,n){e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wU8J: /*!*********************************************!*\ !*** ./node_modules/qr.js/lib/BitBuffer.js ***! \*********************************************/ /*! no static exports found */ /*! all exports used */ /*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){function n(){this.buffer=new Array,this.length=0}n.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=n}}]);